#!/usr/bin/make -f
#-*- makefile -*-
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Christoph Lameter.

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
b=$(shell pwd)/debian/tmp

build: build-stamp
build-stamp:
	dh_testdir
	# Add here commands to compile the package.
	pod2man disc-cover disc-cover.1
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp install-stamp disc-cover-stamp libfreedb-perl-stamp
	# Add here commands to clean up after the build process.
	dh_clean
	-rm debian/substvars disc-cover.1

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/tmp.
	touch install-stamp

disc-cover-stamp:
disc-cover: disc-cover-stamp
	install -g root -o root -d $(b)/usr/bin
	install -m 755 -g root -o root disc-cover $(b)/usr/bin

	install -g root -o root -d $(b)/etc
	install -m 644 -g root -o root `pwd`/debian/disc-cover.conf \
		$(b)/etc

	install -g root -o root -d $(b)/usr/share/man/man1
	install -m 644 -g root -o root `pwd`/disc-cover.1 \
		$(b)/usr/share/man/man1

	dh_testdir           -p$@ -P$(b)/$@
	dh_testroot          -p$@ -P$(b)/$@
	dh_installchangelogs -p$@ -P$(b)/$@ CHANGELOG
	dh_installdocs       -p$@ -P$(b)/$@ --exclude=INSTALL --exclude=README --exclude=THANKS
	dh_movefiles         -p$@ -P$(b)/$@
	dh_link              -p$@ -P$(b)/$@
	dh_compress          -p$@ -P$(b)/$@
	dh_fixperms          -p$@ -P$(b)/$@
	dh_installdeb        -p$@ -P$(b)/$@
	dh_perl              -p$@ -P$(b)/$@
	dh_gencontrol        -p$@ -P$(b)/$@
	dh_md5sums           -p$@ -P$(b)/$@
	dh_builddeb          -p$@ -P$(b)/$@
	touch disc-cover-stamp

# Build architecture-independent files here.
binary-indep: build install disc-cover

# Build architecture-dependent files here.
binary-arch: build install

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
