Skip to content

Commit 288394c

Browse files
committed
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.
1 parent b536e9f commit 288394c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

nx-libs.spec

+14-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ BuildRequires: zlib-devel
134134
BuildRequires: libtirpc-devel
135135
%endif
136136

137-
%if 0%{?fedora} || 0%{?rhel}
137+
%if 0%{?fedora} > 26 || 0%{?rhel} > 6
138138
BuildRequires: /usr/bin/pathfix.py
139139
%endif
140140

@@ -491,10 +491,22 @@ sed -i -e '1c\
491491
%{_bindir}/python2' '%{buildroot}%{_bindir}/nxdialog'
492492
%endif
493493
%else
494-
%if 0%{?fedora} >= 23 || 0%{?rhel} >= 8
494+
# Unfortunately, pathfix.py is not available everywhere, so where it is not,
495+
# we replace it in a less sophisticated way.
496+
%if 0%{?fedora} > 22 || 0%{?rhel} > 7
497+
%if 0%{?fedora} > 26 || 0%{?rhel} > 7
495498
pathfix.py -pni "%{__python3} %{py3_shbang_opts}" '%{buildroot}%{_bindir}/nxdialog'
496499
%else
500+
sed -i -e '1c\
501+
%{__python3}' '%{buildroot}%{_bindir}/nxdialog'
502+
%endif
503+
%else
504+
%if 0%{?rhel} > 6
497505
pathfix.py -pni "%{__python2} %{py2_shbang_opts}" '%{buildroot}%{_bindir}/nxdialog'
506+
%else
507+
sed -i -e '1c\
508+
/usr/bin/python2' '%{buildroot}%{_bindir}/nxdialog'
509+
%endif
498510
%endif
499511
%endif
500512

0 commit comments

Comments
 (0)