#!/usr/bin/make -f
# derived from debian/rules from packages doc-debian, itself
# derived from sample debian/rules file for GNU hello by Ian Jackson.


tmp = $(shell pwd)/debian/tmp
dh_docdir=usr/share/doc/newbiedoc
dh_bindir=usr/bin
html_dir=newbiedoc-html
ps_dir=newbiedoc-ps

build: stamp-build
stamp-build:
	test  -f debian/rules
	$(MAKE)
	touch $@

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

refresh:
	# one day, maybe...
	#
	#cd doc && wget -N -R "*keyring*" -R "*INDEX*" \
	#  ftp://ftp.debian.org/debian/doc/*
	#chmod 644 doc/*

binary: binary-indep binary-arch

binary-arch:


binary-indep: build
	dh_testdir $(html_dir) $(ps_dir) 
	dh_testroot

	rm -rf $(tmp)

	dh_installdirs $(dh_docdir) $(dh_docdir)/$(html_dir)   $(dh_docdir)/$(ps_dir)  $(dh_bindir)
	# any dh_something here ?
	cp -R $(html_dir)/* $(tmp)/$(dh_docdir)/$(html_dir)
	cp -R $(ps_dir)/* $(tmp)/$(dh_docdir)/$(ps_dir)
	cp newbiedoc $(tmp)/$(dh_bindir)/newbiedoc
	dh_fixperms
	dh_installchangelogs
	dh_installdocs
	dh_installmenu
	dh_installman newbiedoc.1.gz
	dh_installdeb
	dh_fixperms
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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