#!/usr/bin/make -f
# debian/rules for alien

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

# Use v4 compatability mode, so ldconfig gets added to maint scripts.
export DH_COMPAT=4

PACKAGE=$(shell dh_listpackages)

build:
	dh_testdir

clean:
	dh_testdir
	dh_testroot
	dh_clean -d

binary-indep: build

binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean -k -d
	dh_installdirs

	dh_installdocs
	dh_installchangelogs

# Copy the packages's files.
	mkdir -p debian/tmp
	tar cpf - $$(find . -mindepth 1 -not -wholename \*debian\* -print) | (cd debian/tmp; tar xfvp - )
	find ./debian/tmp/etc -type f -and -not -name \*,v -and -not -name uniklu-config -and -not -name \*sss -and -not -name \*account.unixds -and -not -name \*session.unixds -exec mv {} {}.uniklu \;

#
# If you need to move files around in debian/$(PACKAGE) or do some
# binary patching, do it here
#

	dh_install --sourcedir=debian

# This has been known to break on some wacky binaries.
#	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
