Fixes macro initialisation on EL6, F22+

Use unversioned macros for EL6, don't reset python_sitelib on F22+ and
always use the Python binary determined for the OS, not python3 for the
shebang line.

Fixes #167, #168
This commit is contained in:
Dominic Cleal 2015-04-20 15:15:32 +01:00
parent 4091af9591
commit 3a1075c7bb

View file

@ -6,10 +6,15 @@
%else
%global use_python3 0
%global use_python2 1
%if 0%{?__python2:1}
%global pythonbin %{__python2}
%global python_sitelib %{python2_sitelib}
%else
%global pythonbin %{__python}
%global python_sitelib %{python_sitelib}
%endif
%{!?python2_sitelib: %define python_sitelib %(%{pythonbin} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%endif
%{!?python_sitelib: %define python_sitelib %(%{pythonbin} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Name: tito
Version: 0.5.6
@ -73,7 +78,7 @@ git.
%prep
%setup -q -n tito-%{version}
sed -i 1"s|#!/usr/bin/python|#!/usr/bin/python3|" bin/tito
sed -i 1"s|#!.*|#!%{pythonbin}|" bin/tito
%build
%{pythonbin} setup.py build