]> git.pld-linux.org Git - packages/xtables-geoip.git/blob - xtables-geoip.spec
- up to 20100702
[packages/xtables-geoip.git] / xtables-geoip.spec
1 # TODO
2 # - make it arch dependant and package only LE or BE dirs?
3 Summary:        GeoIP database files for xt_geoip
4 Name:           xtables-geoip
5 Version:        20100702
6 Release:        1
7 License:        GPL, Open Data License
8 Group:          Networking/Admin
9 URL:            http://www.maxmind.com/
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:  07b16052593867747403c7c6841d3e7b
14 Source2:        http://geolite.maxmind.com/download/geoip/database/LICENSE.txt
15 # Source2-md5:  a1381bd1aa0a0c91dc31b3f1e847cf4a
16 BuildRequires:  perl-Text-CSV_XS >= 0.69
17 BuildRequires:  perl-base
18 BuildRequires:  unzip
19 BuildArch:      noarch
20 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
22 %define         dbdir   /usr/share/xt_geoip
23
24 %description
25 The package contains the GeoIP definition files (which IP addresses
26 belong to which country) that are needed for Xtables-addons's xt_geoip
27 module.
28
29 %prep
30 %setup -qc
31 rm -f GeoIPCountryWhois.csv
32 %setup -qD -a1
33
34 ver=$(stat -c '%y' GeoIPCountryWhois.csv | awk '{print $1}' | tr -d -)
35 if [ "$ver" != %{version} ]; then
36         exit 1
37 fi
38
39 cp -a %{SOURCE2} .
40
41 %build
42 install -d {B,L}E
43 cd BE
44 %{__perl} ../geoip_csv_iv0.pl -b ../GeoIPCountryWhois.csv
45 cd ../LE
46 %{__perl} ../geoip_csv_iv0.pl ../GeoIPCountryWhois.csv
47
48 %install
49 rm -rf $RPM_BUILD_ROOT
50 install -d $RPM_BUILD_ROOT%{dbdir}/{B,L}E
51 cp -a BE/* $RPM_BUILD_ROOT%{dbdir}/BE
52 cp -a LE/* $RPM_BUILD_ROOT%{dbdir}/LE
53
54 %clean
55 rm -rf $RPM_BUILD_ROOT
56
57 %files
58 %defattr(644,root,root,755)
59 %doc LICENSE.txt
60 %{dbdir}
This page took 0.091742 seconds and 4 git commands to generate.