Skip to content

Commit 6fe65f1

Browse files
committed
spec: If python3 supported, use it for the cli tool (bz #1436809)
This is newer fedora policy. https://bugzilla.redhat.com/show_bug.cgi?id=1436809
1 parent 8fb5c1c commit 6fe65f1

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

python-bugzilla.spec

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ cp -a . %{py3dir}
7373
%endif # with_python3
7474

7575

76+
7677
%build
7778
%if 0%{?with_python3}
7879
pushd %{py3dir}
@@ -83,6 +84,7 @@ popd
8384
%{__python2} setup.py build
8485

8586

87+
8688
%install
8789
%if 0%{?with_python3}
8890
pushd %{py3dir}
@@ -96,11 +98,17 @@ popd
9698
# Replace '#!/usr/bin/env python' with '#!/usr/bin/python2'
9799
# The format is ideal for upstream, but not a distro. See:
98100
# https://fedoraproject.org/wiki/Features/SystemPythonExecutablesUseSystemPython
101+
%if 0%{?with_python3}
102+
%global python_env_path %{__python3}
103+
%else
104+
%global python_env_path %{__python2}
105+
%endif
99106
for f in $(find %{buildroot} -type f -executable -print); do
100-
sed -i "1 s|^#!/usr/bin/env python|#!%{__python2}|" $f || :
107+
sed -i "1 s|^#!/usr/bin/.*|#!%{python_env_path}|" $f || :
101108
done
102109

103110

111+
104112
%check
105113
%{__python2} setup.py test
106114

0 commit comments

Comments
 (0)