Summary(pl.UTF-8): GeoLite City - baza danych miast dla GeoIP
Name: GeoIP-db-City
# Updated every month:
-Version: 2009.08.01
+Version: 2016.10.31
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: 7cecaf088c9f37a3b931962c781bdd10
-Source1: http://www.maxmind.com/download/geoip/database/LICENSE.txt
-# Source1-md5: a1381bd1aa0a0c91dc31b3f1e847cf4a
-URL: http://www.maxmind.com/app/geolitecity
-Requires: GeoIP-libs
+Source0: http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.xz?/GeoLiteCity-%{version}.dat.xz
+# Source0-md5: b5756b048ecc680140bd2bbe9874cc96
+Source1: http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz?/GeoLiteCityv6-%{version}.dat.gz
+# Source1-md5: 78c56505f04a31e499c8ee1c5dcabbaa
+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)
%description
-GeoIP is a C library that enables the user to find the country that
-any IP address or hostname originates from. It uses a file based
-database that is accurate as of March 2003. This database simply
-contains IP blocks as keys, and countries as values. This database
-should be more complete and accurate than using reverse DNS lookups.
-
-GeoLite City is similar to the GeoIP City database, but is not as
-accurate. Should you require greater accuracy, GeoIP City is a drop-in
-replacement for GeoLite City.
+Determine country, state/region, city, US postal code, US area code,
+metro code, latitude, and longitude information for IP addresses
+worldwide.
License disclaimer: this product includes GeoLite data created by
MaxMind, available from <http://www.maxmind.com/>.
%description -l pl.UTF-8
-GeoIP jest biblioteką napisaną w C umożliwiającą użytkownikowi
-odnalezienie państwa, z którego pochodzi dany adres IP lub domena.
-Używa do tego zapisanej w pliku bazy danych (z marca 2003). W bazie
-tej adresy IP są kluczami, a państwa wartościami. Powinna ona być
-dokładniejsza niż sprawdzanie odwrotnego DNS.
-
-GeoLite City jest podobna do bazy danych GeoIP City, ale nie jest tak
-dokładna. Jeśli wymagana jest większa dokładność, GeoIP City jest
-zamiennikiem GeoLite City.
+Znajdź państwo, stan/region, miasto, kod pocztowy, kod regionu, kod
+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 %{SOURCE0} .
-cp %{SOURCE1} .
+%setup -qcT
+cp -p %{SOURCE0} .
+cp -p %{SOURCE1} .
+
+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
-gunzip GeoLiteCity.dat.gz
+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 -p GeoLiteCity-%{version}.dat $RPM_BUILD_ROOT%{_datadir}/GeoIP/GeoLiteCity.dat
+ln -s GeoLiteCity.dat $RPM_BUILD_ROOT%{_datadir}/GeoIP/GeoIPCity.dat
-install GeoLiteCity.dat $RPM_BUILD_ROOT%{_datadir}/GeoIP
+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