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://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
9 # Source0-md5: 14d2a5c6845f4e3df46c992ffca209d9
10 Source1: http://geolite.maxmind.com/download/geoip/database/LICENSE.txt
11 # Source1-md5: a1381bd1aa0a0c91dc31b3f1e847cf4a
12 Source2: http://xtables-addons.git.sf.net/git/gitweb.cgi?p=xtables-addons/xtables-addons;a=blob_plain;f=geoip/geoip_build_db.pl
13 # Source2-md5: 7cd5c1ab1d83a94d84ae918f0805603f
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 # no debuginfo to package
22 %define _enable_debug_packages 0
24 %ifarch ppc sparc ppc64 sparc64 sparcv9
31 The package contains the GeoIP definition files (which IP addresses
32 belong to which country) that are needed for Xtables-addons's xt_geoip
38 ver=$(stat -c '%y' GeoIPCountryWhois.csv | awk '{print $1}' | tr -d -)
39 if [ "$ver" != %{version} ]; then
46 install -d %{byteorder}
47 %if "%{byteorder}" == "BE"
48 %{__perl} %{SOURCE2} -D %{byteorder} -b ../GeoIPCountryWhois.csv | tee ranges.txt
50 %{__perl} %{SOURCE2} -D %{byteorder} 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