From 678abab97daf0d3fdbf916e4ef99c20a08f2eb78ba2fdeb25e9c3f91fcec2549 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 28 Jan 2020 11:27:32 +0000 Subject: [PATCH] Accepting request 762785 from home:lnussel:branches:Documentation - get rid of alternatives altogether, just conflict (boo#1160568) OBS-URL: https://build.opensuse.org/request/show/762785 OBS-URL: https://build.opensuse.org/package/show/Documentation/mandoc?expand=0&rev=5 --- mandoc.changes | 5 +++ mandoc.spec | 83 +++++++------------------------------------------- 2 files changed, 16 insertions(+), 72 deletions(-) diff --git a/mandoc.changes b/mandoc.changes index f2500de..a6e2c4d 100644 --- a/mandoc.changes +++ b/mandoc.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jan 10 10:36:08 UTC 2020 - Ludwig Nussel + +- get rid of alternatives altogether, just conflict (boo#1160568) + ------------------------------------------------------------------- Thu Jan 9 10:13:07 UTC 2020 - Ludwig Nussel diff --git a/mandoc.spec b/mandoc.spec index b15c95c..0336d1e 100644 --- a/mandoc.spec +++ b/mandoc.spec @@ -25,12 +25,10 @@ Group: Productivity/Publishing/Troff URL: http://mandoc.bsd.lv/ Source: http://mandoc.bsd.lv/snapshots/mandoc-%{version}.tar.gz BuildRequires: zlib-devel -BuildRequires: update-alternatives Provides: man = %{version} Conflicts: man Conflicts: groff -Requires(post): update-alternatives -Requires(postun): update-alternatives +Conflicts: makewhat %description @@ -57,57 +55,11 @@ export CFLAGS="%optflags" cp -fv %{buildroot}%{_bindir}/apropos %{_tmppath}/ mv -fv %{_tmppath}/apropos %{buildroot}%{_sbindir}/makewhatis -# create a dummy target for /etc/alternatives -mkdir -p %{buildroot}%{_sysconfdir}/alternatives -for cmd in apropos man soelim ; do - mv %{buildroot}%{_bindir}/$cmd{,.mandoc} - ln -s -f %{_sysconfdir}/alternatives/$cmd %{buildroot}%{_bindir}/$cmd -done - -mv %{buildroot}%{_sbindir}/makewhatis{,.mandoc} -ln -s -f %{_sysconfdir}/alternatives/makewhatis %{buildroot}%{_sbindir}/makewhatis - -# sec 1 -for man in apropos man soelim whatis ; do - from=$(ls %{buildroot}%{_mandir}/man1/$man.1*) - to=$(echo $from|sed -e 's!\.1$!!')-mandoc.1 - mv -v "$from" "$to" - ln -s -f %{_sysconfdir}/alternatives/$man.1 "$from" -done -# sec 7 -for man in eqn man mdoc roff tbl ; do - from=$(ls %{buildroot}%{_mandir}/man7/$man.7*) - to=$(echo $from|sed -e 's!\.7$!!')-mandoc.7 - mv -v "$from" "$to" - ln -s -f %{_sysconfdir}/alternatives/$man.7 "$from" -done - # ghost : > %{buildroot}%{_mandir}/mandoc.db %post -update-alternatives --install \ - %{_bindir}/man man %{_bindir}/man.mandoc 1000 \ - --slave %{_bindir}/apropos apropos %{_bindir}/apropos.mandoc \ - --slave %{_bindir}/soelim soelim %{_bindir}/soelim.mandoc \ - --slave %{_sbindir}/makewhatis makewhatis %{_sbindir}/makewhatis.mandoc \ - --slave %{_mandir}/man1/apropos.1%{?ext_man} apropos.1%{?ext_man} %{_mandir}/man1/apropos-mandoc.1%{?ext_man} \ - --slave %{_mandir}/man1/man.1%{?ext_man} man.1%{?ext_man} %{_mandir}/man1/man-mandoc.1%{?ext_man} \ - --slave %{_mandir}/man1/soelim.1%{?ext_man} soelim.1%{?ext_man} %{_mandir}/man1/soelim-mandoc.1%{?ext_man} \ - --slave %{_mandir}/man1/whatis.1%{?ext_man} whatis.1%{?ext_man} %{_mandir}/man1/whatis-mandoc.1%{?ext_man} \ - --slave %{_mandir}/man7/eqn.7%{?ext_man} eqn.7%{?ext_man} %{_mandir}/man7/eqn-mandoc.7%{?ext_man} \ - --slave %{_mandir}/man7/man.7%{?ext_man} man.7%{?ext_man} %{_mandir}/man7/man-mandoc.7%{?ext_man} \ - --slave %{_mandir}/man7/mdoc.7%{?ext_man} mdoc.7%{?ext_man} %{_mandir}/man7/mdoc-mandoc.7%{?ext_man} \ - --slave %{_mandir}/man7/roff.7%{?ext_man} roff.7%{?ext_man} %{_mandir}/man7/roff-mandoc.7%{?ext_man} \ - --slave %{_mandir}/man7/tbl.7%{?ext_man} tbl.7%{?ext_man} %{_mandir}/man7/tbl-mandoc.7%{?ext_man} -if [ -x %{_sbindir}/makewhatis ]; then - %{_sbindir}/makewhatis -fi - -%postun -if [ $1 -eq 0 ] ; then - update-alternatives --remove man %{_bindir}/man.mandoc -fi +%{_sbindir}/makewhatis %filetriggerin -p -- %{_mandir} -- TODO: replace with rpm.execute after rpm 4.15 @@ -124,10 +76,9 @@ function execute(path, ...) posix.wait(pid) end -- --- makewhatis may not exist if update-alternatives did not create it --- yet. Also, no point registering individual files if we can call --- makewhatis in %%post to catch all -if posix.access("%{_sbindir}/makewhatis") and posix.access("%{_mandir}/mandoc.db") then +-- no point registering individual files if we can call +-- makewhatis in %%post to catch all if +if posix.access("%{_mandir}/mandoc.db") then file = rpm.next_file() while file do if string.match(file, "%{_mandir}/man[^/]+/[^/]+%{?ext_man}$") then @@ -152,7 +103,7 @@ function execute(path, ...) posix.wait(pid) end -- -if posix.access("%{_sbindir}/makewhatis") and posix.access("%{_mandir}/mandoc.db") then +if posix.access("%{_mandir}/mandoc.db") then file = rpm.next_file() while file do if string.match(file, "%{_mandir}/man[^/]+/[^/]+%{?ext_man}$") then @@ -165,29 +116,17 @@ end %files %license LICENSE %doc NEWS TODO -%{_bindir}/apropos* +%{_bindir}/apropos %{_bindir}/demandoc -%{_bindir}/man* -%{_bindir}/soelim* +%{_bindir}/man +%{_bindir}/mandoc +%{_bindir}/soelim %{_bindir}/whatis -%{_sbindir}/makewhatis* +%{_sbindir}/makewhatis %{_mandir}/man1/*.1%{?ext_man} %{_mandir}/man5/*.5%{?ext_man} %{_mandir}/man7/*.7%{?ext_man} %{_mandir}/man8/*.8%{?ext_man} %ghost %{_mandir}/mandoc.db -%ghost %{_sysconfdir}/alternatives/man -%ghost %{_sysconfdir}/alternatives/apropos -%ghost %{_sysconfdir}/alternatives/soelim -%ghost %{_sysconfdir}/alternatives/makewhatis -%ghost %{_sysconfdir}/alternatives/apropos.1%{?ext_man} -%ghost %{_sysconfdir}/alternatives/man.1%{?ext_man} -%ghost %{_sysconfdir}/alternatives/soelim.1%{?ext_man} -%ghost %{_sysconfdir}/alternatives/whatis.1%{?ext_man} -%ghost %{_sysconfdir}/alternatives/eqn.7%{?ext_man} -%ghost %{_sysconfdir}/alternatives/man.7%{?ext_man} -%ghost %{_sysconfdir}/alternatives/mdoc.7%{?ext_man} -%ghost %{_sysconfdir}/alternatives/roff.7%{?ext_man} -%ghost %{_sysconfdir}/alternatives/tbl.7%{?ext_man} %changelog