#!/usr/bin/make -f

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

%:
	dh $@ --with autoreconf

override_dh_autoreconf:
	NOCONFIGURE=t dh_autoreconf ./autogen.sh

override_dh_auto_configure:
	dh_auto_configure -- \
		--with-pamdir=/lib/$(DEB_HOST_MULTIARCH)/security \
		--libexecdir=/usr/lib/cockpit

override_dh_auto_install:
	dh_auto_install -- install-test-assets
	mkdir -p debian/tmp/etc/pam.d
	install -p -m 644 tools/cockpit.debian.pam debian/tmp/etc/pam.d/cockpit

override_dh_install:
	dh_install --list-missing -Xusr/src/debug

override_dh_fixperms:
	dh_fixperms -Xcockpit-session -Xcockpit-polkit
