#!/usr/bin/make -f

#export DH_VERBOSE=1
export PERL_USE_UNSAFE_INC=1

configure: config-stamp
config-stamp:
	perl config.pl --prefix=/usr --mandir=/usr/share/man
	touch $@

build: build-indep build-arch

build-indep: configure
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	make test
endif

build-arch:

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	make install DESTDIR=$(CURDIR)/debian/makepp GZIP="-9n"

binary: binary-indep binary-arch

binary-indep: install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installchangelogs ChangeLog

	dh_link usr/share/makepp/html usr/share/doc/makepp/html

	dh_compress
	dh_fixperms
	dh_perl
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch:

clean:
	dh_testdir
	dh_testroot

	-test -f Makefile && make clean

	dh_clean

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