#!/usr/bin/make -f

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

CFLAGS = -Wall -g
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
    CFLAGS += -O0
else
    CFLAGS += -O2
endif

%:
	dh $@

override_dh_auto_build:
	dh_auto_build -- OPTIMIZE="$(CFLAGS)"

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