X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=GeoIP-db-City.spec;h=23a1e5f7c45327badb479a1381f6c385c5bd91e8;hb=123731f;hp=78369c7a9cfbbfa8d1e288f1b0257d04529682e7;hpb=1c5f49bc98342f3c7e5dfad9dfc15c260892e1c0;p=packages%2FGeoIP-db-City.git
diff --git a/GeoIP-db-City.spec b/GeoIP-db-City.spec
index 78369c7..23a1e5f 100644
--- a/GeoIP-db-City.spec
+++ b/GeoIP-db-City.spec
@@ -2,14 +2,14 @@ Summary: GeoLite City - City database for GeoIP
Summary(pl.UTF-8): GeoLite City - baza danych miast dla GeoIP
Name: GeoIP-db-City
# Updated every month:
-Version: 2014.03.05
+Version: 2016.10.31
Release: 1
License: CC 3.0 BY-SA
Group: Applications/Databases
Source0: http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.xz?/GeoLiteCity-%{version}.dat.xz
-# Source0-md5: 9f6d3dad3a21c545d5ad02f1573521cd
+# Source0-md5: b5756b048ecc680140bd2bbe9874cc96
Source1: http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz?/GeoLiteCityv6-%{version}.dat.gz
-# Source1-md5: 4b04a01c82ea61c14c02cbecccb8efd8
+# Source1-md5: 78c56505f04a31e499c8ee1c5dcabbaa
URL: http://dev.maxmind.com/geoip/legacy/geolite/
BuildRequires: tar >= 1:1.22
BuildRequires: xz
@@ -30,7 +30,7 @@ miejski, szerokoÅÄ i wysokoÅÄ geograficznÄ
dla adresów IP z caÅego
Åwiata.
Informacja licencyjna: ten produkt zawiera dane GeoLite stworzone
-przez MaxWind, dostÄpne z .
+przez MaxMind, dostÄpne z .
%prep
%setup -qcT
@@ -40,7 +40,22 @@ cp -p %{SOURCE1} .
xz -d GeoLiteCity-%{version}.dat.xz
gunzip GeoLiteCityv6-%{version}.dat.gz
-ver=$(TZ=GMT stat -c '%y' GeoLiteCity-%{version}.dat | awk '{print $1}' | tr - .)
+%build
+# get file DATE in GMT timezone
+filedate() {
+ TZ=GMT stat -c '%y' "$1" | awk '{print $1}'
+}
+
+# use newest file date as version
+d1=$(filedate GeoLiteCity-%{version}.dat)
+d2=$(filedate GeoLiteCityv6-%{version}.dat)
+if [ "$(echo $d1 | tr -d -)" -gt "$(echo $d2 | tr -d -)" ]; then
+ d=$d1
+else
+ d=$d2
+fi
+
+ver=$(echo $d | tr - .)
if [ "$ver" != %{version} ]; then
exit 1
fi