]> git.pld-linux.org Git - packages/xtables-geoip.git/blobdiff - xtables-geoip.spec
- up to 20121004
[packages/xtables-geoip.git] / xtables-geoip.spec
index 26b8d82dd7eeced925742961908cca4df67e9aec..7c4152571fb8c123aa056ab7f3002d5e522a5ab0 100644 (file)
@@ -1,18 +1,22 @@
 Summary:       GeoIP database files for xt_geoip
+Summary(pl.UTF-8):     Pliki baz danych GeoIP dla xt_geoip
 Name:          xtables-geoip
-Version:       20101002
+Version:       20121004
 Release:       1
 License:       GPL, Open Data License
 Group:         Networking/Admin
-URL:           http://www.maxmind.com/
 Source0:       http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
-# Source0-md5: 14d2a5c6845f4e3df46c992ffca209d9
-Source1:       http://geolite.maxmind.com/download/geoip/database/LICENSE.txt
-# Source1-md5: a1381bd1aa0a0c91dc31b3f1e847cf4a
-Source2:       http://xtables-addons.git.sf.net/git/gitweb.cgi?p=xtables-addons/xtables-addons;a=blob_plain;f=geoip/geoip_build_db.pl
-# Source2-md5: 7cd5c1ab1d83a94d84ae918f0805603f
+# Source0-md5: aa18788f1969a4e0841e37eef06255c6
+Source1:       http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz
+# Source1-md5: f735302c81b05e2c312ded4b2211b1bb
+Source2:       http://geolite.maxmind.com/download/geoip/database/LICENSE.txt
+# Source2-md5: a1381bd1aa0a0c91dc31b3f1e847cf4a
+Source3:       http://xtables-addons.git.sourceforge.net/git/gitweb.cgi?p=xtables-addons/xtables-addons;a=blob_plain;f=geoip/xt_geoip_build
+# Source3-md5: 76c6959bad03c1ff064aefcb4811cd92
+URL:           http://www.maxmind.com/
 BuildRequires: perl-Text-CSV_XS >= 0.69
 BuildRequires: perl-base
+BuildRequires: rpm >= 4.4.9-56
 BuildRequires: unzip
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -21,7 +25,7 @@ BuildRoot:    %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 # no debuginfo to package
 %define                _enable_debug_packages  0
 
-%ifarch ppc sparc ppc64 sparc64 sparcv9
+%ifarch ppc ppc64 s390 s390x sparc sparc64 sparcv9
 %define                byteorder       BE
 %else
 %define                byteorder       LE
@@ -32,34 +36,71 @@ The package contains the GeoIP definition files (which IP addresses
 belong to which country) that are needed for Xtables-addons's xt_geoip
 module.
 
+%description -l pl.UTF-8
+Ten pakiet zawiera pliki definicji GeoIP (określające, które adresy IP
+należą do jakiego kraju), wymagane przez moduł xt_geoip z pakietu
+xtables-addons.
+
 %prep
 %setup -qc
+gunzip -c %{SOURCE1} > GeoIPv6.csv
+touch -r %{SOURCE1} GeoIPv6.csv
 
-ver=$(stat -c '%y' GeoIPCountryWhois.csv | awk '{print $1}' | tr -d -)
+ver4=$(TZ=GMT stat -c '%y' GeoIPCountryWhois.csv | awk '{print $1}' | tr -d -)
+ver6=$(TZ=GMT stat -c '%y' GeoIPv6.csv | awk '{print $1}' | tr -d -)
+if [ "$ver4" -gt "$ver6" ]; then
+       ver=$ver4
+else
+       ver=$ver6
+fi
 if [ "$ver" != %{version} ]; then
        exit 1
 fi
 
-cp -a %{SOURCE1} .
+cp -p %{SOURCE2} .
 
 %build
-install -d %{byteorder}
-%if "%{byteorder}" == "BE"
-%{__perl} %{SOURCE2} -D %{byteorder} -b ../GeoIPCountryWhois.csv | tee ranges.txt
-%else
-%{__perl} %{SOURCE2} -D %{byteorder} GeoIPCountryWhois.csv | tee ranges.txt
-%endif
+%{__perl} %{SOURCE3} GeoIPCountryWhois.csv GeoIPv6.csv | tee ranges.txt
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{dbdir}/%{byteorder}
-cp -a %{byteorder}/* $RPM_BUILD_ROOT%{dbdir}/%{byteorder}
+install -d $RPM_BUILD_ROOT%{dbdir}
+cp -a %{byteorder} $RPM_BUILD_ROOT%{dbdir}
+
+%if "%{pld_release}" == "ac"
+# handle older xtables in ac:
+# kernel-net-xtables-addons-1.18-15@2.6.27.53_1.amd64
+# still having old .iv0 names requirement
+# http://xtables-addons.git.sourceforge.net/git/gitweb.cgi?p=xtables-addons/xtables-addons;a=commitdiff;h=25bf680ead80e505d5073308f151b4007cb5683f
+# create hardlink, to be most compatible
+for a in $RPM_BUILD_ROOT%{dbdir}/%{byteorder}/*.iv4; do
+       ln $a ${a%.iv4}.iv0
+done
+# kernel-net-xtables-addons-1.18-8@2.6.27.45_1.i686  searches from /var/lib:
+# Could not open /var/lib/geoip/LE/EE.iv0: No such file or directory
+install -d $RPM_BUILD_ROOT/var/lib
+ln -s %{_datadir}/xt_geoip $RPM_BUILD_ROOT/var/lib/geoip
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if "%{pld_release}" == "ac"
+%pretrans
+# this needs to be a symlink
+if [ -d /var/lib/geoip -a ! -L /var/lib/geoip ]; then
+       mv -f /var/lib/geoip{,.rpmsave}
+       install -d %{dbdir}
+       ln -s %{dbdir} /var/lib/geoip
+fi
+%endif
+
 %files
 %defattr(644,root,root,755)
 %doc LICENSE.txt ranges.txt
 %dir %{dbdir}
 %{dbdir}/%{byteorder}
+
+%if "%{pld_release}" == "ac"
+/var/lib/geoip
+%endif
This page took 0.034777 seconds and 4 git commands to generate.