#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Use hardening options to build the package
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --with autoreconf

# Rename the binary xml -> xmlstarlet
# Since /bin -> /usr/bin at Dyson, configure thinks
# that libxm2 prefix is /. Wrong!
override_dh_auto_configure:
	dh_auto_configure -- \
		--program-transform-name=s/xml$$/xmlstarlet/ \
		--enable-build-docs \
		--with-libxslt-prefix=/usr \
		--with-libxml-prefix=/usr

override_dh_fixperms:
	dh_fixperms
	chmod 644 $(CURDIR)/debian/xmlstarlet/usr/share/doc/xmlstarlet/examples/xml/xmlstarlet-xsa.xml

override_dh_installexamples:
	dh_installexamples --exclude=log --exclude=trs examples/*
