]>
Commit | Line | Data |
---|---|---|
85ac10bf | 1 | Summary: GeoLite City - City database for GeoIP |
9e67133d | 2 | Summary(pl.UTF-8): GeoLite City - baza danych miast dla GeoIP |
85ac10bf PG |
3 | Name: GeoIP-db-City |
4 | # Updated every month: | |
eb7c12ec | 5 | Version: 2018.10.31 |
720d0350 | 6 | Release: 1 |
9afd06d7 | 7 | License: CC 3.0 BY-SA |
85ac10bf | 8 | Group: Applications/Databases |
5da4dabf | 9 | Source0: http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.xz?/GeoLiteCity-%{version}.dat.xz |
2efed923 | 10 | # Source0-md5: e672c69ed91151a9541123c7ad778c1e |
5da4dabf | 11 | Source1: http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz?/GeoLiteCityv6-%{version}.dat.gz |
eb7c12ec | 12 | # Source1-md5: f6dff70c99f8449af1b7a33073eaa743 |
9afd06d7 ER |
13 | URL: http://dev.maxmind.com/geoip/legacy/geolite/ |
14 | BuildRequires: tar >= 1:1.22 | |
15 | BuildRequires: xz | |
9e67133d | 16 | BuildArch: noarch |
85ac10bf PG |
17 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
18 | ||
19 | %description | |
c13f1070 | 20 | Determine country, state/region, city, US postal code, US area code, |
21 | metro code, latitude, and longitude information for IP addresses | |
22 | worldwide. | |
9e67133d JB |
23 | |
24 | License disclaimer: this product includes GeoLite data created by | |
25 | MaxMind, available from <http://www.maxmind.com/>. | |
26 | ||
27 | %description -l pl.UTF-8 | |
c13f1070 | 28 | Znajdź państwo, stan/region, miasto, kod pocztowy, kod regionu, kod |
29 | miejski, szerokość i wysokość geograficzną dla adresów IP z całego | |
30 | świata. | |
85ac10bf | 31 | |
9e67133d | 32 | Informacja licencyjna: ten produkt zawiera dane GeoLite stworzone |
c0fcc43c | 33 | przez MaxMind, dostępne z <http://www.maxmind.com/>. |
85ac10bf PG |
34 | |
35 | %prep | |
05bb91b0 ER |
36 | %setup -qcT |
37 | cp -p %{SOURCE0} . | |
5da4dabf | 38 | cp -p %{SOURCE1} . |
85ac10bf | 39 | |
5da4dabf AM |
40 | xz -d GeoLiteCity-%{version}.dat.xz |
41 | gunzip GeoLiteCityv6-%{version}.dat.gz | |
85ac10bf | 42 | |
1f67771b ER |
43 | %build |
44 | # get file DATE in GMT timezone | |
45 | filedate() { | |
46 | TZ=GMT stat -c '%y' "$1" | awk '{print $1}' | |
47 | } | |
48 | ||
49 | # use newest file date as version | |
50 | d1=$(filedate GeoLiteCity-%{version}.dat) | |
51 | d2=$(filedate GeoLiteCityv6-%{version}.dat) | |
52 | if [ "$(echo $d1 | tr -d -)" -gt "$(echo $d2 | tr -d -)" ]; then | |
53 | d=$d1 | |
54 | else | |
55 | d=$d2 | |
56 | fi | |
57 | ||
58 | ver=$(echo $d | tr - .) | |
cd369cd0 ER |
59 | if [ "$ver" != %{version} ]; then |
60 | exit 1 | |
61 | fi | |
62 | ||
85ac10bf PG |
63 | %install |
64 | rm -rf $RPM_BUILD_ROOT | |
65 | install -d $RPM_BUILD_ROOT%{_datadir}/GeoIP | |
5da4dabf | 66 | cp -p GeoLiteCity-%{version}.dat $RPM_BUILD_ROOT%{_datadir}/GeoIP/GeoLiteCity.dat |
cc6ff7d0 | 67 | ln -s GeoLiteCity.dat $RPM_BUILD_ROOT%{_datadir}/GeoIP/GeoIPCity.dat |
85ac10bf | 68 | |
5da4dabf AM |
69 | cp -p GeoLiteCityv6-%{version}.dat $RPM_BUILD_ROOT%{_datadir}/GeoIP/GeoLiteCityv6.dat |
70 | ln -s GeoLiteCityv6.dat $RPM_BUILD_ROOT%{_datadir}/GeoIP/GeoIPCityv6.dat | |
71 | ||
85ac10bf PG |
72 | %clean |
73 | rm -rf $RPM_BUILD_ROOT | |
74 | ||
75 | %files | |
76 | %defattr(644,root,root,755) | |
85ac10bf | 77 | %{_datadir}/GeoIP/*.dat |