#!/usr/bin/make -f
# debian/rules for mercurial-buildpackage.

PACKAGE := $(shell dpkg-parsechangelog | head -1 | cut -c9-)
VERSION := $(shell dpkg-parsechangelog | head -2 | tail -1 | cut -c10-)

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	$(MAKE) clean
	dh_clean 

build-stamp:
	dh_testdir
	$(MAKE)
	touch $@

build: build-stamp

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	$(MAKE) install DESTDIR=$(CURDIR)/debian/$(PACKAGE)

binary-indep: build install

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs README.txt
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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