From 0d4513a18628abc68965f63b310a617ca7bfe143 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Thu, 17 Jan 2019 17:27:12 +0100 Subject: [PATCH] Update python2/3 builds --- libtalloc.spec | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/libtalloc.spec b/libtalloc.spec index f572391..7f59dde 100644 --- a/libtalloc.spec +++ b/libtalloc.spec @@ -6,6 +6,16 @@ %global with_python2 1 %endif +%if (0%{?with_python2} == 1 && 0%{?with_python3} == 0) +# We need to sent env PYTHON for python2 only build +%global export_waf_python export PYTHON=%{__python2} +%endif + +%if (0%{?with_python2} == 1 && 0%{?with_python3} == 1) +# python3 is default and therefore python2 need to be set as extra-python +%global extra_python --extra-python=%{__python2} +%endif + Name: libtalloc Version: 2.1.15 Release: 1%{?dist} @@ -91,31 +101,26 @@ Development libraries for python3-talloc %autosetup -n talloc-%{version} -p1 %build - -%if 0%{?with_python3} -PY3_CONFIG_FLAGS=--extra-python=%{__python3} -%else -PY3_CONFIG_FLAGS="" -%endif - # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1217376 export python_LDFLAGS="" +%{?export_waf_python} %configure --disable-rpath \ --disable-rpath-install \ --bundled-libraries=NONE \ --builtin-libraries=replace \ --disable-silent-rules \ - $PY3_CONFIG_FLAGS + %{?extra_python} make %{?_smp_mflags} V=1 doxygen doxy.config %check +%{?export_waf_python} make %{?_smp_mflags} check %install - +%{?export_waf_python} make install DESTDIR=$RPM_BUILD_ROOT # Shared libraries need to be marked executable for