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: 469b827f3064eafe4a47b9318e933345
10 Source1: http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz
11 # Source1-md5: 6cab8b7818ce94826a01f9a6e9254fd3
12 Source2: http://geolite.maxmind.com/download/geoip/database/LICENSE.txt
13 # Source2-md5: a1381bd1aa0a0c91dc31b3f1e847cf4a
14 Source3: http://xtables-addons.git.sourceforge.net/git/gitweb.cgi?p=xtables-addons/xtables-addons;a=blob_plain;f=geoip/xt_geoip_build
15 # Source3-md5: 9933235c5d9c4c7fbad965d6317f8c2f
16 BuildRequires: perl-Text-CSV_XS >= 0.69
17 BuildRequires: perl-base
19 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21 %define dbdir /usr/share/xt_geoip
23 # no debuginfo to package
24 %define _enable_debug_packages 0
26 %ifarch ppc sparc ppc64 sparc64 sparcv9
33 The package contains the GeoIP definition files (which IP addresses
34 belong to which country) that are needed for Xtables-addons's xt_geoip
40 ver=$(stat -c '%y' GeoIPCountryWhois.csv | awk '{print $1}' | tr -d -)
41 if [ "$ver" != %{version} ]; then
45 gunzip -c %{SOURCE1} >GeoIPv6.csv
49 %{__perl} %{SOURCE3} GeoIPCountryWhois.csv GeoIPv6.csv | tee ranges.txt
52 rm -rf $RPM_BUILD_ROOT
53 install -d $RPM_BUILD_ROOT%{dbdir}
54 cp -a %{byteorder} $RPM_BUILD_ROOT%{dbdir}
57 rm -rf $RPM_BUILD_ROOT
60 %defattr(644,root,root,755)
61 %doc LICENSE.txt ranges.txt