X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=GeoIP-db-City.spec;h=dc8c328f591e1a1c27daa3ebd36df3f112408ee1;hb=eb7c12ecc016d9ddfb18639302fdce4be3587522;hp=01341b642d351ae9079ec7b24529eb882b3ca9c4;hpb=8bb801219f0059dd92c5329f6acbdc2d3e3880b2;p=packages%2FGeoIP-db-City.git diff --git a/GeoIP-db-City.spec b/GeoIP-db-City.spec index 01341b6..dc8c328 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: 2015.03.03 +Version: 2018.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: f34c523e0abc2ccb4d5555396d3d093f +# Source0-md5: e672c69ed91151a9541123c7ad778c1e Source1: http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz?/GeoLiteCityv6-%{version}.dat.gz -# Source1-md5: ad0cb42518af7f752499425dca0952bb +# Source1-md5: f6dff70c99f8449af1b7a33073eaa743 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