#!/usr/bin/make -f

PACKAGENAME=clean-device

config.status:
	dh_testdir
	autoreconf -s -i -m > /dev/null
	./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/sbin

build: build-stamp

build-stamp: config.status
	dh_testdir
	$(MAKE)
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -rf *stamp
	[ ! -f Makefile ] || $(MAKE) maintainer-clean
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k

	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp

binary-arch: build install

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_install --sourcedir=$(CURDIR)/debian/tmp
	dh_link
#	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	maemo-optify
	dh_md5sums
	sed -e "s:/.*.sh::" -e "/^$$/d" -i debian/clean-device/DEBIAN/conffiles
	dh_builddeb
	aegis-deb-add -control debian/clean-device/DEBIAN/control .. debian/clean-device.aegis=_aegis

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install 
