From 5120f651229486ced452d2ee74aa602813cff2c7 Mon Sep 17 00:00:00 2001 From: gaoruoshu Date: Thu, 28 Mar 2024 11:07:32 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!52=20:?= =?UTF-8?q?=20Fix=20crash=20when=20mandoc=20install'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- man-db.spec | 64 ++++++----------------------------------------------- 1 file changed, 7 insertions(+), 57 deletions(-) diff --git a/man-db.spec b/man-db.spec index 8cc06b8..33716a2 100644 --- a/man-db.spec +++ b/man-db.spec @@ -2,7 +2,7 @@ Name: man-db Version: 2.11.0 -Release: 4 +Release: 2 Summary: Online database for using man pages License: GPLv2+ and GPLv3+ URL: http://www.nongnu.org/man-db/ @@ -17,10 +17,6 @@ BuildRequires: gcc systemd gdbm-devel gettext groff less libpipeline-devel zli BuildRequires: po4a perl-interpreter perl-version make chrpath Requires: coreutils grep groff-base gzip less crontabs -Requires(post): %{_sbindir}/update-alternatives -Requires(postun): %{_sbindir}/update-alternatives -Requires(preun): %{_sbindir}/update-alternatives - Provides: man = %{version} man-pages-reader = %{version} bundled(gnulib) = 20140202 Obsoletes: man < 2.0 Provides: man-db-cron @@ -76,42 +72,11 @@ chrpath -d %{buildroot}%{_libdir}/%{name}/libmandb-%{version}.so mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d echo "/usr/lib64/man-db" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf -# rename files for alternative usage -for f in man apropos whatis; do - mv %{buildroot}%{_bindir}/$f %{buildroot}%{_bindir}/$f.%{name} - touch %{buildroot}%{_bindir}/$f - mv %{buildroot}%{_mandir}/man1/$f.1 %{buildroot}%{_mandir}/man1/$f.%{name}.1 - touch %{buildroot}%{_mandir}/man1/$f.1 -done - %pre -for f in man apropos whatis; do - [ -L %{_bindir}/$f ] || %{__rm} -f %{_bindir}/$f >/dev/null 2>&1 || : - [ -L %{_mandir}/man1/$f.1.gz ] || %{__rm} -f %{_mandir}/man1/$f.1.gz >/dev/null 2>&1 || : -done - -if [ -e /usr/lib/systemd/system/mandb.timer ]; then - if test -d /run/systemd; then - systemctl stop man-db.timer >/dev/null 2>&1 || : - systemctl -q disable man-db.timer >/dev/null 2>&1 || : - fi -fi %preun -if [ $1 -eq 0 ]; then - %{_sbindir}/update-alternatives --remove man %{_bindir}/man.%{name} >/dev/null 2>&1 || : -fi %post -# set up the alternatives files -%{_sbindir}/update-alternatives --install %{_bindir}/man man %{_bindir}/man.%{name} 300 \ - --slave %{_bindir}/apropos apropos %{_bindir}/apropos.%{name} \ - --slave %{_bindir}/whatis whatis %{_bindir}/whatis.%{name} \ - --slave %{_mandir}/man1/man.1.gz man.1.gz %{_mandir}/man1/man.%{name}.1.gz \ - --slave %{_mandir}/man1/apropos.1.gz apropos.1.gz %{_mandir}/man1/apropos.%{name}.1.gz \ - --slave %{_mandir}/man1/whatis.1.gz whatis.1.gz %{_mandir}/man1/whatis.%{name}.1.gz \ - >/dev/null 2>&1 || : - # clear the old cache %{__rm} -rf %{cache}/* || : /sbin/ldconfig @@ -129,11 +94,6 @@ if [ -x /usr/bin/systemd-run -a -x /usr/bin/systemctl ]; then fi %postun -if [ $1 -ge 1 ]; then - if [ "$(readlink %{_sysconfdir}/alternatives/man)" == "%{_bindir}/man.%{name}" ]; then - %{_sbindir}/update-alternatives --set man %{_bindir}/man.%{name} >/dev/null 2>&1 || : - fi -fi /sbin/ldconfig %files -f %{name}.lang -f %{name}-gnulib.lang @@ -147,6 +107,9 @@ fi %config(noreplace) /etc/ld.so.conf.d/* %{_unitdir}/man-db-cache-update.service %{_sbindir}/accessdb +%{_bindir}/man +%{_bindir}/whatis +%{_bindir}/apropos %{_bindir}/manpath %{_bindir}/lexgrog %{_bindir}/catman @@ -161,16 +124,6 @@ fi /usr/lib/systemd/system/man-db.service /usr/lib/systemd/system/man-db.timer %verify(not mtime) %dir %{cache} -%ghost %{_bindir}/man -%ghost %{_bindir}/apropos -%ghost %{_bindir}/whatis -%{_bindir}/man.%{name} -%{_bindir}/whatis.%{name} -%{_bindir}/apropos.%{name} -# documentation and translation -%ghost %{_mandir}/man1/man.1* -%ghost %{_mandir}/man1/apropos.1* -%ghost %{_mandir}/man1/whatis.1* %lang(da) %{_datadir}/man/da/man*/* %lang(de) %{_datadir}/man/de/man*/* %lang(es) %{_datadir}/man/es/man*/* @@ -186,12 +139,12 @@ fi %lang(sv) %{_datadir}/man/sv/man*/* %lang(tr) %{_datadir}/man/tr/man*/* %lang(zh_CN) %{_datadir}/man/zh_CN/man*/* -%{_mandir}/man1/man.%{name}.1* -%{_mandir}/man1/apropos.%{name}.1* -%{_mandir}/man1/whatis.%{name}.1* +%{_mandir}/man1/apropos.1* %{_mandir}/man1/lexgrog.1* +%{_mandir}/man1/man.1* %{_mandir}/man1/manconv.1* %{_mandir}/man1/manpath.1* +%{_mandir}/man1/whatis.1* %{_mandir}/man1/man-recode.1* %{_mandir}/man5/manpath.5* %{_mandir}/man8/accessdb.8* @@ -216,9 +169,6 @@ fi %{_mandir}/ro/man8/mandb.8.gz %changelog -* Fri Dec 22 2023 lilong - 2.11.0-4 -- rebuilt - * Sat Jun 17 2023 yanglongkang - 2.11.0-2 - Fix crash when processing stray cats -- Gitee