]> git.pld-linux.org Git - packages/xtables-geoip.git/blame - xtables-geoip.spec
- migrate database source to GeoLite2 (GeoLite Legacy databases are being discontinue...
[packages/xtables-geoip.git] / xtables-geoip.spec
CommitLineData
a9e058f3 1Summary: GeoIP database files for xt_geoip
b7f9561d 2Summary(pl.UTF-8): Pliki baz danych GeoIP dla xt_geoip
a9e058f3 3Name: xtables-geoip
26944ea1 4Version: 20181023
c1500f15 5Release: 1
2ce9a429 6License: GPL, Open Data License
a9e058f3 7Group: Networking/Admin
26944ea1
AO
8Source0: http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip
9# Source0-md5: 1f5524d5ac54a779831bffc57d91e2a2
10Source1: http://geolite.maxmind.com/download/geoip/database/LICENSE.txt
11# Source1-md5: a1381bd1aa0a0c91dc31b3f1e847cf4a
12Source2: http://sourceforge.net/p/xtables-addons/xtables-addons/ci/master/tree/geoip/xt_geoip_build?format=raw&/xt_geoip_build
13# Source2-md5: 462ca00be38471d19dc6e0f32c098275
b7f9561d 14URL: http://www.maxmind.com/
e77737fd 15BuildRequires: perl-Text-CSV_XS >= 0.69
2ce9a429 16BuildRequires: perl-base
2ec6929c 17BuildRequires: rpm >= 4.4.9-56
3be77cb9 18BuildRequires: unzip
a9e058f3 19BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20
1f56ba0c
ER
21%define dbdir /usr/share/xt_geoip
22
14600c7f
ER
23# no debuginfo to package
24%define _enable_debug_packages 0
25
b7f9561d 26%ifarch ppc ppc64 s390 s390x sparc sparc64 sparcv9
377423bf
ER
27%define byteorder BE
28%else
29%define byteorder LE
30%endif
31
a9e058f3 32%description
33The package contains the GeoIP definition files (which IP addresses
34belong to which country) that are needed for Xtables-addons's xt_geoip
35module.
36
b7f9561d
JB
37%description -l pl.UTF-8
38Ten pakiet zawiera pliki definicji GeoIP (określające, które adresy IP
39należą do jakiego kraju), wymagane przez moduł xt_geoip z pakietu
40xtables-addons.
41
a9e058f3 42%prep
2ce9a429 43%setup -qc
2ce9a429 44
26944ea1 45ver=$(ls -d GeoLite2-Country-CSV_* | head -1 | %{__sed} 's/^GeoLite2-Country-CSV_//')
2ce9a429
ER
46if [ "$ver" != %{version} ]; then
47 exit 1
48fi
49
26944ea1 50cp -p %{SOURCE1} .
2ce9a429
ER
51
52%build
26944ea1
AO
53%{__mkdir} %{byteorder}
54%{__perl} %{SOURCE2} -S GeoLite2-Country-CSV_%{version} -D %{byteorder} > ranges.txt
a9e058f3 55
56%install
57rm -rf $RPM_BUILD_ROOT
a29328a9
ER
58install -d $RPM_BUILD_ROOT%{dbdir}
59cp -a %{byteorder} $RPM_BUILD_ROOT%{dbdir}
a9e058f3 60
2ec6929c
ER
61%if "%{pld_release}" == "ac"
62# handle older xtables in ac:
63# kernel-net-xtables-addons-1.18-15@2.6.27.53_1.amd64
64# still having old .iv0 names requirement
65# http://xtables-addons.git.sourceforge.net/git/gitweb.cgi?p=xtables-addons/xtables-addons;a=commitdiff;h=25bf680ead80e505d5073308f151b4007cb5683f
66# create hardlink, to be most compatible
67for a in $RPM_BUILD_ROOT%{dbdir}/%{byteorder}/*.iv4; do
68 ln $a ${a%.iv4}.iv0
69done
bc09a2c1
ER
70# kernel-net-xtables-addons-1.18-8@2.6.27.45_1.i686 searches from /var/lib:
71# Could not open /var/lib/geoip/LE/EE.iv0: No such file or directory
72install -d $RPM_BUILD_ROOT/var/lib
73ln -s %{_datadir}/xt_geoip $RPM_BUILD_ROOT/var/lib/geoip
2ec6929c
ER
74%endif
75
b7f9561d
JB
76%clean
77rm -rf $RPM_BUILD_ROOT
78
68d22166
ER
79%if "%{pld_release}" == "ac"
80%pretrans
81# this needs to be a symlink
82if [ -d /var/lib/geoip -a ! -L /var/lib/geoip ]; then
83 mv -f /var/lib/geoip{,.rpmsave}
0f946888
ER
84 install -d %{dbdir}
85 ln -s %{dbdir} /var/lib/geoip
68d22166
ER
86fi
87%endif
88
a9e058f3 89%files
90%defattr(644,root,root,755)
e399ee80 91%doc LICENSE.txt ranges.txt
377423bf
ER
92%dir %{dbdir}
93%{dbdir}/%{byteorder}
bc09a2c1
ER
94
95%if "%{pld_release}" == "ac"
96/var/lib/geoip
97%endif
This page took 0.312859 seconds and 4 git commands to generate.