#!/usr/bin/make -f

PACKAGE=$(shell dh_listpackages)

ifndef PERL
PERL = /usr/bin/perl
endif

%:
	dh "$@"

override_dh_auto_configure:
	$(PERL) Makefile.PL INSTALLDIRS=vendor

override_dh_auto_build:
	$(MAKE) OPTIMIZE="$(CFLAGS) $(CPPFLAGS)" LD_RUN_PATH=""

override_dh_auto_clean:
	dh_clean
	rm -rf blib config.h config.log config.pl config.status gailookup.pl pm_to_blib MYMETA.yml Socket6.bs Socket6.c *.o
	dh_auto_clean

override_dh_auto_install:
	$(MAKE) install DESTDIR=$(CURDIR)/debian/$(PACKAGE)

override_dh_installdocs:
	dh_installdocs README

override_dh_installexamples:
	dh_installexamples im-140.diff ftpmirror-1.96.diff
