- Modify configure to search for versioned python
- Resolves: rhbz#1598047
This commit is contained in:
parent
7c64bf7710
commit
4bd338a1f8
@ -58,7 +58,7 @@
|
||||
Summary: Liberty Alliance Single Sign On
|
||||
Name: lasso
|
||||
Version: 2.6.0
|
||||
Release: 5%{?dist}
|
||||
Release: 6%{?dist}
|
||||
License: GPLv2+
|
||||
Group: System Environment/Libraries
|
||||
Source: http://dev.entrouvert.org/lasso/lasso-%{version}.tar.gz
|
||||
@ -66,6 +66,7 @@ Source: http://dev.entrouvert.org/lasso/lasso-%{version}.tar.gz
|
||||
Patch1: use-specified-python-interpreter.patch
|
||||
Patch2: build-scripts-py3-compatible.patch
|
||||
Patch3: duplicate-python-LogoutTestCase.patch
|
||||
Patch4: versioned-python-configure.patch
|
||||
|
||||
BuildRequires: libtool autoconf automake
|
||||
|
||||
@ -188,6 +189,7 @@ library.
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
|
||||
# Remove any python script shebang lines (unless they refer to python3)
|
||||
sed -i -E -e '/^#![[:blank:]]*(\/usr\/bin\/env[[:blank:]]+python[^3]?\>)|(\/usr\/bin\/python[^3]?\>)/d' \
|
||||
@ -312,6 +314,10 @@ rm -fr %{buildroot}%{_defaultdocdir}/%{name}
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Sat Jul 7 2018 <jdennis@redhat.com> - 2.6.0-6
|
||||
- Modify configure to search for versioned python
|
||||
- Resolves: rhbz#1598047
|
||||
|
||||
* Wed Jul 04 2018 Petr Pisar <ppisar@redhat.com> - 2.6.0-5
|
||||
- Perl 5.28 rebuild
|
||||
|
||||
|
48
versioned-python-configure.patch
Normal file
48
versioned-python-configure.patch
Normal file
@ -0,0 +1,48 @@
|
||||
commit af29047480cacafaed697cb2a1fb24c5143078a8
|
||||
Author: John Dennis <jdennis@redhat.com>
|
||||
Date: Sat Jul 7 10:59:32 2018 -0400
|
||||
|
||||
Configure should search for versioned Python interpreter.
|
||||
|
||||
Following the guidelines in Python PEP 394 with regards to the python
|
||||
command on UNIX like systems preference should be given to explicitly
|
||||
versioned command interpreter as opposed to unversioned and that an
|
||||
unversioned python command should (but might not) refer to
|
||||
Python2. Also in some environments unversioned Python interpreters
|
||||
(e.g. /usr/bin/python) do not even exist, onlyh their explicitly
|
||||
versioned variants are (e.g. /usr/bin/python2 and /usr/bin/python3).
|
||||
|
||||
Therefore the AC_CHECK_PROGS directive in configure.ac should not rely
|
||||
exclusively on an unversioned Python interpreter as it does not,
|
||||
rather it should search in priority order. First for python3, then for
|
||||
an unversionsed python because some distributions have already moved
|
||||
the default unversioned python to python3, and then finally search for
|
||||
python2. In the scenario where unversioned python is still pointing to
|
||||
python2 it's equivalent to selecting the last prority option of
|
||||
python2, but if unversioned python is pointing to python3 you get
|
||||
instead. The net result is always preferring python3 but gracefully
|
||||
falling back to python2 not matter how the environment exports it's
|
||||
Python.
|
||||
|
||||
If AC_CHECK_PROGS for python does not check for the versioned variants
|
||||
the build fails in environments that only have versioned variants with
|
||||
this error:
|
||||
|
||||
configure: error: Python must be installed to compile lasso
|
||||
|
||||
License: MIT
|
||||
Signed-off-by: John Dennis <jdennis@redhat.com>
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 898468e6..74766972 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -131,7 +131,7 @@ dnl AC_CHECK_PROGS(JAR, fastjar jar)
|
||||
AC_CHECK_PROGS(PERL, perl)
|
||||
AC_CHECK_PROGS(PHP5, php5 php)
|
||||
AC_CHECK_PROGS(PHP5_CONFIG, php-config5 php-config)
|
||||
-AC_CHECK_PROGS(PYTHON, python)
|
||||
+AC_CHECK_PROGS(PYTHON, python3 python python2)
|
||||
AC_CHECK_PROGS(SWIG, swig)
|
||||
|
||||
dnl Make sure we have an ANSI compiler
|
Loading…
Reference in New Issue
Block a user