packages: xtables-geoip/xtables-geoip.spec - build from source, update to 2...
glen
glen at pld-linux.org
Tue Apr 27 10:20:47 CEST 2010
Author: glen Date: Tue Apr 27 08:20:47 2010 GMT
Module: packages Tag: HEAD
---- Log message:
- build from source, update to 20100402
---- Files affected:
packages/xtables-geoip:
xtables-geoip.spec (1.4 -> 1.5)
---- Diffs:
================================================================
Index: packages/xtables-geoip/xtables-geoip.spec
diff -u packages/xtables-geoip/xtables-geoip.spec:1.4 packages/xtables-geoip/xtables-geoip.spec:1.5
--- packages/xtables-geoip/xtables-geoip.spec:1.4 Tue Apr 27 09:25:16 2010
+++ packages/xtables-geoip/xtables-geoip.spec Tue Apr 27 10:20:42 2010
@@ -1,16 +1,21 @@
# $Revision$, $Date$
# TODO
-# - build from source using http://jengelh.medozas.de/files/geoip/geoip_src.tar.bz2
# - make it arch dependant and package only LE or BE dirs?
Summary: GeoIP database files for xt_geoip
Name: xtables-geoip
-Version: 20090901
-Release: 2
-License: GPL
+Version: 20100402
+Release: 1
+License: GPL, Open Data License
Group: Networking/Admin
URL: http://www.maxmind.com/
-Source0: http://jengelh.medozas.de/files/geoip/geoip_iv0_database-%{version}.tar.bz2
-# Source0-md5: 896cb23ada582ac945dcd4af305884fe
+Source0: http://jengelh.medozas.de/files/geoip/geoip_src.tar.bz2
+# Source0-md5: bbcb1edd6ce2ece229d3e61173c7cadc
+Source1: http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
+# Source1-md5: a8ed621bc988012100619fcea0c66956
+Source2: http://geolite.maxmind.com/download/geoip/database/LICENSE.txt
+# Source2-md5: a1381bd1aa0a0c91dc31b3f1e847cf4a
+BuildRequires: perl-Text-CSV_XS
+BuildRequires: perl-base
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -22,19 +27,36 @@
module.
%prep
-%setup -q -n var
+%setup -qc
+rm -f GeoIPCountryWhois.csv
+%setup -qD -a1
+
+ver=$(stat -c '%y' GeoIPCountryWhois.csv | awk '{print $1}' | tr -d -)
+if [ "$ver" != %{version} ]; then
+ exit 1
+fi
+
+cp -a %{SOURCE2} .
+
+%build
+install -d {B,L}E
+cd BE
+%{__perl} ../geoip_csv_iv0.pl -b ../GeoIPCountryWhois.csv
+cd ../LE
+%{__perl} ../geoip_csv_iv0.pl ../GeoIPCountryWhois.csv
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{dbdir}/{B,L}E
-cp -a geoip/BE/* $RPM_BUILD_ROOT%{dbdir}/BE
-cp -a geoip/LE/* $RPM_BUILD_ROOT%{dbdir}/LE
+cp -a BE/* $RPM_BUILD_ROOT%{dbdir}/BE
+cp -a LE/* $RPM_BUILD_ROOT%{dbdir}/LE
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
+%doc LICENSE.txt
%{dbdir}
%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
@@ -43,6 +65,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.5 2010/04/27 08:20:42 glen
+- build from source, update to 20100402
+
Revision 1.4 2010/04/27 07:25:16 glen
- db moved to /usr/share/xt_geoip; rel 2
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/xtables-geoip/xtables-geoip.spec?r1=1.4&r2=1.5&f=u
More information about the pld-cvs-commit
mailing list