#!/usr/bin/make -f
#export DH_VERBOSE = 1


export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
export DEB_LDFLAGS_MAINT_APPEND =


%:
	dh $@

build-indep:
	# pass

override_dh_autoreconf:
	dh_autoreconf autoreconf -- -f -i -Ipatches

override_dh_auto_configure:
	dh_auto_configure -- \
		--with-fontdir=/non-existent \
		--with-gsfontdir=/usr/share/fonts/type1/urw-base35 \
		--with-sysfontmap=/non-existent \
		--with-gsfontmap=/var/lib/ghostscript/fonts/Fontmap \
		--with-xtrafontmap=/etc/libwmf.fontmap

execute_after_dh_install-arch:
	mkdir -p debian/libwmf-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libwmf/bin/
	# tmp
	cp debian/libwmf-dev/usr/bin/libwmf-config debian/libwmf-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libwmf/bin/
	#rmdir debian/libwmf-dev/usr/bin/
	ln -s libwmf-0.2.so.7 debian/libwmf-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libwmf-0.2.so
	ln -s libwmflite-0.2.so.7 debian/libwmf-dev/usr/lib/$(DEB_HOST_MULTIARCH)/libwmflite-0.2.so

execute_after_dh_installdocs-indep:
	rm debian/libwmf-doc/usr/share/doc/libwmf-dev/doc/Makefile* \
		debian/libwmf-doc/usr/share/doc/libwmf-dev/doc/*/Makefile* \
		debian/libwmf-doc/usr/share/doc/libwmf-dev/doc/*/*/Makefile*
