#!/usr/bin/make -f

# rules for debsums

version=$(shell dpkg-parsechangelog | sed -n 's/^Version: *//p')
package=debsums
tmp=debian/$(package)

export DH_COMPAT = 3

build: # nothing
clean:
	dh_testdir
	dh_testroot
	dh_clean
	debconf-updatepo

binary-arch: # nothing
binary-indep:
	dh_testdir
	dh_testroot
	dh_clean -k

	mkdir -p $(tmp)/usr/bin $(tmp)/usr/sbin
	sed 's/#VERSION#/$(version)/' debsums.in >$(tmp)/usr/bin/debsums
	cp debsums_gen $(tmp)/usr/sbin
	chmod 755 $(tmp)/usr/bin/debsums $(tmp)/usr/sbin/debsums_gen

	dh_installdocs README
	dh_installman debsums*.1 debsums_gen*.8
	dh_installchangelogs
	dh_installdebconf
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary:	binary-indep binary-arch

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