#!/usr/bin/make -f

PACKAGE = $(shell dh_listpackages)
TMP     = $(CURDIR)/debian/$(PACKAGE)

%:
	dh $@

override_dh_auto_configure:
	# Build.PL regenerates the (unused) Maekfile.PL
	[ ! -f $(CURDIR)/Makefile.PL ] || cp $(CURDIR)/Makefile.PL $(CURDIR)/Makefile.PL.sav
	dh_auto_configure
	[ ! -f $(CURDIR)/Makefile.PL.sav ] || mv $(CURDIR)/Makefile.PL.sav $(CURDIR)/Makefile.PL

override_dh_installexamples:
	dh_installexamples
	sed -i '1s|^#!perl|#!/usr/bin/perl|' $(TMP)/usr/share/doc/$(PACKAGE)/examples/*
