From 30d8d25f369bbe2de33525c8da9cf39c15110eda Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Jan 18 2019 15:32:01 +0000 Subject: Update python2/3 builds --- diff --git a/libldb.spec b/libldb.spec index d8891a4..794b8fe 100644 --- a/libldb.spec +++ b/libldb.spec @@ -10,6 +10,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 + %global talloc_version 2.1.15 %global tdb_version 1.3.17 %global tevent_version 0.9.38 @@ -142,30 +152,27 @@ Development files for the Python bindings for the LDB library %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 \ --with-modulesdir=%{_libdir}/ldb/modules \ - $PY3_CONFIG_FLAGS \ + %{?extra_python} \ --with-privatelibdir=%{_libdir}/ldb make %{?_smp_mflags} V=1 doxygen Doxyfile %check +%{?export_waf_python} make %{?_smp_mflags} check %install +%{?export_waf_python} make install DESTDIR=$RPM_BUILD_ROOT rm -f $RPM_BUILD_ROOT%{_libdir}/libldb.a