#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@  --buildsystem=cmake

override_dh_auto_configure:
	dh_auto_configure -- -DPAHO_WITH_SSL=TRUE -DPAHO_ENABLE_TESTING=FALSE \
	-DPAHO_BUILD_STATIC=TRUE -DPAHO_BUILD_SAMPLES=TRUE

override_dh_auto_install:
	dh_auto_install
	# Remove suffix from static libraries
	for file in debian/tmp/usr/lib/*/libpaho-mqtt*.a; do \
		mv -n -v "$${file}" "$${file%%-static.a}.a"; \
	done
