#!/usr/bin/make -f

%:
	dh $@ --parallel

override_dh_auto_configure:
	dh_auto_configure -- --disable-rpath  $(shell dpkg-buildflags --export=configure)

override_dh_clean:
	dh_clean
	rm -rf doc/html

override_dh_strip:
	dh_strip -a --dbg-package=libexiv2-dbg

override_dh_install:
	[ ! -f Makefile ] || $(MAKE) doc
	dh_install --list-missing
	find $(CURDIR)/debian -type f -name exiv2 | xargs /usr/bin/chrpath -d
	# Drop content of dependency_libs to avoid having to recompile exiv2
	# if the path of the libs that appear there changes
	for file in $(CURDIR)/debian/libexiv2-dev/usr/lib/*.la; do \
		sed -i "/dependency_libs/ s/'.*'/''/" $$file ; \
	done

override_dh_installdocs:
	dh_installdocs -A -Xcmd.txt -XMakefile -Xtemplates -XChangeLog

override_dh_installchangelogs:
	dh_installchangelogs -A doc/ChangeLog

override_dh_compress:
	dh_compress -X.xls -X.js -X.idx -X.xml -X.php

get-orig-source:
	uscan --force-download
