From d35c5d011a951ee8d331dfbe940d87fa7c98945e Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Thu, 23 Feb 2023 12:19:14 +0100 Subject: nx-libs.spec: fix nxdialog hashbang selection, especially on *SuSE. --- nx-libs.spec | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/nx-libs.spec b/nx-libs.spec index 84140f381..d4370c7eb 100644 --- a/nx-libs.spec +++ b/nx-libs.spec @@ -478,8 +478,20 @@ rm -r %{buildroot}%{_includedir}/nx-X11/Xtrans rm %{buildroot}%{_libdir}/*.la # Fix python scripts -%if 0%{?fedora} >= 23 || 0%{?rhel} >= 8 || 0%{?py_ver} == 3 -sed -i '1 s/python/python3/' %{buildroot}%{_bindir}/nxdialog +%if 0%{?suse_version} +%if 0%{?suse_version} >= 1500 +sed -i -e '1c\ +%{_bindir}/python3' '%{buildroot}%{_bindir}/nxdialog' +%else +sed -i -e '1c\ +%{_bindir}/python2' '%{buildroot}%{_bindir}/nxdialog' +%endif +%else +%if 0%{?fedora} >= 23 || 0%{?rhel} >= 8 +pathfix.py -pni "%{__python3} %{py3_shbang_opts}" '%{buildroot}%{_bindir}/nxdialog' +%else +pathfix.py -pni "%{__python2} %{py2_shbang_opts}" '%{buildroot}%{_bindir}/nxdialog' +%endif %endif %if 0%{?fdupes:1} -- cgit v1.2.3