]> git.pld-linux.org Git - packages/xtables-geoip.git/blob - xtables-geoip.spec
- up to 2011.02.02
[packages/xtables-geoip.git] / xtables-geoip.spec
1 Summary:        GeoIP database files for xt_geoip
2 Name:           xtables-geoip
3 Version:        20110202
4 Release:        1
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:  8349b51b0de83b7ef906c3dd4918e5e9
10 Source1:        http://geolite.maxmind.com/download/geoip/database/LICENSE.txt
11 # Source1-md5:  a1381bd1aa0a0c91dc31b3f1e847cf4a
12 Source2:        http://xtables-addons.git.sf.net/git/gitweb.cgi?p=xtables-addons/xtables-addons;a=blob_plain;f=geoip/geoip_build_db.pl
13 # Source2-md5:  7cd5c1ab1d83a94d84ae918f0805603f
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 # no debuginfo to package
22 %define         _enable_debug_packages  0
23
24 %ifarch ppc sparc ppc64 sparc64 sparcv9
25 %define         byteorder       BE
26 %else
27 %define         byteorder       LE
28 %endif
29
30 %description
31 The package contains the GeoIP definition files (which IP addresses
32 belong to which country) that are needed for Xtables-addons's xt_geoip
33 module.
34
35 %prep
36 %setup -qc
37
38 ver=$(stat -c '%y' GeoIPCountryWhois.csv | awk '{print $1}' | tr -d -)
39 if [ "$ver" != %{version} ]; then
40         exit 1
41 fi
42
43 cp -a %{SOURCE1} .
44
45 %build
46 install -d %{byteorder}
47 %if "%{byteorder}" == "BE"
48 %{__perl} %{SOURCE2} -D %{byteorder} -b GeoIPCountryWhois.csv | tee ranges.txt
49 %else
50 %{__perl} %{SOURCE2} -D %{byteorder} 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.059276 seconds and 4 git commands to generate.