#!/usr/bin/make -f
# -*- makefile -*-
#
#  # Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+lto

# Enable Wall and Wextra to spot basic irregularities.
export DEB_CFLAGS_MAINT_APPEND = -Wall -Wextra

# Build newrole executable with the audit and namespace support
export LSPP_PRIV=y

# Install all binaries into /usr
export SBINDIR=/usr/sbin

%:
	dh $@

override_dh_auto_install:
	dh_auto_install --destdir=debian/tmp

override_dh_installinit:
	dh_installinit -ppolicycoreutils --no-start --name=selinux-autorelabel

override_dh_installsystemd:
	dh_installsystemd -ppolicycoreutils --no-start --no-restart-after-upgrade --name=selinux-autorelabel
# selinux-autorelabel-mark.service functionality is included in the LSB
# selinux-autorelabel script, that's why there is no conterpart in the LSB
# world
	dh_installsystemd -ppolicycoreutils --no-start --no-restart-after-upgrade --name=selinux-autorelabel-mark

override_dh_installpam:
	dh_installpam -pnewrole --name=newrole
	dh_installpam -pnewrole --name=run_init
