#!/usr/bin/make -f
# -*- makefile -*-

#include /usr/share/dpkg/pkg-info.mk

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

# Uncomment this to change the hardening options
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

# see FEATURE AREAS in dpkg-buildflags(1)
ifneq (,$(findstring amd64,$(DEB_BUILD_ARCH)))
export DEB_BUILD_MAINT_OPTIONS = hardening=+fortify,-stackprotector,+relro,+bindnow,-pie
else
export DEB_BUILD_MAINT_OPTIONS = hardening=+fortify,-stackprotector,+relro,+bindnow,+pie
endif


#VERSION=$(shell dpkg-parsechangelog |grep ^Version:|cut -d ' ' -f 2)
# following is to avoid a lintian warning, but untested
#VERSION=$(shell echo $DEB_VERSION |cut -d ' ' -f 2)

%:
	dh $@ --with autoreconf
#	dh $@ --with dkms

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-distro \
		--enable-pkcs11 \
		--enable-tls13 \
		--enable-base64encode \
		--disable-examples \
		--disable-silent-rules

override_dh_installexamples:
	dh_installexamples --exclude .vcproj --exclude .vcxproj --exclude .sln

#override_dh_dkms:
#	dh_dkms -V $(VERSION)
