#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

include /usr/share/dpkg/architecture.mk

ifeq ($(DEB_BUILD_ARCH_OS),hurd)
export DEB_CXXFLAGS_MAINT_APPEND += -lpthread
endif

%:
	dh $@

execute_after_dh_auto_install:
	@echo "Clearing .la files dependency_libs fields per Debian policy"
	sed --in-place "/dependency_libs/ s/'.*'/''/" $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pstoedit/*.la
	@echo "Clear rpath in GUI executable; remove if build system starts doing this itself."
	-chrpath --delete debian/tmp/usr/bin/PstoeditQtGui

execute_after_dh_installexamples:
	@echo "Upstream tarball has +x set on non-executable files, need to clear if installed."
	chmod --verbose a-x debian/pstoedit/usr/share/doc/pstoedit/examples/*.ps

override_dh_installchangelogs:
	dh_installchangelogs doc/changelog.htm

override_dh_compress:
	dh_compress --exclude=.ps --exclude=.pdf
