#!/usr/bin/make -f
# Made by hand with the aid of another Makefile made with dh_make...
# I actually learned afterwards that dh_make could do my job but
# it was too late ;o)

#package=libtlp-perl

ifndef PERL
PERL=/usr/bin/perl
endif

build: build-stamp
build-stamp:
	dh_testdir

	# Add here commands to compile the package.
	$(PERL) Makefile.PL INSTALLDIRS=perl
	$(MAKE) CFLAGS="-O2 -g -Wall"
	touch build-stamp

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

	# Add here commands to clean up after the build process.
	-$(MAKE) clean
	-rm -f `find . -name "*~"`
	-rm -f Makefile.old
	dh_clean
#	-rm -rf debian/tmp debian/files* core debian/substvars

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.
	$(MAKE) install PREFIX=`pwd`/debian/tmp/usr \
	                INSTALLMAN1DIR=`pwd`/debian/tmp/usr/share/man/man1 \
	                INSTALLMAN3DIR=`pwd`/debian/tmp/usr/share/man/man3
	# remove unwanted files
	-rm -f debian/tmp/usr/lib/perl5/5.005/i386-linux/perllocal.pod
	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_perl
	dh_installdocs
	dh_installdeb
	dh_installmanpages
	dh_installchangelogs
	dh_strip
	dh_compress
	dh_installexamples
	dh_fixperms
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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

