]> git.pld-linux.org Git - packages/xtables-geoip.git/blob - xtables-geoip.spec
82865811d8f210ba2d8078106196415da24968b6
[packages/xtables-geoip.git] / xtables-geoip.spec
1 Summary:        GeoIP database files for xt_geoip
2 Name:           xtables-geoip
3 Version:        20100802
4 Release:        1
5 License:        GPL, Open Data License
6 Group:          Networking/Admin
7 URL:            http://www.maxmind.com/
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
11 # Source1-md5:  1f67a4cb38b49eae4d64636557d0d1a7
12 Source2:        http://geolite.maxmind.com/download/geoip/database/LICENSE.txt
13 # Source2-md5:  a1381bd1aa0a0c91dc31b3f1e847cf4a
14 BuildRequires:  perl-Text-CSV_XS >= 0.69
15 BuildRequires:  perl-base
16 BuildRequires:  unzip
17 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18
19 %define         dbdir   /usr/share/xt_geoip
20
21 %ifarch ppc sparc ppc64 sparc64 sparcv9
22 %define         byteorder       BE
23 %else
24 %define         byteorder       LE
25 %endif
26
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
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
45 install -d %{byteorder}
46 cd %{byteorder}
47 %if "%{byteorder}" == "BE"
48 %{__perl} ../geoip_csv_iv0.pl -b ../GeoIPCountryWhois.csv | tee ../ranges.txt
49 %else
50 %{__perl} ../geoip_csv_iv0.pl ../GeoIPCountryWhois.csv | tee ../ranges.txt
51 %endif
52
53 %install
54 rm -rf $RPM_BUILD_ROOT
55 install -d $RPM_BUILD_ROOT%{dbdir}/%{byteorder}
56 cp -a %{byteorder}/* $RPM_BUILD_ROOT%{dbdir}/%{byteorder}
57
58 %clean
59 rm -rf $RPM_BUILD_ROOT
60
61 %files
62 %defattr(644,root,root,755)
63 %doc LICENSE.txt ranges.txt
64 %dir %{dbdir}
65 %{dbdir}/%{byteorder}
This page took 0.500958 seconds and 3 git commands to generate.