to answer my own question, after doing some research and talking to tchvatal: * brp_compress compresses every uncompressed manpage found in %_mandir * resulting manpage filename is foo.1%{ext_man} (hardcoding ".gz" is discouraged) * this should also be the name in /etc/alternatives so, steps to properly install an alternativized manpage: 1. ensure that the targets exist in uncompressed form: %{_mandir}/man1/foo-altA.1 %{_mandir}/man1/foo-altB.1 2. ensure that neither foo.1 nor foo.1%{ext_man} exists 3. touch %{_sysconfdir}/alternatives/foo.1%{ext_man} ln -sf %{_sysconfdir}/alternatives/foo.1%{ext_man} %{_mandir}/man1/foo.1%{ext_man} 4. in install-alternatives, use link %{_mandir}/man1/foo.1%{ext_man}, name foo.1%{ext_man} and path %{_mandir}/man1/foo.1%{ext_man} this is also what the singlespec helpers will do from now on m. On 13.3.2017 20:28, jan matejek wrote:
I am now writing better support for update-alternatives in the python singlespec macros. The way it works now, it is very well suited to enforce naming conventions.
So.... what are these? :)
Far as I could figure out, you install manpages as "manpage.1" and some magic converts it to "manpage.1.gz"?
Should the alternatives entry be /etc/alternatives/manpage.1 or /etc/alternatives/manpage.1.gz ? Should the %ghost %{_mandir}/man1/manpage.1 be called that, or should it be manpage.1.gz? Or does it depend on whether the original manpage.1 is gzipped or not?
--
at the moment, the enforced convention in singlespec is that base %_mandir names depend on the original file, and /etc/alternatives entries are always named without ".gz".
Should that be changed to something else?
--
Relatedly, is it common in any packages to make alternatives for something other than /usr/bin and %_mandir? I know that Java plays with /usr/lib/jvm, but other than that?
thanks m.