1 Summary: GeoIP database files for xt_geoip
5 License: GPL, Open Data License
6 Group: Networking/Admin
7 URL: http://www.maxmind.com/
8 Source0: http://jengelh.medozas.de/files/geoip/geoip_src.tar.bz2
9 # Source0-md5: bbcb1edd6ce2ece229d3e61173c7cadc
10 Source1: http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
11 # Source1-md5: 1f67a4cb38b49eae4d64636557d0d1a7
12 Source2: http://geolite.maxmind.com/download/geoip/database/LICENSE.txt
13 # Source2-md5: a1381bd1aa0a0c91dc31b3f1e847cf4a
14 BuildRequires: perl-Text-CSV_XS >= 0.69
15 BuildRequires: perl-base
17 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
19 %define dbdir /usr/share/xt_geoip
21 %ifarch ppc sparc ppc64 sparc64 sparcv9
28 The package contains the GeoIP definition files (which IP addresses
29 belong to which country) that are needed for Xtables-addons's xt_geoip
34 rm -f GeoIPCountryWhois.csv
37 ver=$(stat -c '%y' GeoIPCountryWhois.csv | awk '{print $1}' | tr -d -)
38 if [ "$ver" != %{version} ]; then
45 install -d %{byteorder}
47 %if "%{byteorder}" == "BE"
48 %{__perl} ../geoip_csv_iv0.pl -b ../GeoIPCountryWhois.csv | tee ../ranges.txt
50 %{__perl} ../geoip_csv_iv0.pl ../GeoIPCountryWhois.csv | tee ../ranges.txt
54 rm -rf $RPM_BUILD_ROOT
55 install -d $RPM_BUILD_ROOT%{dbdir}/%{byteorder}
56 cp -a %{byteorder}/* $RPM_BUILD_ROOT%{dbdir}/%{byteorder}
59 rm -rf $RPM_BUILD_ROOT
62 %defattr(644,root,root,755)
63 %doc LICENSE.txt ranges.txt