From 288394c18c6aa70faabb69fa3a021cfbd300b8df Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Thu, 23 Feb 2023 15:28:20 +0100 Subject: nx-libs.spec: only depend upon pathfix.py for Fedora 27+ and RHEL 7+. On older systems, use a less sophisticated way to replace the hashbang. --- nx-libs.spec | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/nx-libs.spec b/nx-libs.spec index 086602ee9..30c64904e 100644 --- a/nx-libs.spec +++ b/nx-libs.spec @@ -134,7 +134,7 @@ BuildRequires: zlib-devel BuildRequires: libtirpc-devel %endif -%if 0%{?fedora} || 0%{?rhel} +%if 0%{?fedora} > 26 || 0%{?rhel} > 6 BuildRequires: /usr/bin/pathfix.py %endif @@ -491,10 +491,22 @@ sed -i -e '1c\ %{_bindir}/python2' '%{buildroot}%{_bindir}/nxdialog' %endif %else -%if 0%{?fedora} >= 23 || 0%{?rhel} >= 8 +# Unfortunately, pathfix.py is not available everywhere, so where it is not, +# we replace it in a less sophisticated way. +%if 0%{?fedora} > 22 || 0%{?rhel} > 7 +%if 0%{?fedora} > 26 || 0%{?rhel} > 7 pathfix.py -pni "%{__python3} %{py3_shbang_opts}" '%{buildroot}%{_bindir}/nxdialog' %else +sed -i -e '1c\ +%{__python3}' '%{buildroot}%{_bindir}/nxdialog' +%endif +%else +%if 0%{?rhel} > 6 pathfix.py -pni "%{__python2} %{py2_shbang_opts}" '%{buildroot}%{_bindir}/nxdialog' +%else +sed -i -e '1c\ +/usr/bin/python2' '%{buildroot}%{_bindir}/nxdialog' +%endif %endif %endif -- cgit v1.2.3