#!/usr/bin/make -f

export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --builddirectory=build --buildsystem=cmake --with python3

override_dh_auto_configure:
	dh_auto_configure -- \
		-DLIB=lib/$(DEB_HOST_MULTIARCH) \
		-DBUILD_EXAMPLES=NO \
		-DBUILD_TESTS=NO \
		-DBUILD_RUBY=NO \
		-DBUILD_PERL=NO \
		-DBUILD_JAVA=NO \
		-DBUILD_SWIG_PLUGIN=NO \
		-DPYTHON_INSTALL_DIR=lib/python3/dist-packages

override_dh_auto_install:
	dh_auto_install
	mv debian/tmp/etc/openwsman/owsmangencert.sh \
		debian/tmp/usr/sbin/owsmangencert
	install -D -m 644 build/package/openwsman.service \
		debian/tmp/usr/lib/systemd/system/openwsman.service

# The bindings tests spawn clients that talk to a running openwsmand
override_dh_auto_test:

# Plugins and authenticator modules are dlopen'ed by the daemon, not
# linked against, so they must not get shlibs entries or ldconfig
override_dh_makeshlibs:
	dh_makeshlibs -Xopenwsman/plugins -Xopenwsman/authenticators
