#!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+all PKG:=$(shell dh_listpackages) TMP:=$(CURDIR)/debian/$(PKG) EG:=$(TMP)/usr/share/doc/$(PKG)/examples XE_FILES:=$(wildcard /usr/share/libxml-encoding-perl/*.xml) ENC_FILES:=$(wildcard debian/encodings/*.enc) SKIP_TESTS = $(shell cat debian/tests/pkg-perl/smoke-skip) TEST_FILES = $(filter-out $(SKIP_TESTS), $(wildcard t/*.t)) include /usr/share/dpkg/architecture.mk PERLVER := $(shell perl -MConfig -e 'print $$Config{version}') ARCHLIB := $(shell perl -I/usr/lib/$(DEB_HOST_MULTIARCH)/perl/cross-config-$(PERLVER) -MConfig -e 'print $$Config{vendorarch}') %: dh $@ # we want to use the system version of included modules, so # we move the inc away and move it back afterwards override_dh_auto_clean: dh_auto_clean [ ! -d $(CURDIR)/inc.save ] || mv $(CURDIR)/inc.save $(CURDIR)/inc override_dh_auto_configure: [ ! -d $(CURDIR)/inc ] || mv $(CURDIR)/inc $(CURDIR)/inc.save dh_auto_configure override_dh_installexamples: dh_installexamples sed -i -e'1s|/usr/local/bin/perl|/usr/bin/perl|' $(EG)/canonical $(EG)/xmlcomments $(EG)/xmlstats $(EG)/xmlfilter override_dh_compress: dh_compress -Xxmlfiltera override_dh_auto_build: dh_auto_build $(foreach f,$(ENC_FILES),rm -f blib/lib/XML/Parser/Encodings/$(basename $(notdir $(f))).enc;) $(foreach f,$(ENC_FILES),cp $f blib/lib/XML/Parser/Encodings/;) override_dh_auto_install: dh_auto_install $(RM) -v $(TMP)/$(ARCHLIB)/XML/Parser/Encodings/README override_dh_auto_test: dh_auto_test -- TEST_FILES="$(TEST_FILES)" make_encodings: /usr/share/libxml-encoding-perl rm -rf debian/encodings/* $(foreach f,$(XE_FILES),compile_encoding -o debian/encodings/$(basename $(notdir $(f))).enc $f;) /usr/share/libxml-encoding-perl: @echo Please install libxml-encoding-perl exit 1