#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# This version is for packages that are architecture independent.

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

export DH_COMPAT=4

build: build-stamp
build-stamp:
	dh_testdir

	# Add here commands to compile the package.

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp install-stamp

	# Add here commands to clean up after the build process.

	dh_clean
	rm -rf debian/console-log.conf.5 debian/convert-console-log.conf.8

install: build
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs

	# Add here commands to install the package into debian/$package

	install -D -m 644 debian/console-log.conf debian/console-log/etc/console-log.conf
	install -D -m 755 scripts/logpager debian/console-log/usr/share/console-log/logpager
	install -D -m 755 scripts/convert-console-log.conf debian/console-log/usr/sbin/convert-console-log.conf

	# manpages
	/usr/bin/pod2man --section=5 --release="console-log $(PKG_VER)" --lax \
	--center="Debian GNU/Linux" debian/console-log.conf.pod > debian/console-log.conf.5
	/usr/bin/pod2man --section=8 --release="console-log $(PKG_VER)" --lax \
	--center="Debian GNU/Linux" debian/convert-console-log.conf.pod > debian/convert-console-log.conf.8

	touch install-stamp

# Build architecture-dependent .debs here.
binary-arch: build install
# we have nothing to do here

# Build architecture-dependent .debs here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_install
	dh_installdebconf
	dh_installdocs
	dh_installinit defaults 99
	dh_installexamples
	dh_installmanpages
#	dh_undocumented
	dh_installchangelogs
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

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