I am trying to build a package for RHEL 7 and RHEL 8 that depends on an EPEL (for RHEL 7) package python36-dbus the requires section goes like so: Requires: %{python3} Requires: %{python3}-dbus
This puts in a requirement for python3-dbus for RHEL 7 which doesn't exist, the package is actually python36-dbus, however short of a conditional saying if rhel 7 then package name is python36-dbus is there a clean and scalable way to make sure the package version is correct?
I am looking into python3_pkgversion macro but that doesn't seem to be correct either. Does anyone know how I should do this now with a single spec file for both RHEL 7 and 8 that doesn't contain a conditional expression?
Thanks, -Erinn
On Tue, Mar 31, 2020 at 12:51 PM Erinn Looney-Triggs erinn.looneytriggs@gmail.com wrote:
I am trying to build a package for RHEL 7 and RHEL 8 that depends on an EPEL (for RHEL 7) package python36-dbus the requires section goes like so: Requires: %{python3} Requires: %{python3}-dbus
This puts in a requirement for python3-dbus for RHEL 7 which doesn't exist, the package is actually python36-dbus, however short of a conditional saying if rhel 7 then package name is python36-dbus is there a clean and scalable way to make sure the package version is correct?
I am looking into python3_pkgversion macro but that doesn't seem to be correct either. Does anyone know how I should do this now with a single spec file for both RHEL 7 and 8 that doesn't contain a conditional expression?
See https://bugzilla.redhat.com/show_bug.cgi?id=1812665
There's a bug in the macros.
Thanks for the quick reply. Disappointing, but it happens.
The correct way in EPEL7 is to use python%{python3_pkgversion}
%{python3} = python3 python%{python3_pkgversion} = python36 python%{python3_other_pkgversion} = python34 ?? (I think, maybe python38)
On Tue, Mar 31, 2020 at 11:47 AM Erinn Looney-Triggs erinn.looneytriggs@gmail.com wrote:
Thanks for the quick reply. Disappointing, but it happens. _______________________________________________ epel-devel mailing list -- epel-devel@lists.fedoraproject.org To unsubscribe send an email to epel-devel-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/epel-devel@lists.fedoraproject...
%{python3} = python3
%{python3} = /usr/bin/python3
At least in Fedora. In EPEL, most likely as well.
See https://bugzilla.redhat.com/show_bug.cgi?id=1812665
There's a bug in the macros.
But that bug has nothing to do with either %python3 or %python3_pkgversion.
Requires: %{python3} Requires: %{python3}-dbus
What does this supposed to evaluate to?
Anyway, the inconsistency problem is:
python36-dbus on EPEL 7 does not provide python3-dbus (can be fixed by adding %python_provide %{name} to the EPEL package)
python3-dbus in RHEL 8 does not provide python36-dbus (can be fixed by changing RHEL's %python_provide and rebuilding the RHEL package, not sure if that will go trough)
I am looking into python3_pkgversion macro but that doesn't seem to be correct either.
This should work on both EPEL 7 and EPEL 8:
Requires: python%{python3_pkgversion}-dbus
Doesn't it?
$ mock -r epel-7-x86_64 shell <mock-chroot> sh-4.2# rpm --eval '%python3_pkgversion' 36
$ mock -r epel-8-x86_64 shell <mock-chroot> sh-4.4# rpm --eval '%python3_pkgversion' 3
On 3/31/20 3:23 PM, Miro Hrončok wrote:
%{python3} = python3
%{python3} = /usr/bin/python3
At least in Fedora. In EPEL, most likely as well.
See https://bugzilla.redhat.com/show_bug.cgi?id=1812665
There's a bug in the macros.
But that bug has nothing to do with either %python3 or %python3_pkgversion.
Requires: %{python3} Requires: %{python3}-dbus
What does this supposed to evaluate to?
Yeah my apologies I left out the most important part of the spec file:
%global python3 python%{python3_pkgversion} %global python3_other python%{python3_other_pkgversion}
Anyway, the inconsistency problem is:
python36-dbus on EPEL 7 does not provide python3-dbus (can be fixed by adding %python_provide %{name} to the EPEL package)
Ok so this would be a bug to file against the package then. Thanks.
python3-dbus in RHEL 8 does not provide python36-dbus (can be fixed by changing RHEL's %python_provide and rebuilding the RHEL package, not sure if that will go trough)
Understandably.
I am looking into python3_pkgversion macro but that doesn't seem to be correct either.
This should work on both EPEL 7 and EPEL 8:
Requires: python%{python3_pkgversion}-dbus
Doesn't it?
$ mock -r epel-7-x86_64 shell <mock-chroot> sh-4.2# rpm --eval '%python3_pkgversion' 36
$ mock -r epel-8-x86_64 shell <mock-chroot> sh-4.4# rpm --eval '%python3_pkgversion' 3
Interestingly... no it did not and the reason is I built against rhel-7-x86_64 in mock not epel-7-x86_64. I believe there is a macro override for epel-7-x86_64 hence why I was getting a dependency against python3-dbus.
I finally ended up doing this for the moment, which I do not like very much and I will probably fix here shortly:
%if 0%{?rhel} == 7 Requires: python36-dbus %else Requires: %{python3}-dbus %endif
Thanks all for all the good information, it is appreciated.
-Erinn
On 31. 03. 20 23:40, Erinn Looney-Triggs wrote:
Interestingly... no it did not and the reason is I built against rhel-7-x86_64 in mock not epel-7-x86_64. I believe there is a macro override for epel-7-x86_64 hence why I was getting a dependency against python3-dbus.
Correct.
Ok so this would be a bug to file against the package then. Thanks.
I'm just gonna do it rigth away.
On 01. 04. 20 0:06, Miro Hrončok wrote:
On 31. 03. 20 23:40, Erinn Looney-Triggs wrote:
Interestingly... no it did not and the reason is I built against rhel-7-x86_64 in mock not epel-7-x86_64. I believe there is a macro override for epel-7-x86_64 hence why I was getting a dependency against python3-dbus.
Correct.
Ok so this would be a bug to file against the package then. Thanks.
I'm just gonna do it rigth away.
https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-0745794f21
I see the update in koji/bodhi, thanks for doing that so quickly.
-Erinn
On 3/31/20 4:06 PM, Miro Hrončok wrote:
On 31. 03. 20 23:40, Erinn Looney-Triggs wrote:
Interestingly... no it did not and the reason is I built against rhel-7-x86_64 in mock not epel-7-x86_64. I believe there is a macro override for epel-7-x86_64 hence why I was getting a dependency against python3-dbus.
Correct.
Ok so this would be a bug to file against the package then. Thanks.
I'm just gonna do it rigth away.
epel-devel@lists.fedoraproject.org