X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=GeoIP-db-City.spec;h=79693422516b38f7253fd92d9be775a92e33a6e0;hb=36c3f9bf41a90270e4cdcbb7a59b6c0fd10c0974;hp=ef0819ea34d18baf03fbf32feeab4080a42c4881;hpb=64129aefae32c59440bead35084ec0d17fb74eb2;p=packages%2FGeoIP-db-City.git diff --git a/GeoIP-db-City.spec b/GeoIP-db-City.spec index ef0819e..7969342 100644 --- a/GeoIP-db-City.spec +++ b/GeoIP-db-City.spec @@ -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: 2012.10.03 +Version: 2015.09.02 Release: 1 -License: OPEN DATA LICENSE (see LICENSE.txt) +License: CC 3.0 BY-SA Group: Applications/Databases -Source0: http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz -# Source0-md5: cba2cf7359950e6010aa752721008f16 -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: d834073c4f73258f727ecdcee5168c92 +Source1: http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz?/GeoLiteCityv6-%{version}.dat.gz +# Source1-md5: ffc741fa518d949dc4cfaaa647d0b1ec +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) @@ -35,9 +37,25 @@ przez MaxWind, dostępne z . cp -p %{SOURCE0} . cp -p %{SOURCE1} . -gunzip GeoLiteCity.dat.gz +xz -d GeoLiteCity-%{version}.dat.xz +gunzip GeoLiteCityv6-%{version}.dat.gz -ver=$(TZ=GMT stat -c '%y' GeoLiteCity.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 @@ -45,13 +63,15 @@ fi %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_datadir}/GeoIP -cp -p 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 %{_datadir}/GeoIP/*.dat