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
This commit is contained in:
Dr. Werner Fink 2017-12-11 15:13:06 +00:00 committed by Git OBS Bridge
parent 445c4d21c7
commit 580713a1c0
3 changed files with 43 additions and 4 deletions

17
man-db-create.service Normal file
View File

@ -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

View File

@ -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

View File

@ -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