python package with manpage
Hello I'm sorry, but I'm lost, I need help. I trying to add man pages to my python package. The following seems to work. But I'm not sure if it's the good way. Can you help me? %install ... %python_clone -a %{buildroot}%{_bindir}/radexreader %python_clone -a %{buildroot}%{_mandir}/man1/radexreader.1 %python_clone -a %{buildroot}%{_mandir}/fr/man1/radexreader.1 ... %files %{python_files} ... %python_alternative %{_bindir}/radexreader %python_alternative %{_mandir}/man1/radexreader.1.gz %python_alternative %{_mandir}/fr/man1/radexreader.1.gz ... (full spec file is https://build.opensuse.org/package/view_file/home:luigifab:branches:devel:la...) Thanks!
Hello, On vie, 2023-06-09 at 18:52 +0000, Fabrice wrote:
Hello
I'm sorry, but I'm lost, I need help. I trying to add man pages to my python package.
The following seems to work. But I'm not sure if it's the good way. Can you help me?
%install ... %python_clone -a %{buildroot}%{_bindir}/radexreader %python_clone -a %{buildroot}%{_mandir}/man1/radexreader.1 %python_clone -a %{buildroot}%{_mandir}/fr/man1/radexreader.1 ...
%files %{python_files} ... %python_alternative %{_bindir}/radexreader %python_alternative %{_mandir}/man1/radexreader.1.gz %python_alternative %{_mandir}/fr/man1/radexreader.1.gz ...
Yes, that's correct, %python_clone just copies the file for each python flavor and creates the /etc/alternatives thing. Then with %python_alternative in %files, it's done automatically to add to each flavor package, so python310-radexreader.rpm will have the bin and manpackages for that package and the same for all the other flavors, so if the user replaces one package with a different one, the binaries and man pages are replaced with the corresponding version. Just make sure to add also the manpages to the %python_install_alternative [1], I can see in OBS that you only have the binary there, it should be something like: %post %{python_install_alternative radexreader radexreader.1.gz %{_mandir}/fr/man1/radexreader.1.gz} %postun %python_uninstall_alternative radexreader [1] https://en.opensuse.org/openSUSE:Packaging_Python#Grouped_alternatives -- Daniel García Moreno Python Packager
Am 12.06.23 um 08:08 schrieb Daniel Garcia:
Just make sure to add also the manpages to the %python_install_alternative [1], I can see in OBS that you only have the binary there, it should be something like:
%post %{python_install_alternative radexreader radexreader.1.gz %{_mandir}/fr/man1/radexreader.1.gz}
%postun %python_uninstall_alternative radexreader
[1] https://en.opensuse.org/openSUSE:Packaging_Python#Grouped_alternatives
Not sure how much of an effect this has nowadays, but you should replace the `.gz` with `%{?ext_man}`
Added `%{python_install_alternative radexreader radexreader.1}` + `python_uninstall_alternative`. But adding fr does not work, I suppose this is useless.
participants (3)
-
Ben Greiner
-
Daniel Garcia
-
Fabrice