File nginx-geolite-city.spec of Package nginx-geolite-city
#
# spec file for package nginx-geolite-city
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define ngx_conf_dir %{_sysconfdir}/nginx
%define geo_ip_dir geoip
%define geo_ip_path GeoLiteCity.dat
%define geo_ip_versioned_path GeoLiteCity-%{version}.dat
Name: nginx-geolite-city
# GeoIP databases are not versioned, but they are updated monthly.
# That's why we use YY.MM format for versioning this package.
Version: 18.06
Release: 0
Summary: Free IP city geolocation databases for nginx
License: CC-BY-SA-4.0
Group: Productivity/Networking/Web/Proxy
Url: https://dev.maxmind.com/geoip/legacy/geolite/
# Archive name available on the upstream server doesn't contain any version in
# name, so we are adding it in order to be able to update it in OBS.
Source: https://geolite.maxmind.com/download/geoip/database/%{geo_ip_path}.gz#/%{geo_ip_versioned_path}.gz
Source1: LICENSE
Requires: nginx
BuildArch: noarch
%description
The GeoLite databases are our free IP geolocation databases. They are updated on
the first Tuesday of each month. These databases are offered in the same binary
and csv formats as our subscription databases. Any code which can read the
subscription databases can also read the GeoLite databases.
IP geolocation is inherently imprecise. Locations are often near the center of
the population. Any location provided by a GeoIP database should not be used to
identify a particular address or household.
%prep
gunzip -k %{SOURCE0}
mv %{_sourcedir}/%{geo_ip_versioned_path} %{_sourcedir}/%{geo_ip_path}
cp %{SOURCE1} .
%build
%install
mkdir -p %{buildroot}%{ngx_conf_dir}/%{geo_ip_dir}
install -D -m 0644 %{_sourcedir}/%{geo_ip_path} %{buildroot}%{ngx_conf_dir}/%{geo_ip_dir}/%{geo_ip_path}
%files
%license LICENSE
%dir %{ngx_conf_dir}
%dir %{ngx_conf_dir}/%{geo_ip_dir}
%config %{ngx_conf_dir}/%{geo_ip_dir}/GeoLiteCity.dat
%changelog