#! /usr/bin/make -f

#export DH_VERBOSE=1
#export DEB_BUILD_OPTIONS="nostrip"

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

override_dh_auto_configure:
	dh_auto_configure -- \
		--with-rootprefix= \
		--with-rootlibdir=/lib/$(DEB_HOST_MULTIARCH) \
		--with-udevrulesdir=/lib/udev/rules.d \
		--enable-gtk \
		--enable-libcryptsetup \
		--enable-tcpwrap \
		--enable-selinux \
                --disable-coredump \
		--with-distro=debian

override_dh_auto_clean:
	dh_auto_clean
	rm -f man/*.[1358]
	rm -f src/systemadm.c
	rm -f src/gnome-ask-password-agent.c
	rm -f src/systemd-interfaces.c

override_dh_install:
	rm debian/tmp/usr/share/doc/systemd/LICENSE
	rm debian/tmp/lib/systemd/system/sysinit.target.wants/systemd-vconsole-setup.service
	find debian/tmp/ -name '*.la' -delete
	chmod +x debian/debian-fixup
	dh_install -O--parallel --fail-missing
	dh_install -plibpam-systemd debian/pam-configs /usr/share

autoreconf:
	intltoolize -f -c
	autoreconf -f -i

override_dh_autoreconf:
	dh_autoreconf debian/rules -- autoreconf

%:
	dh $@ --with autoreconf
