Summary(pl.UTF-8): GeoLite City - baza danych miast dla GeoIP
Name: GeoIP-db-City
# Updated every month:
-Version: 2014.10.08
+Version: 2017.09.06
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: b47b0a764cf11f7cbeb80e959fe0f8fe
+# Source0-md5: 62f9264f1f489c8b1968decce55aca2f
Source1: http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz?/GeoLiteCityv6-%{version}.dat.gz
-# Source1-md5: ee531516561458b9d2257111c597c41f
+# Source1-md5: 9e9905f934587aa661bd3451c403a74e
URL: http://dev.maxmind.com/geoip/legacy/geolite/
BuildRequires: tar >= 1:1.22
BuildRequires: xz
świata.
Informacja licencyjna: ten produkt zawiera dane GeoLite stworzone
-przez MaxWind, dostępne z <http://www.maxwind.com/>.
+przez MaxMind, dostępne z <http://www.maxmind.com/>.
%prep
%setup -qcT
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