#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

config.status:
	dh_autotools-dev_updateconfig
	dh_testdir
	# Add here commands to configure the package.
	if [ ! -e Makefile.orig ]; then mv -v Makefile Makefile.orig; fi
	dh_auto_configure

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp

build-stamp:  config.status
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE)

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	dh_autotools-dev_restoreconfig

	# Add here commands to clean up after the build process.
	-$(MAKE) mrproper
	if [ -e Makefile.orig ]; then mv -v Makefile.orig Makefile; fi

	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	# Add here commands to install the package into debian/pconsole.
	dh_auto_install -- prefix=$(CURDIR)/debian/tmp/usr

# Build architecture-independent files here.
debian/po/templates.pot: debian/templates
	debconf-updatepo

build-indep: build-indep-stamp
build-indep-stamp: debian/po/templates.pot
	touch build-indep-stamp

binary-indep: binary-indep-stamp
binary-indep-stamp: build-indep 
	touch binary-indep-stamp

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog README.pconsole
	dh_installdocs
	dh_installexamples
	dh_install
	dh_installmenu
	dh_installdebconf	
	dh_installman debian/pconsole.1
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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