naemon / naemon-livestatus

Naemon - Livestatus Eventbroker Module
GNU General Public License v2.0
26 stars 30 forks source link

rpm build error: attempt to use unversioned python, define %__python to /usr/bin/python2 or /usr/bin/python3 explicitly #99

Closed olahaye74 closed 1 year ago

olahaye74 commented 2 years ago

Since Fedora-33, RHEL-8, %python is not valid anymore and produce an error it you try to use it. Please update rpm spec file to avoid %python use. Instead use %python3 on recent distress and %python2 on old ones (reel-6 and reel-7)

Error message: error: attempt to use unversioned python, define %__python to /usr/bin/python2 or /usr/bin/python3 explicitly error: line 54: install -d %buildroot%{python_sitelib}/livestatus

how to reproduce (on AlmaLinux-8 for example): rpm build -tb naemon-livestatus-1.3.1.tar.gz

olahaye74 commented 2 years ago

%if 0%{?fedora} > 32 || 0%{?rhel} > 7 should do the trick. Maybe add test for sure as well...

%if 0%{?fedora} > 33 || 0%{?rhel} > 7 %define python %python3 %else %define python %python2 %endif

sni commented 2 years ago

Sounds good, could you maybe even prepare a pull request with that change?

sni commented 1 year ago

Is this still an issue, the builds on OBS look fine: https://build.opensuse.org/package/show/home:naemon/naemon-livestatus (including latest fedora and alma)