#!/usr/bin/make -f

# DH_VERBOSE := 1

# some helpful variables
# shamelessly stolen from http://jmtd.net/log/awk/
# DEBVERS        := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
# VERSION        := $(shell echo '$(DEBVERS)' | sed -e 's/^[0-9]*://' -e 's/-.*//')
# DEBFLAVOR      := $(shell dpkg-parsechangelog | awk '/^Distribution:/ {print $$2}')
DEBPKGNAME     := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
# DEBIAN_BRANCH  := $(shell awk 'BEGIN{FS="[= ]+"} /debian-branch/ {print $$2}' debian/gbp.conf)
# GIT_TAG        := $(subst ~,_,$(VERSION))

# Location of the example files, will be converted to the
# probabel-examples package
DEBEXAMPLES:=$(DEBPKGNAME)-examples


# alternatively to manually set those variables you can
#  include /usr/share/cdbs/1/rules/buildvars.mk
# and use what is set there.  Any hint whether dh might set variables in
# a similar manner are welcome.

%:
	dh $@  --parallel --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --disable-silent-rules

override_dh_installdocs-indep:
	dh_installdocs -i

override_dh_installdocs-arch:
	dh_installdocs -a
	rm debian/$(DEBPKGNAME)/usr/share/doc/$(DEBPKGNAME)/COPYING
	rm debian/$(DEBPKGNAME)/usr/share/doc/$(DEBPKGNAME)/INSTALL
	rm debian/$(DEBPKGNAME)/usr/share/doc/$(DEBPKGNAME)/LICENSE
	rm debian/$(DEBPKGNAME)/usr/share/doc/$(DEBPKGNAME)/ChangeLog

override_dh_installchangelogs:
	dh_installchangelogs doc/ChangeLog

override_dh_install-arch:
	dh_install -a --fail-missing
	rm debian/$(DEBPKGNAME)/usr/bin/probabel.pl
