Skip to content

Commit

Permalink
nx-libs.spec: only depend upon pathfix.py for Fedora 27+ and RHEL 7+.
Browse files Browse the repository at this point in the history
On older systems, use a less sophisticated way to replace the hashbang.
  • Loading branch information
Ionic committed Feb 23, 2023
1 parent b536e9f commit 288394c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions nx-libs.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 288394c

Please sign in to comment.