#!/usr/bin/make -f
#export DH_VERBOSE=1

TMP=$(shell pwd)/debian/autodia
PERL=/usr/bin/perl

%:
	dh $@

override_dh_auto_configure:
	# nothing: prevent wrong config run

override_dh_auto_build:
	$(PERL) Makefile.PL INSTALLDIRS=vendor
	$(MAKE) OPTIMIZE="-O2 -g -Wall"

override_dh_auto_install:
	dh_auto_install
	for i in `find $(TMP) -type f` ; do sed -i -e 's/autodia.pl/autodia/' $$i ; done
	mv $(TMP)/usr/bin/autodia.pl $(TMP)/usr/bin/autodia
	mv $(TMP)/usr/share/man/man1/autodia.pl.1p $(TMP)/usr/share/man/man1/autodia.1p
