#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/dpkg/pkg-info.mk

deb_systemdsystemunitdir = $(shell pkg-config --variable=systemdsystemunitdir systemd)
deb_udevdir = $(shell pkg-config --variable=udevdir udev)

DESTDIR=$(CURDIR)/debian/laptop-mode-tools
INSTALL=install -o root -g root

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure
	cp etc/init.d/laptop-mode debian/laptop-mode-tools.laptop-mode.init

override_dh_auto_install:
	DESTDIR=$(DESTDIR) INSTALL=install MAN_D=/usr/share/man LIB_D=/usr/lib ./install.sh

override_dh_installchangelogs:
	dh_installchangelogs Documentation/revision-history.txt

override_dh_installinit:
	dh_installinit --name laptop-mode -- defaults 99

override_dh_installmenu:
	# This file was not installed in old debhelper code
	# The menu file provided contains the wrong path (/usr/bin instead of /usr/sbin)
	# Not sure whether it is really worth adding a dependency from gksu or PolicyKit.
	echo "Do not install debian/menu"
