]> git.pld-linux.org Git - packages/GeoIP-db-City.git/blobdiff - GeoIP-db-City.spec
updated to 2016.09.06
[packages/GeoIP-db-City.git] / GeoIP-db-City.spec
index 39663d2d9ca166cffbd221552c37407917ffe5d6..06dc46164f5714e0d82caeed1f9785291c6ff96d 100644 (file)
@@ -2,15 +2,17 @@ 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:       2010.04.02
-Release:       2
-License:       OPEN DATA LICENSE (see LICENSE.txt)
+Version:       2016.09.06
+Release:       1
+License:       CC 3.0 BY-SA
 Group:         Applications/Databases
-Source0:       http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
-# Source0-md5: 9e0d13ea5a885bd1219793bddcde9013
-Source1:       http://www.maxmind.com/download/geoip/database/LICENSE.txt
-# Source1-md5: a1381bd1aa0a0c91dc31b3f1e847cf4a
-URL:           http://www.maxmind.com/app/geolitecity
+Source0:       http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.xz?/GeoLiteCity-%{version}.dat.xz
+# Source0-md5: 6cf1d667493d84e02a001b7150dbf2eb
+Source1:       http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz?/GeoLiteCityv6-%{version}.dat.gz
+# Source1-md5: 09886da4994158653e176da3e23e4066
+URL:           http://dev.maxmind.com/geoip/legacy/geolite/
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -28,26 +30,48 @@ 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 <http://www.maxwind.com/>.
+przez MaxMind, dostępne z <http://www.maxmind.com/>.
 
 %prep
-%setup -q -c -T
-cp -a %{SOURCE0} .
-cp -a %{SOURCE1} .
+%setup -qcT
+cp -p %{SOURCE0} .
+cp -p %{SOURCE1} .
 
-gunzip GeoLiteCity.dat.gz
+xz -d GeoLiteCity-%{version}.dat.xz
+gunzip GeoLiteCityv6-%{version}.dat.gz
+
+%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
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{_datadir}/GeoIP
-cp -a GeoLiteCity.dat $RPM_BUILD_ROOT%{_datadir}/GeoIP
+cp -p GeoLiteCity-%{version}.dat $RPM_BUILD_ROOT%{_datadir}/GeoIP/GeoLiteCity.dat
 ln -s GeoLiteCity.dat $RPM_BUILD_ROOT%{_datadir}/GeoIP/GeoIPCity.dat
 
+cp -p GeoLiteCityv6-%{version}.dat $RPM_BUILD_ROOT%{_datadir}/GeoIP/GeoLiteCityv6.dat
+ln -s GeoLiteCityv6.dat $RPM_BUILD_ROOT%{_datadir}/GeoIP/GeoIPCityv6.dat
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc *.txt
-%dir %{_datadir}/GeoIP
 %{_datadir}/GeoIP/*.dat
This page took 0.06136 seconds and 4 git commands to generate.