diff --git a/mandoc.spec b/mandoc.spec index a17f344331ad208bfb43338b8d2ed9abd2757abc..4fd20d2a065c94b7544d0395076c134d5cdf0d9b 100644 --- a/mandoc.spec +++ b/mandoc.spec @@ -1,6 +1,6 @@ Name: mandoc Version: 1.14.6 -Release: 6 +Release: 7 Summary: A suite of tools for compiling mdoc and man License: ISC @@ -84,79 +84,118 @@ echo 'CFLAGS="%{optflags} -fPIC"' >> configure.local # Ensure headers do not have the execute bit set chmod -x %{buildroot}%{_includedir}/*.h -# rename files for alternative usage -for f in man apropos whatis soelim; do - # Rename binary executables - mv %{buildroot}%{_bindir}/$f %{buildroot}%{_bindir}/$f.%{name} - - # Rename corresponding man pages - mv %{buildroot}%{_mandir}/man1/$f.1 %{buildroot}%{_mandir}/man1/$f.%{name}.1 -done +# Rename files for alternative usage +mv %{buildroot}%{_bindir}/man %{buildroot}%{_bindir}/man.mandoc +mv %{buildroot}%{_bindir}/apropos %{buildroot}%{_bindir}/apropos.mandoc +mv %{buildroot}%{_bindir}/whatis %{buildroot}%{_bindir}/whatis.mandoc +mv %{buildroot}%{_bindir}/soelim %{buildroot}%{_bindir}/soelim.mandoc +mv %{buildroot}%{_sbindir}/makewhatis %{buildroot}%{_sbindir}/makewhatis.mandoc +mv %{buildroot}%{_mandir}/man1/apropos.1 %{buildroot}%{_mandir}/man1/apropos.mandoc.1 +mv %{buildroot}%{_mandir}/man1/man.1 %{buildroot}%{_mandir}/man1/man.mandoc.1 +mv %{buildroot}%{_mandir}/man1/soelim.1 %{buildroot}%{_mandir}/man1/soelim.mandoc.1 +mv %{buildroot}%{_mandir}/man1/whatis.1 %{buildroot}%{_mandir}/man1/whatis.mandoc.1 +mv %{buildroot}%{_mandir}/man7/man.7 %{buildroot}%{_mandir}/man7/man.mandoc.7 +mv %{buildroot}%{_mandir}/man7/roff.7 %{buildroot}%{_mandir}/man7/roff.mandoc.7 +mv %{buildroot}%{_mandir}/man7/eqn.7 %{buildroot}%{_mandir}/man7/eqn.mandoc.7 +mv %{buildroot}%{_mandir}/man7/tbl.7 %{buildroot}%{_mandir}/man7/tbl.mandoc.7 +mv %{buildroot}%{_mandir}/man8/makewhatis.8 %{buildroot}%{_mandir}/man8/makewhatis.mandoc.8 + +# Touch all the locations that update-alternatives will use +touch %{buildroot}%{_bindir}/man +touch %{buildroot}%{_bindir}/apropos +touch %{buildroot}%{_bindir}/whatis +touch %{buildroot}%{_bindir}/soelim +touch %{buildroot}%{_sbindir}/makewhatis +touch %{buildroot}%{_mandir}/man1/apropos.1 +touch %{buildroot}%{_mandir}/man1/man.1 +touch %{buildroot}%{_mandir}/man1/soelim.1 +touch %{buildroot}%{_mandir}/man1/whatis.1 +touch %{buildroot}%{_mandir}/man7/man.7 +touch %{buildroot}%{_mandir}/man7/roff.7 +touch %{buildroot}%{_mandir}/man7/eqn.7 +touch %{buildroot}%{_mandir}/man7/tbl.7 +touch %{buildroot}%{_mandir}/man8/makewhatis.8 %check env LD_LIBRARY_PATH="$PWD" %make_build regress %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 || : +# remove alternativized files if they are not symlinks +for f in man apropos whatis soelim; do + [ -L %{_bindir}/$f ] || %{__rm} -f %{_bindir}/$f || : + [ -L %{_mandir}/man1/$f.1.gz ] || %{__rm} -f %{_mandir}/man1/$f.1.gz || : 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 +for f in man roff eqn tbl; do + [ -L %{_mandir}/man7/$f.7.gz ] || %{__rm} -f %{_mandir}/man7/$f.7.gz || : +done +[ -L %{_sbindir}/makewhatis ] || %{__rm} -f %{_sbindir}/makewhatis || : +[ -L %{_mandir}/man8/makewhatis.8.gz ] || %{__rm} -f %{_mandir}/man8/makewhatis.8.gz || : %preun if [ $1 -eq 0 ]; then - %{_sbindir}/update-alternatives --remove man %{_bindir}/man.%{name} >/dev/null 2>&1 || : + %{_sbindir}/update-alternatives --remove man %{_bindir}/man.mandoc || : + %{_sbindir}/update-alternatives --remove soelim %{_bindir}/soelim.mandoc || : + %{_sbindir}/update-alternatives --remove roff.7.gz %{_mandir}/man7/roff.mandoc.7.gz || : + %{_sbindir}/update-alternatives --remove man.7.gz %{_mandir}/man7/man.mandoc.7.gz || : 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 \ - --slave %{_mandir}/man1/soelim.1.gz soelim.1.gz %{_mandir}/man1/soelim.%{name}.1.gz \ - >/dev/null 2>&1 || : +%{_sbindir}/update-alternatives --install %{_bindir}/man man %{_bindir}/man.mandoc 200 \ + --slave %{_bindir}/apropos apropos %{_bindir}/apropos.mandoc \ + --slave %{_bindir}/whatis whatis %{_bindir}/whatis.mandoc \ + --slave %{_sbindir}/makewhatis makewhatis %{_sbindir}/makewhatis.mandoc \ + --slave %{_mandir}/man1/apropos.1.gz apropos.1.gz %{_mandir}/man1/apropos.mandoc.1.gz \ + --slave %{_mandir}/man1/man.1.gz man.1.gz %{_mandir}/man1/man.mandoc.1.gz \ + --slave %{_mandir}/man1/whatis.1.gz whatis.1.gz %{_mandir}/man1/whatis.mandoc.1.gz \ + --slave %{_mandir}/man8/makewhatis.8.gz makewhatis.8.gz %{_mandir}/man8/makewhatis.mandoc.8.gz || : + +%{_sbindir}/update-alternatives --install %{_bindir}/soelim soelim %{_bindir}/soelim.mandoc 200 \ + --slave %{_mandir}/man1/soelim.1.gz soelim.1.gz %{_mandir}/man1/soelim.mandoc.1.gz || : + +%{_sbindir}/update-alternatives --install %{_mandir}/man7/roff.7.gz roff.7.gz %{_mandir}/man7/roff.mandoc.7.gz 200 \ + --slave %{_mandir}/man7/eqn.7.gz eqn.7.gz %{_mandir}/man7/eqn.mandoc.7.gz \ + --slave %{_mandir}/man7/tbl.7.gz tbl.7.gz %{_mandir}/man7/tbl.mandoc.7.gz || : + +%{_sbindir}/update-alternatives --install %{_mandir}/man7/man.7.gz man.7.gz %{_mandir}/man7/man.mandoc.7.gz 200 || : %files %license LICENSE %{_bindir}/demandoc %{_bindir}/mandoc +%{_bindir}/apropos.mandoc %ghost %{_bindir}/apropos -%{_bindir}/apropos.%{name} +%{_bindir}/man.mandoc %ghost %{_bindir}/man -%{_bindir}/man.%{name} +%{_bindir}/soelim.mandoc %ghost %{_bindir}/soelim -%{_bindir}/soelim.%{name} +%{_bindir}/whatis.mandoc %ghost %{_bindir}/whatis -%{_bindir}/whatis.%{name} -%{_sbindir}/makewhatis +%{_sbindir}/makewhatis.mandoc +%ghost %{_sbindir}/makewhatis %{_mandir}/man1/demandoc.1.gz %{_mandir}/man1/mandoc.1.gz -%ghost %{_mandir}/man1/soelim.1* -%{_mandir}/man1/soelim.%{name}.* -%ghost %{_mandir}/man1/man.1* -%ghost %{_mandir}/man1/apropos.1* -%ghost %{_mandir}/man1/whatis.1* -%{_mandir}/man1/man.%{name}.1* -%{_mandir}/man1/apropos.%{name}.1* -%{_mandir}/man1/whatis.%{name}.1* +%{_mandir}/man1/apropos.mandoc.1.gz +%ghost %{_mandir}/man1/apropos.1.gz +%{_mandir}/man1/man.mandoc.1.gz +%ghost %{_mandir}/man1/man.1.gz +%{_mandir}/man1/soelim.mandoc.1.gz +%ghost %{_mandir}/man1/soelim.1.gz +%{_mandir}/man1/whatis.mandoc.1.gz +%ghost %{_mandir}/man1/whatis.1.gz %{_mandir}/man5/mandoc.conf.5.gz %{_mandir}/man5/mandoc.db.5.gz -%{_mandir}/man7/eqn.7.gz +%{_mandir}/man7/eqn.mandoc.7.gz +%ghost %{_mandir}/man7/eqn.7.gz %{_mandir}/man7/mandoc_char.7.gz -%{_mandir}/man7/man.7.gz +%{_mandir}/man7/man.mandoc.7.gz +%ghost %{_mandir}/man7/man.7.gz %{_mandir}/man7/mdoc.7.gz -%{_mandir}/man7/roff.7.gz -%{_mandir}/man7/tbl.7.gz -%{_mandir}/man8/makewhatis.8.gz +%{_mandir}/man7/roff.mandoc.7.gz +%ghost %{_mandir}/man7/roff.7.gz +%{_mandir}/man7/tbl.mandoc.7.gz +%ghost %{_mandir}/man7/tbl.7.gz +%{_mandir}/man8/makewhatis.mandoc.8.gz +%ghost %{_mandir}/man8/makewhatis.8.gz %files -n libmandoc-devel %license LICENSE @@ -177,6 +216,9 @@ fi %{_mandir}/man3/tbl.3* %changelog +* Thu Jan 23 2025 Funda Wang - 1.14.6-7 +- use more alternatives so that it won't conflicts with other packages + * Sun Nov 17 2024 Funda Wang - 1.14.6-6 - do not force clang as cc, it is using different optflags than gcc now