From 3a8da8ebdfde904b3947d544f058081776523e9efb1869db27d9f82b6239a1ab Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 9 Nov 2018 13:40:15 +0000 Subject: [PATCH] bsc#1115406 OBS-URL: https://build.opensuse.org/package/show/Base:System/man?expand=0&rev=90 --- man.changes | 6 ++++++ man.spec | 33 ++++++++++++++++++++++++++++----- mandb.service | 10 ++++++++++ mandb.timer | 11 +++++++++++ sysconfig.cron-man | 15 --------------- 5 files changed, 55 insertions(+), 20 deletions(-) create mode 100644 mandb.service create mode 100644 mandb.timer diff --git a/man.changes b/man.changes index ef9350c..bb020e8 100644 --- a/man.changes +++ b/man.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Nov 9 13:37:43 UTC 2018 - Dr. Werner Fink + +- Add systemd timer service and its timer unit to refresh man + data base daily without using cron (bsc#1115406) + ------------------------------------------------------------------- Mon Apr 16 14:25:43 UTC 2018 - werner@suse.de diff --git a/man.spec b/man.spec index a6bffb7..36bbc62 100644 --- a/man.spec +++ b/man.spec @@ -12,7 +12,7 @@ # 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/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -42,12 +42,14 @@ BuildRequires: zlib-devel Version: 2.7.6 Release: 0 Summary: A Program for Displaying man Pages -License: GPL-2.0+ +License: GPL-2.0-or-later Group: System/Base Url: https://savannah.nongnu.org/projects/man-db PreReq: coreutils fillup Provides: man_db +%if 0%{suse_version} < 1500 Requires: cron +%endif Requires: glibc-locale %if 0%{suse_version} > 1300 Recommends: groff-full @@ -63,6 +65,8 @@ Source4: mancoding Source5: wrapper.c Source6: man-rpmlintrc Source7: man-db-create.service +Source8: mandb.timer +Source9: mandb.service Patch0: man-db-2.7.6.dif Patch1: man-db-2.6.3-man0.dif Patch2: man-db-2.3.19deb4.0-groff.dif @@ -236,11 +240,21 @@ fi install -m 0644 groff/tmac.andb %{buildroot}%{_datadir}/groff/site-tmac/ install -m 0644 groff/tmac.andocdb %{buildroot}%{_datadir}/groff/site-tmac/ mkdir -p %{buildroot}%{_fillupdir} - mkdir -p %{buildroot}/etc/cron.daily - install -m 0644 %{SOURCE1} %{buildroot}%{_fillupdir} - install -m 0744 %{SOURCE2} %{buildroot}/etc/cron.daily/suse-do_mandb mkdir -p %{buildroot}%{_unitdir}/ +%if 0%{suse_version} < 1500 + mkdir -p %{buildroot}/etc/cron.daily +%endif + install -m 0644 %{SOURCE1} %{buildroot}%{_fillupdir} +%if 0%{suse_version} < 1500 + install -m 0744 %{SOURCE2} %{buildroot}/etc/cron.daily/suse-do_mandb +%else + install -m 0744 %{SOURCE2} %{buildroot}/%{_libexecdir}/man-db/do_mandb +%endif install -m 0644 %{SOURCE7} %{buildroot}%{_unitdir}/ +%if 0%{suse_version} >= 1500 + install -m 0644 %{SOURCE8} %{buildroot}%{_unitdir}/ + install -m 0644 %{SOURCE9} %{buildroot}%{_unitdir}/ +%endif %find_lang man-db --all-name --with-man @@ -270,7 +284,9 @@ test -d /var/cache/man && mandb --quiet --create ||: %doc ChangeLog %doc %{_datadir}/doc/packages/man/man-db-manual.* %config /etc/manpath.config +%if 0%{suse_version} < 1500 %attr(0744,root,root) /etc/cron.daily/suse-do_mandb +%endif %{_bindir}/apropos %{_bindir}/catman %{_bindir}/lexgrog @@ -285,6 +301,9 @@ test -d /var/cache/man && mandb --quiet --create ||: %attr(0755,root,root) %{_libexecdir}/man-db/mandb %attr(0755,man,man) %{_libexecdir}/man-db/manconv %attr(0755,man,man) %{_libexecdir}/man-db/globbing +%if 0%{suse_version} >= 1500 +%attr(0744,man,man) %{_libexecdir}/man-db/do_mandb +%endif %{_sbindir}/accessdb %{_libdir}/libman*.so %{_libexecdir}/man-db/zsoelim @@ -293,6 +312,10 @@ test -d /var/cache/man && mandb --quiet --create ||: %endif %{_libexecdir}/tmpfiles.d/man-db.conf %{_unitdir}/man-db-create.service +%if 0%{suse_version} >= 1500 +%{_unitdir}/mandb.service +%{_unitdir}/mandb.timer +%endif %dir %{_datadir}/groff/site-tmac %{_datadir}/groff/site-tmac/tmac.andb %{_datadir}/groff/site-tmac/tmac.andocdb diff --git a/mandb.service b/mandb.service new file mode 100644 index 0000000..ac4300b --- /dev/null +++ b/mandb.service @@ -0,0 +1,10 @@ +[Unit] +Description=Do daily mandb update +Documentation=man:mandb(8) man:catman(8) +ConditionACPower=true + +[Service] +Type=oneshot +Nice=5 +IOSchedulingClass=idle +ExecStart=/usr/lib/man-db/do_mandb diff --git a/mandb.timer b/mandb.timer new file mode 100644 index 0000000..3b1c314 --- /dev/null +++ b/mandb.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Do daily mandb update +Documentation=man:mandb(8) man:catman(8) + +[Timer] +OnCalendar=daily +AccuracySec=12h +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/sysconfig.cron-man b/sysconfig.cron-man index 2ad5459..fa15c55 100644 --- a/sysconfig.cron-man +++ b/sysconfig.cron-man @@ -6,18 +6,3 @@ # Should mandb and whatis be recreated by cron.daily ("yes" or "no") # REINIT_MANDB=yes - -## Type: yesno -## Default: yes -# -# Should old preformatted man pages (in /var/cache/man) be deleted? (yes/no) -# -DELETE_OLD_CATMAN=yes - -## Type: integer -## Default: 7 -# -# How long should old preformatted man pages be kept before deletion? (days) -# -CATMAN_ATIME=7 -