-
Notifications
You must be signed in to change notification settings - Fork 9
/
issabel-geoip.spec
145 lines (107 loc) · 3.69 KB
/
issabel-geoip.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
%define modname geoip
Name: issabel-geoip
Version: 1.6.12
Release: 4
Summary: GeoIP
Group: System Environment/Base
License: GPLv2
Url: http://www.issabel.org
Source0: issabel-%{modname}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Source1: geoip_update.sh
Source2: geoip-csv-to-dat.cpp
Source3: 20_convert_dbip
Source4: 20_convert_geolite2
Source5: 20_build_xtables
Source10: GeoIP-initial.dat
Source11: GeoIPv6-initial.dat
Patch0: geoip-kosovo-patch.diff
Obsoletes: GeoIP < %{version}-%{release}
Provides: GeoIP = %{version}-%{release}
Requires: gzip
Requires: wget
Requires: issabel-framework
#BuildArch: noarch
%description
This package contains geoip salsa
%package devel
Summary: Development headers and libraries for GeoIP
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Provides: GeoIP-devel = %{version}-%{release}
Obsoletes: GeoIP-devel < %{version}-%{release}
%description devel
Development headers and static libraries for building GeoIP-based applications.
%prep
%setup -q -c issabel-%{modname}-%{version}
echo "prep"
pwd
ls -la
cd issabel-%{modname}-%{version}/geoip-api-c-main
cp %{SOURCE2} .
%patch0 -p0
%build
echo "build"
cd issabel-%{modname}-%{version}/geoip-api-c-main
./bootstrap
%configure --disable-static --disable-dependency-tracking
# Kill bogus rpaths
sed -i -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
-e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
g++ -o geoip-csv-to-dat -L libGeoIP/.libs -lGeoIP geoip-csv-to-dat.cpp
%install
mkdir -p $RPM_BUILD_ROOT/usr/share/GeoIP/
mkdir -p $RPM_BUILD_ROOT/usr/share/geoip/
mkdir -p $RPM_BUILD_ROOT/usr/bin
ls -la
find . -name geoip-csv-to-dat
install -Dpm 755 issabel-%{modname}-%{version}/geoip-api-c-main/geoip-csv-to-dat $RPM_BUILD_ROOT/usr/bin
cd issabel-%{modname}-%{version}/geoip-api-c-main
#rm -rf $RPM_BUILD_ROOT
make DESTDIR=%{buildroot} install
# nix the stuff we don't need like .la files.
rm -f %{buildroot}%{_libdir}/*.la
install -Dpm 755 %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.daily/geoip_update.sh
install -Dpm 755 %{SOURCE3} %{buildroot}%{_datadir}/geoip/
install -Dpm 755 %{SOURCE4} %{buildroot}%{_datadir}/geoip/
install -Dpm 755 %{SOURCE5} %{buildroot}%{_datadir}/geoip/
install -p -m 644 %{SOURCE10} %{buildroot}%{_datadir}/GeoIP/
install -p -m 644 %{SOURCE11} %{buildroot}%{_datadir}/GeoIP/
# make the default GeoIP.dat a symlink to our -initial data file.
ln -sf GeoIP-initial.dat %{buildroot}%{_datadir}/GeoIP/GeoIP.dat
ln -sf GeoIPv6-initial.dat %{buildroot}%{_datadir}/GeoIP/GeoIPv6.dat
%post
echo UPDATING GEOIP DATABASE...
/etc/cron.daily/geoip_update.sh &> /dev/null || :
%clean
rm -rf $RPM_BUILD_ROOT
%files
# LGPLv2+
#%doc AUTHORS COPYING ChangeLog README TODO LICENSE* fetch-*
%{_bindir}/geoiplookup
%{_bindir}/geoip-csv-to-dat
%{_bindir}/geoiplookup6
%dir %{_datadir}/GeoIP/
%{_datadir}/GeoIP/GeoIP-initial.dat
%{_datadir}/GeoIP/GeoIPv6-initial.dat
# The other databases are %%verify(not md5 size mtime) so that they can be updated via the cron scripts
# and rpm will not moan about the files having changed
%verify(not md5 size link mtime) %{_datadir}/GeoIP/GeoIP.dat
%verify(not md5 size link mtime) %{_datadir}/GeoIP/GeoIPv6.dat
%{_libdir}/libGeoIP.so.1
%{_libdir}/libGeoIP.so.1.*
%{_mandir}/man1/geoiplookup.1*
%{_mandir}/man1/geoiplookup6.1*
%defattr(755, root, root)
/etc/cron.daily/geoip_update.sh
/usr/share/geoip/20_convert_dbip
/usr/share/geoip/20_convert_geolite2
/usr/share/geoip/20_build_xtables
%files devel
# LGPLv2+
%{_includedir}/GeoIP.h
%{_includedir}/GeoIPCity.h
%{_libdir}/libGeoIP.so
%{_libdir}/pkgconfig/geoip.pc
%changelog