#!/usr/bin/make -f

package=bed


build: buildonce

buildonce:
	dh_testdir
	$(MAKE) linuxconfig
	$(MAKE) dep
	$(MAKE)
	touch buildonce

clean:
	dh_testdir
	dh_clean
	-rm -f buildonce
	$(MAKE) realclean
	-rm -rf debian/tmp debian/*~ debian/files* debian/substvars

install: buildonce
	dh_clean
	dh_installdirs
	$(MAKE) install ROOTDIR=`pwd`/debian/tmp/

binary-arch:  install
	 $(MAKE) control
	 install -d debian/tmp/DEBIAN/	
	 dpkg-shlibdeps src/bed 
	 dpkg-gencontrol -isp
	 install -m 755  debian/postinst   debian/tmp/DEBIAN
	 dh_builddeb
	 
#	 dpkg --build debian/tmp ..

binary-indep:

binary: binary-arch

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

