ctdb-packaging: Call waf with python wrapper
authorAmitay Isaacs <amitay@gmail.com>
Tue, 18 Dec 2018 00:03:51 +0000 (11:03 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 18 Dec 2018 02:38:04 +0000 (13:38 +1100)
This allows to build packages even when python3 is not available by
setting PYTHON variable.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
ctdb/packaging/RPM/ctdb.spec.in

index 537f158..d25735e 100644 (file)
@@ -87,7 +87,8 @@ fi
 
 export CC
 
-CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./buildtools/bin/waf configure \
+CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" \
+$PYTHON ./buildtools/bin/waf configure \
        --builtin-libraries=replace,popt \
        --bundled-libraries=!talloc,!tevent,!tdb \
        --minimum-library-version=talloc:%libtalloc_version,tdb:%libtdb_version,tevent:%libtevent_version \
@@ -102,7 +103,7 @@ CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" ./buildtools/bin/waf configure \
        --mandir=%{_mandir} \
        --localstatedir=%{_localstatedir}
 
-./buildtools/bin/waf build
+$PYTHON ./buildtools/bin/waf build
 
 %install
 # Clean up in case there is trash left from a previous build
@@ -111,7 +112,7 @@ rm -rf $RPM_BUILD_ROOT
 # Create the target build directory hierarchy
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sudoers.d
 
-DESTDIR=$RPM_BUILD_ROOT ./buildtools/bin/waf install
+DESTDIR=$RPM_BUILD_ROOT $PYTHON ./buildtools/bin/waf install
 
 install -m644 config/ctdb.conf $RPM_BUILD_ROOT%{_sysconfdir}/ctdb
 install -m644 config/ctdb.tunables $RPM_BUILD_ROOT%{_sysconfdir}/ctdb