#!/usr/bin/make -f


# FR the include below loads various mk files:
#
include /usr/share/dpkg/default.mk
#
# include $(dpkg_datadir)/architecture.mk
# include $(dpkg_datadir)/buildflags.mk
# include $(dpkg_datadir)/pkg-info.mk
# include $(dpkg_datadir)/vendor.mk

# export DH_VERBOSE=1
# export DH_OPTIONS=-v

export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

export build_multiarch_dir ?= $(shell dpkg-architecture -q DEB_BUILD_MULTIARCH)

# Hardening stuff, see http://wiki.debian.org/Hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1

export LIB_VERSION = 3.0.5
export LIB_SOVERSION = 3

%:
	dh $@ --build-system=cmake

override_dh_auto_clean:

	rm -f debian/libpwizlite.3
	rm -rf debian/includes
	rm -rf obj-$(build_multiarch_dir)

	dh_clean


override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_INSTALL_PREFIX="/usr" \
		-DCMAKE_BUILD_TYPE=release

	rst2man debian/libpwizlite.3.rst > debian/libpwizlite.3

	sh debian/make-included-headers-hierarchy.sh

