#!/usr/bin/make -f

export DH_COMPAT=4

tmp := debian/dupload

build: build-stamp
build-stamp:
	dh_testdir
	$(MAKE) prefix=/usr
	touch $@

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

binary: binary-indep binary-arch

binary-arch:
# do nothing here

binary-indep: DH_OPTIONS=-i
binary-indep: build
	dh_testdir
	dh_testroot
	dh_clean -k
	$(MAKE) prefix=$(tmp)/usr mandir=$(tmp)/usr/share/man install
	dh_installdirs etc
	install -m644 dupload.conf $(tmp)/etc
# Link for the old name of dupload.conf.5
	ln -s dupload.conf.5.gz $(tmp)/usr/share/man/man5/dupload.5.gz
	dh_installdocs CREDITS TODO
	dh_installchangelogs
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_builddeb

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