]> git.pld-linux.org Git - packages/xtables-geoip.git/blobdiff - xtables-geoip.spec
- migrate database source to GeoLite2 (GeoLite Legacy databases are being discontinue...
[packages/xtables-geoip.git] / xtables-geoip.spec
index 360b04e31f33e34dc6427b355aa3e589114bad8f..de8cafcf3c53abb154654c570e34c20ed1dc3e12 100644 (file)
@@ -1,18 +1,16 @@
 Summary:       GeoIP database files for xt_geoip
 Summary(pl.UTF-8):     Pliki baz danych GeoIP dla xt_geoip
 Name:          xtables-geoip
-Version:       20170608
+Version:       20181023
 Release:       1
 License:       GPL, Open Data License
 Group:         Networking/Admin
-Source0:       http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
-# Source0-md5: e584c2c3e9ec3f5e5c89ae644718dc4e
-Source1:       http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz
-# Source1-md5: a4ed93a50c0942401e2c9c9f1dc31d9e
-Source2:       http://geolite.maxmind.com/download/geoip/database/LICENSE.txt
-# Source2-md5: a1381bd1aa0a0c91dc31b3f1e847cf4a
-Source3:       http://sourceforge.net/p/xtables-addons/xtables-addons/ci/master/tree/geoip/xt_geoip_build?format=raw&/xt_geoip_build
-# Source3-md5: 4dcd62c8b2c8b90cc88e961613118be3
+Source0:       http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip
+# Source0-md5: 1f5524d5ac54a779831bffc57d91e2a2
+Source1:       http://geolite.maxmind.com/download/geoip/database/LICENSE.txt
+# Source1-md5: a1381bd1aa0a0c91dc31b3f1e847cf4a
+Source2:       http://sourceforge.net/p/xtables-addons/xtables-addons/ci/master/tree/geoip/xt_geoip_build?format=raw&/xt_geoip_build
+# Source2-md5: 462ca00be38471d19dc6e0f32c098275
 URL:           http://www.maxmind.com/
 BuildRequires: perl-Text-CSV_XS >= 0.69
 BuildRequires: perl-base
@@ -43,24 +41,17 @@ xtables-addons.
 
 %prep
 %setup -qc
-gunzip -c %{SOURCE1} > GeoIPv6.csv
-touch -r %{SOURCE1} GeoIPv6.csv
 
-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
+ver=$(ls -d GeoLite2-Country-CSV_* | head -1 | %{__sed} 's/^GeoLite2-Country-CSV_//')
 if [ "$ver" != %{version} ]; then
        exit 1
 fi
 
-cp -p %{SOURCE2} .
+cp -p %{SOURCE1} .
 
 %build
-%{__perl} %{SOURCE3} GeoIPCountryWhois.csv GeoIPv6.csv | tee ranges.txt
+%{__mkdir} %{byteorder}
+%{__perl} %{SOURCE2} -S GeoLite2-Country-CSV_%{version} -D %{byteorder} > ranges.txt
 
 %install
 rm -rf $RPM_BUILD_ROOT
This page took 0.081115 seconds and 4 git commands to generate.