]>
Commit | Line | Data |
---|---|---|
4f251c67 ER |
1 | %define dbname Country |
2 | Summary: GeoLite2 Country - Country database for GeoIP | |
3 | Summary(pl.UTF-8): GeoLite2 Country - baza danych krajów dla GeoIP | |
4 | Name: GeoLite2-db-%{dbname} | |
5 | # Updated every month: | |
6 | Version: 20131210 | |
7 | Release: 1 | |
8 | License: CC 3.0 BY-SA | |
9 | Group: Applications/Databases | |
10 | Source0: http://geolite.maxmind.com/download/geoip/database/GeoLite2-%{dbname}.mmdb.gz?/GeoLite2-%{dbname}-%{version}.mmdb.gz | |
11 | # Source0-md5: e5f0947b07be4c39b07979142155a105 | |
12 | URL: http://dev.maxmind.com/geoip/geoip2/geolite2/ | |
13 | BuildArch: noarch | |
14 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
15 | ||
16 | %description | |
17 | GeoLite2 databases are free IP geolocation databases comparable to, | |
18 | but less accurate than, MaxMind's GeoIP2 databases. | |
19 | ||
20 | GeoLite2 databases are updated on the first Tuesday of each month. | |
21 | ||
22 | %prep | |
23 | %setup -qcT | |
24 | cp -p %{SOURCE0} GeoLite2-%{dbname}.mmdb.gz | |
25 | ||
26 | gunzip GeoLite2-%{dbname}.mmdb.gz | |
27 | ||
28 | ver=$(TZ=GMT stat -c '%y' GeoLite2-%{dbname}.mmdb | awk '{print $1}' | tr -d -) | |
29 | if [ "$ver" != %{version} ]; then | |
30 | exit 1 | |
31 | fi | |
32 | ||
33 | %install | |
34 | rm -rf $RPM_BUILD_ROOT | |
35 | install -d $RPM_BUILD_ROOT%{_datadir}/GeoIP | |
36 | cp -p GeoLite2-%{dbname}.mmdb $RPM_BUILD_ROOT%{_datadir}/GeoIP | |
37 | ||
38 | %clean | |
39 | rm -rf $RPM_BUILD_ROOT | |
40 | ||
41 | %files | |
42 | %defattr(644,root,root,755) | |
43 | %{_datadir}/GeoIP/*.mmdb |