From 580713a1c0aef979f37d8e78af2c4d571eb5de083561241249a96863c228671e Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 11 Dec 2017 15:13:06 +0000 Subject: [PATCH] Accepting request 555099 from home:kukuk:branches:Base:System - Add man-db-create.service to fill /var/cache/man at bootup if the directory is empty (required by FHS and for transactional updates). - Don't fill /var/cache/man if it does not exist yet (needed for transactional updates). - We don't need to package /var/cache/man, systemd-tmpfiles is creating it already for us. OBS-URL: https://build.opensuse.org/request/show/555099 OBS-URL: https://build.opensuse.org/package/show/Base:System/man?expand=0&rev=84 --- man-db-create.service | 17 +++++++++++++++++ man.changes | 11 +++++++++++ man.spec | 19 +++++++++++++++---- 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 man-db-create.service diff --git a/man-db-create.service b/man-db-create.service new file mode 100644 index 0000000..43418bd --- /dev/null +++ b/man-db-create.service @@ -0,0 +1,17 @@ +[Unit] +Description=Initialize /var/cache/man +DefaultDependencies=no +Wants=local-fs.target +After=local-fs.target +After=systemd-tmpfiles-setup.service +ConditionPathExists=/var/cache/man +ConditionPathExists=!/var/cache/man/index.db + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/mandb --quiet --create + +[Install] +WantedBy=multi-user.target + diff --git a/man.changes b/man.changes index aa42380..d002793 100644 --- a/man.changes +++ b/man.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu Dec 7 17:33:26 CET 2017 - kukuk@suse.de + +- Add man-db-create.service to fill /var/cache/man at bootup + if the directory is empty (required by FHS and for transactional + updates). +- Don't fill /var/cache/man if it does not exist yet (needed for + transactional updates). +- We don't need to package /var/cache/man, systemd-tmpfiles is + creating it already for us. + ------------------------------------------------------------------- Wed Nov 29 12:44:41 UTC 2017 - werner@suse.de diff --git a/man.spec b/man.spec index a7d5a83..76dbec1 100644 --- a/man.spec +++ b/man.spec @@ -63,6 +63,7 @@ Source3: cron.daily.clean_catman Source4: mancoding Source5: wrapper.c Source6: man-rpmlintrc +Source7: man-db-create.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 @@ -195,6 +196,7 @@ fi %if %suse_version <= 1030 export MKDIR_P="mkdir -p" %endif + rm -rf %{buildroot}%{_localstatedir}/cache/man mkdir -p %{buildroot}%{_datadir}/doc/packages/man mkdir -p %{buildroot}%{_libexecdir}/man-db mkdir -p %{buildroot}%{_bindir} @@ -239,21 +241,30 @@ fi install -m 0644 %{SOURCE1} %{buildroot}%{_fillupdir} install -m 0744 %{SOURCE2} %{buildroot}/etc/cron.daily/suse-do_mandb install -m 0744 %{SOURCE3} %{buildroot}/etc/cron.daily/suse-clean_catman + mkdir -p %{buildroot}%{_unitdir}/ + install -m 0644 %{SOURCE7} %{buildroot}%{_unitdir}/ %find_lang man-db --all-name --with-man %pre test -d var/catman/ && rm -rf var/catman/ || true +%service_add_pre man-db-create.service %post %{?tmpfiles_create:%tmpfiles_create %{_libexecdir}/tmpfiles.d/man-db.conf} %{fillup_only -an cron} /sbin/ldconfig +%service_add_post man-db-create.service -%postun -p /sbin/ldconfig +%preun +%service_del_preun man-db-create.service + +%postun +/sbin/ldconfig +%service_del_postun man-db-create.service %posttrans -mandb --quiet --create +test -d /var/cache/man && mandb --quiet --create ||: %files -f man-db.lang %defattr(-,root,root) @@ -284,6 +295,7 @@ mandb --quiet --create %dir %{_libexecdir}/tmpfiles.d %endif %{_libexecdir}/tmpfiles.d/man-db.conf +%{_unitdir}/man-db-create.service %dir %{_datadir}/groff/site-tmac %{_datadir}/groff/site-tmac/tmac.andb %{_datadir}/groff/site-tmac/tmac.andocdb @@ -292,8 +304,7 @@ mandb --quiet --create %doc %{_mandir}/man8/*.8.gz %dir %{_mandir}/id %{_fillupdir}/sysconfig.cron-man -%dir %verify(not mode group) %attr(0755,man,man) %{_localstatedir}/cache/man/ %defattr(-,man,man) -%ghost %{_localstatedir}/cache/man/* +%ghost %{_localstatedir}/cache/man %changelog