#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=-all
export DEB_CFLAGS_MAINT_APPEND=-D__STDC_WANT_LIB_EXT1__=1
# For waf to make include path ordering fixed
# https://lists.samba.org/archive/samba-technical/2022-March/137230.html
# https://bugzilla.samba.org/show_bug.cgi?id=15033
export PYTHONHASHSEED := 1

conf_args = \
        --prefix=/usr \
	--enable-fhs \
        --libdir=/usr/lib/${DEB_HOST_MULTIARCH} \
        --with-modulesdir=/usr/lib/${DEB_HOST_MULTIARCH}/samba \
        --disable-rpath \
	--disable-rpath-install \

%:
	dh $@

override_dh_auto_configure:
	./buildtools/bin/waf -j1 configure -C ${conf_args}

override_dh_auto_build:
	./buildtools/bin/waf --targets=compile_et,asn1_compile
	./buildtools/bin/waf install --destdir="${CURDIR}/debian/tmp"

override_dh_auto_test:

override_dh_auto_install:
	cp ${CURDIR}/bin/default/examples/winexe/winexe.inst ${CURDIR}/debian/winexe/usr/bin/winexe
