#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
  
# This is the debhelper compatability version to use.
export DH_COMPAT=1

package=dpkg-search

build:
	dh_testdir
	make
	touch build

clean:
	dh_testdir
	dh_clean
	make clean
	-rm -rf *~ debian/tmp debian/*~ debian/files* build

install:
	dh_testdir
	dh_testroot
	dh_installdirs
	for file in bin/dpkg-make-index bin/dpkg-break bin/dpkg-iaquery bin/dpkg2folder ; do \
	install -m 755 $$file debian/tmp/usr/bin ; done
#	install -m 755 bin/dpkg-make-index bin/dpkg-break bin/dpkg-iaquery bin/dpkg2folder debian/tmp/usr/bin

binary-indep: checkroot build
	$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch: checkroot build install
	dh_testdir
	dh_testroot
	dh_installdebconf
	dh_installdocs debian/README* debian/TODO*
	dh_installmenu
	dh_installman dpkg-iasearch.1
	cd debian/tmp/usr/share/man/man1/ && {  \
	for file in dpkg-iaquery dpkg-make-index dpkg-break dpkg2folder ; do \
	ln -s dpkg-iasearch.1 $$file.1 ; done }
	dh_installchangelogs
	dh_compress
	dh_fixperms
	dh_shlibdeps
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

define checkdir
	test -f debian/rules
endef

# Below here is fairly generic really

binary: binary-indep binary-arch

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

checkroot:
	$(checkdir)
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep clean checkroot

#Local variables:
#mode: makefile
#End:

