#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1


build:
#empty

clean:
	dh_testdir
	dh_testroot
	rm -rf *stamp debian/files debian/manpages-tr
	rm -rf debian/manpages-tr.substvars debian/.debhelper
	rm -rf tr/*
	dh_clean

binary-arch: build

binary-indep: build
	$(MAKE) deb-build
	dh_testdir
	dh_testroot
	dh_installdirs
	$(MAKE) deb-install DESTDIR=$(CURDIR)/debian/manpages-tr
	dh_installdirs -A /usr/share/man
	grep -v '^#' debian/manpages-tr.prune | while read exists crap;	do \
		exists=`echo "$$exists" | \
		        sed -e 's,usr/share/man/tr\.[^/]\+,usr/share/man/tr,'`;\
		test -f `pwd`/debian/manpages-tr/"$$exists" || \
		test -L `pwd`/debian/manpages-tr/"$$exists" && \
		rm -f `pwd`/debian/manpages-tr/"$$exists" || true; \
	done
	dh_install --sourcedir=debian/manpages-tr
	dh_installdocs
	dh_installchangelogs
	dh_compress
	dh_fixperms
	dh_link
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean update-prune
