On 21. 12. 20 17:30, Georg Sauthoff wrote:
Hello,
I'm trying to build a fedora package for EPEL8 on Copr and I'm wondering where its pikepdf dependency is coming from.
I conditionally disable the python dependency generator with a 0%{?epel} guard (cf. https://github.com/gsauthof/copr-fedora/blob/c4bf0d2031b529e637d085a84837325... ):
%if 0%{?epel} == 0 # this is basically equivalent to adding Requires: for # pikepdf # pillow # # the generator is enabled by default, since f30 or so %{?python_enable_dependency_generator} %else %{?python_disable_dependency_generator} Requires: python3-pillow %endif
The guard seems to work (because e.g. the in the same way disabled tests aren't executed, as I can see from the build.log.
However, the final rpm package still depends on pikepdf:
python3.6dist(pikepdf)
(cf. the end of https://download.copr.fedorainfracloud.org/results/gsauthof/fedora/epel-8-x8... )
Thus, it looks like disabling the dependency generator with the python_disable_dependency_generator macro didn't work?
Hello Georg,
It seems that the macro is not defined in EPEL 8 at all.
Fedora: $ grep -r -A2 python_disable_dependency_generator /usr/lib/rpm /usr/lib/rpm/macros.d/macros.python:%python_disable_dependency_generator() \ /usr/lib/rpm/macros.d/macros.python-%undefine __pythondist_requires \ /usr/lib/rpm/macros.d/macros.python-%{nil}
EPEL 8 mock: # grep -r -A2 python_disable_dependency_generator /usr/lib/rpm (nada)
As a workaround, you could do what the macro does on Fedora:
%undefine __pythondist_requires
But we should get that macro introduced. The generators are owned by epel-rpm-macros, not RHEL's python*-rpm-macros, so the fix needs to be done there.
-----------------------
As a side note, I wonder why do you need to resort to disabling the automatic requires generator? If the dependency on pikepdf is bogus, work with upstream to remove it. In the mean time, sed/patch it out form upstream metadata in %prep.
It is: https://gitlab.mister-muffin.de/josch/img2pdf/blob/master/setup.py#L8