]>
Commit | Line | Data |
---|---|---|
a9e058f3 | 1 | Summary: GeoIP database files for xt_geoip |
2 | Name: xtables-geoip | |
01760299 | 3 | Version: 20100702 |
377423bf | 4 | Release: 2 |
2ce9a429 | 5 | License: GPL, Open Data License |
a9e058f3 | 6 | Group: Networking/Admin |
2a48ce95 | 7 | URL: http://www.maxmind.com/ |
2ce9a429 ER |
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 | |
01760299 | 11 | # Source1-md5: 07b16052593867747403c7c6841d3e7b |
2ce9a429 ER |
12 | Source2: http://geolite.maxmind.com/download/geoip/database/LICENSE.txt |
13 | # Source2-md5: a1381bd1aa0a0c91dc31b3f1e847cf4a | |
e77737fd | 14 | BuildRequires: perl-Text-CSV_XS >= 0.69 |
2ce9a429 | 15 | BuildRequires: perl-base |
3be77cb9 | 16 | BuildRequires: unzip |
a9e058f3 | 17 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
18 | ||
1f56ba0c ER |
19 | %define dbdir /usr/share/xt_geoip |
20 | ||
377423bf ER |
21 | %ifarch ppc sparc ppc64 sparc64 sparcv9 |
22 | %define byteorder BE | |
23 | %else | |
24 | %define byteorder LE | |
25 | %endif | |
26 | ||
a9e058f3 | 27 | %description |
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 | |
30 | module. | |
31 | ||
32 | %prep | |
2ce9a429 ER |
33 | %setup -qc |
34 | rm -f GeoIPCountryWhois.csv | |
35 | %setup -qD -a1 | |
36 | ||
37 | ver=$(stat -c '%y' GeoIPCountryWhois.csv | awk '{print $1}' | tr -d -) | |
38 | if [ "$ver" != %{version} ]; then | |
39 | exit 1 | |
40 | fi | |
41 | ||
42 | cp -a %{SOURCE2} . | |
43 | ||
44 | %build | |
377423bf ER |
45 | install -d %{byteorder} |
46 | cd %{byteorder} | |
47 | %if "%{byteorder}" == "BE" | |
2ce9a429 | 48 | %{__perl} ../geoip_csv_iv0.pl -b ../GeoIPCountryWhois.csv |
377423bf | 49 | %else |
2ce9a429 | 50 | %{__perl} ../geoip_csv_iv0.pl ../GeoIPCountryWhois.csv |
377423bf | 51 | %endif |
a9e058f3 | 52 | |
53 | %install | |
54 | rm -rf $RPM_BUILD_ROOT | |
377423bf ER |
55 | install -d $RPM_BUILD_ROOT%{dbdir}/%{byteorder} |
56 | cp -a %{byteorder}/* $RPM_BUILD_ROOT%{dbdir}/%{byteorder} | |
a9e058f3 | 57 | |
58 | %clean | |
59 | rm -rf $RPM_BUILD_ROOT | |
60 | ||
61 | %files | |
62 | %defattr(644,root,root,755) | |
2ce9a429 | 63 | %doc LICENSE.txt |
377423bf ER |
64 | %dir %{dbdir} |
65 | %{dbdir}/%{byteorder} |