#!/usr/bin/make -f

#export DH_VERBOSE=1

DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
ifeq ($(DEB_HOST_ARCH),i386)
dmidecode-depends := -V'dmidecode-depends=dmidecode' -V'dmidecode-udeb-depends=dmidecode-udeb'
endif

ifeq ($(DEB_HOST_ARCH),amd64)
dmidecode-depends := -V'dmidecode-depends=dmidecode' -V'dmidecode-udeb-depends=dmidecode-udeb'
endif

clean:
	dh_testdir
	dh_clean

build:

install:
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	install -m 755 laptop-detect.sh debian/laptop-detect/usr/sbin/laptop-detect
	install -m 755 laptop-detect.sh debian/laptop-detect-udeb/usr/sbin/laptop-detect

	dh_installman laptop-detect.8

binary-indep: 

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installchangelogs
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol -- $(dmidecode-depends)
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
