Accepting request 710994 from home:wrosenauer:devel

- added systemd timer for weekly updates
  (needs to be enabled by admin)

OBS-URL: https://build.opensuse.org/request/show/710994
OBS-URL: https://build.opensuse.org/package/show/Application:Geo/geoipupdate?expand=0&rev=18
This commit is contained in:
Martin Pluskal 2019-06-20 08:36:20 +00:00 committed by Git OBS Bridge
parent 908eeceffa
commit a781f30036
4 changed files with 47 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jun 20 05:35:01 UTC 2019 - Wolfgang Rosenauer <wr@rosenauer.org>
- added systemd timer for weekly updates
(needs to be enabled by admin)
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jun 19 10:34:53 UTC 2019 - Johannes Weberhofer <jweberhofer@weberhofer.at> Wed Jun 19 10:34:53 UTC 2019 - Johannes Weberhofer <jweberhofer@weberhofer.at>

9
geoipupdate.service Normal file
View File

@ -0,0 +1,9 @@
[Unit]
Description=Update GeoIP databases
Documentation=man:geoipupdate(1) man:GeoIP.conf(5)
[Service]
Type=oneshot
WorkingDirectory=/var/lib/GeoIP
ExecStart=/usr/bin/geoipupdate

View File

@ -24,12 +24,16 @@ License: GPL-2.0-only
Group: Productivity/Networking/System Group: Productivity/Networking/System
URL: https://www.maxmind.com URL: https://www.maxmind.com
Source0: https://github.com/maxmind/geoipupdate-legacy/archive/v%{version}/%{name}-legacy-%{version}.tar.gz Source0: https://github.com/maxmind/geoipupdate-legacy/archive/v%{version}/%{name}-legacy-%{version}.tar.gz
Source1: geoipupdate.timer
Source2: geoipupdate.service
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: libtool BuildRequires: libtool
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: pkgconfig(libcurl) BuildRequires: pkgconfig(libcurl)
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(zlib) BuildRequires: pkgconfig(zlib)
Conflicts: GeoIP < 1.6.0 Conflicts: GeoIP < 1.6.0
%{?systemd_requires}
%description %description
The GeoIP Update program performs automatic updates of GeoIP2 and GeoIP The GeoIP Update program performs automatic updates of GeoIP2 and GeoIP
@ -51,10 +55,24 @@ install -d %{buildroot}%{_localstatedir}/lib/GeoIP
install -D -p -m 0644 conf/GeoIP.conf.default \ install -D -p -m 0644 conf/GeoIP.conf.default \
%{buildroot}%{_sysconfdir}/GeoIP.conf.default %{buildroot}%{_sysconfdir}/GeoIP.conf.default
rm -rf %{buildroot}%{_datadir}/doc/geoipupdate rm -rf %{buildroot}%{_datadir}/doc/geoipupdate
install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.timer
install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
%check %check
make %{?_smp_mflags} check make %{?_smp_mflags} check
%pre
%service_add_pre %{name}.service
%post
%service_add_post %{name}.service
%preun
%service_del_preun %{name}.service
%postun
%service_del_postun %{name}.service
%files %files
%license LICENSE %license LICENSE
%doc README.md ChangeLog.md %doc README.md ChangeLog.md
@ -62,6 +80,8 @@ make %{?_smp_mflags} check
%config %{_sysconfdir}/GeoIP.conf.default %config %{_sysconfdir}/GeoIP.conf.default
%dir %{_localstatedir}/lib/GeoIP %dir %{_localstatedir}/lib/GeoIP
%{_bindir}/geoipupdate %{_bindir}/geoipupdate
%{_unitdir}/%{name}.service
%{_unitdir}/%{name}.timer
%{_mandir}/man1/geoipupdate.1%{?ext_man} %{_mandir}/man1/geoipupdate.1%{?ext_man}
%{_mandir}/man5/GeoIP.conf.5%{?ext_man} %{_mandir}/man5/GeoIP.conf.5%{?ext_man}

12
geoipupdate.timer Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=Weekly update of GeoLite2 databases
Documentation=man:geoipupdate(1) man:GeoIP.conf(5)
[Timer]
OnUnitInactiveSec=1w
OnStartupSec=1h
AccuracySec=1h
[Install]
WantedBy=timers.target