]>
Commit | Line | Data |
---|---|---|
2a48ce95 | 1 | # TODO |
2a48ce95 | 2 | # - make it arch dependant and package only LE or BE dirs? |
a9e058f3 | 3 | Summary: GeoIP database files for xt_geoip |
4 | Name: xtables-geoip | |
2ce9a429 ER |
5 | Version: 20100402 |
6 | Release: 1 | |
7 | License: GPL, Open Data License | |
a9e058f3 | 8 | Group: Networking/Admin |
2a48ce95 | 9 | URL: http://www.maxmind.com/ |
2ce9a429 ER |
10 | Source0: http://jengelh.medozas.de/files/geoip/geoip_src.tar.bz2 |
11 | # Source0-md5: bbcb1edd6ce2ece229d3e61173c7cadc | |
12 | Source1: http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip | |
13 | # Source1-md5: a8ed621bc988012100619fcea0c66956 | |
14 | Source2: http://geolite.maxmind.com/download/geoip/database/LICENSE.txt | |
15 | # Source2-md5: a1381bd1aa0a0c91dc31b3f1e847cf4a | |
16 | BuildRequires: perl-Text-CSV_XS | |
17 | BuildRequires: perl-base | |
a9e058f3 | 18 | BuildArch: noarch |
19 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
20 | ||
1f56ba0c ER |
21 | %define dbdir /usr/share/xt_geoip |
22 | ||
a9e058f3 | 23 | %description |
24 | The package contains the GeoIP definition files (which IP addresses | |
25 | belong to which country) that are needed for Xtables-addons's xt_geoip | |
26 | module. | |
27 | ||
28 | %prep | |
2ce9a429 ER |
29 | %setup -qc |
30 | rm -f GeoIPCountryWhois.csv | |
31 | %setup -qD -a1 | |
32 | ||
33 | ver=$(stat -c '%y' GeoIPCountryWhois.csv | awk '{print $1}' | tr -d -) | |
34 | if [ "$ver" != %{version} ]; then | |
35 | exit 1 | |
36 | fi | |
37 | ||
38 | cp -a %{SOURCE2} . | |
39 | ||
40 | %build | |
41 | install -d {B,L}E | |
42 | cd BE | |
43 | %{__perl} ../geoip_csv_iv0.pl -b ../GeoIPCountryWhois.csv | |
44 | cd ../LE | |
45 | %{__perl} ../geoip_csv_iv0.pl ../GeoIPCountryWhois.csv | |
a9e058f3 | 46 | |
47 | %install | |
48 | rm -rf $RPM_BUILD_ROOT | |
1f56ba0c | 49 | install -d $RPM_BUILD_ROOT%{dbdir}/{B,L}E |
2ce9a429 ER |
50 | cp -a BE/* $RPM_BUILD_ROOT%{dbdir}/BE |
51 | cp -a LE/* $RPM_BUILD_ROOT%{dbdir}/LE | |
a9e058f3 | 52 | |
53 | %clean | |
54 | rm -rf $RPM_BUILD_ROOT | |
55 | ||
56 | %files | |
57 | %defattr(644,root,root,755) | |
2ce9a429 | 58 | %doc LICENSE.txt |
1f56ba0c | 59 | %{dbdir} |