#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# Fail on undefined symbols in the module
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-z,defs

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

SECDIR = /lib/$(DEB_HOST_MULTIARCH)/security

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		--with-pam-mods-dir=$(SECDIR) \
		--with-openssl

execute_after_dh_auto_install:
	rm debian/libpam-mysql/$(SECDIR)/pam_mysql.la

execute_after_dh_fixperms:
	chmod 640 debian/libpam-mysql/etc/pam-mysql.conf
