#!/usr/bin/make -f

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

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		--with-networkmanager-needs-root=yes \
		--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_systemd_enable:
	dh_systemd_enable -p cockpit-ws --name=cockpit cockpit.socket

override_dh_systemd_start:
	dh_systemd_start -p cockpit-ws cockpit.socket
	dh_systemd_start -p cockpit-ws --no-start --restart-after-upgrade cockpit.service

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

override_dh_fixperms:
	dh_fixperms -Xcockpit-session -Xcockpit-polkit
