#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk
include /usr/share/cdbs/1/rules/utils.mk

# List any files which are not installed
include /usr/share/cdbs/1/rules/utils.mk
common-binary-post-install-arch:: list-missing

ifneq ($(findstring $(DEB_BUILD_ARCH), i386 amd64),)
MACBOOK_SUPPORT = --with-macbookpro --with-macbook
endif

DEB_CONFIGURE_EXTRA_FLAGS := --enable-hotplug-map  \
                             --with-pid-file=/var/run/hald/hald.pid \
                             --enable-pcmcia-support \
                             --with-hwdata=/usr/share/misc \
                             $(MACBOOK_SUPPORT) \
                             --enable-policy-kit \
                             --enable-console-kit \
			     --enable-acl-management \
                             --enable-umount-helper \
                             --enable-docbook-docs \
                             --docdir=/usr/share/doc/hal-doc \
                             --with-udev-prefix=/lib

DEB_DH_INSTALLINIT_ARGS := -- start 24 2 3 4 5 . stop 16 1 .

install/hal::
	# Remove executable bit as this is nothing that can be executed
	chmod -x $(DEB_DESTDIR)/usr/lib/hal/scripts/hal-functions
	# install the callout script
	install debian/debian-setup-keyboard $(DEB_DESTDIR)/usr/lib/hal
