Hi,
on Fedora 38, the binary package python3-collada ships a broken symlink (CHANGELOG.rst):
| $ rpm -qlv python3-collada | grep /usr/share/doc/python3-collada | drwxr-xr-x 2 root root 0 Jan 20 2023 /usr/share/doc/python3-collada | -rw-r--r-- 1 root root 428 Nov 12 2021 /usr/share/doc/python3-collada/AUTHORS.md | lrwxrwxrwx 1 root root 18 Nov 12 2021 /usr/share/doc/python3-collada/CHANGELOG.rst -> docs/changelog.rst | -rw-r--r-- 1 root root 1095 Nov 12 2021 /usr/share/doc/python3-collada/README.markdown | $
So I wanted to fix this by:
| diff --git a/python-collada.spec b/python-collada.spec | index 1f6a6bf..6178381 100644 | --- a/python-collada.spec | +++ b/python-collada.spec | @@ -58,6 +58,7 @@ as well as in-place editing.
| %install | %py3_install | +install -p -m 0644 -t '%{buildroot}%{_pkgdocdir}' -D CHANGELOG.rst
| %check | @@ -66,7 +67,8 @@ as well as in-place editing.
| %files -n python%{python3_pkgversion}-collada | %license COPYING | -%doc AUTHORS.md CHANGELOG.rst README.markdown | +%doc AUTHORS.md README.markdown | +%doc %{_pkgdocdir}/CHANGELOG.rst | %{python3_sitelib}/*
But this installs CHANGELOG.rst in /usr/share/doc/python-collada (not python3-collada):
| $ rpm -qlpv noarch/python3-collada-0.7.2-5.fc38.noarch.rpm | grep /doc | -rw-r--r-- 1 root root 8133 Nov 12 2021 /usr/share/doc/python-collada/CHANGELOG.rst | drwxr-xr-x 2 root root 0 Jan 20 2023 /usr/share/doc/python3-collada | -rw-r--r-- 1 root root 428 Nov 12 2021 /usr/share/doc/python3-collada/AUTHORS.md | -rw-r--r-- 1 root root 1095 Nov 12 2021 /usr/share/doc/python3-collada/README.markdown | $
as %_pkgdocdir is defined by appending the source package's name, not the binary's name:
| $ grep -R pkgdocdir /usr/lib/rpm | /usr/lib/rpm/redhat/macros:%_pkgdocdir %{_docdir}/%{name} | $
But obviously, rpm(build) must know the binary package's di- rectory name as it installs %doc files given by only by their base filename there (AUTHORS.md and README.markdown in this example).
So how/with which macro can I access a binary package's do- cumentation directory name in a spec file?
(Posting this on python-devel as %pkgdocdir is used in some Python packages as well and there is (always?) a difference between the source and binary package name.)
TIA, Tim
python-devel@lists.fedoraproject.org