#!/usr/bin/make -f

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

# minimise needless linking
LDFLAGS+= -Wl,--as-needed

%:
	dh $@ --parallel --with autoreconf

override_dh_autoreconf:
	dh_autoreconf --as-needed
	intltoolize --copy --force

override_dh_auto_configure:
	dh_auto_configure -- \
			--enable-debug=half \
			--with-userdir=.synfig \
			--libdir=\$${prefix}/lib/synfigstudio

override_dh_auto_build:
	cd images ; \
		ln -s /usr/share/fonts/truetype/freefont/FreeSans.ttf Arial.ttf ; \
		ln -s /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf "Arial Black.ttf" ; \
		ln -s /usr/share/fonts/truetype/freefont/FreeSerif.ttf "Times New Roman.ttf" ; \
		ln -s /usr/share/fonts/truetype/freefont/FreeSans.ttf "Sans Serif.ttf"
	dh_auto_build

override_dh_auto_install:
	dh_auto_install --destdir=$(CURDIR)/debian/tmp
	## W:unknown-locale-code zh-Hant
	$(RM) -rv $(CURDIR)/debian/tmp/usr/share/locale/zh-Hant

override_dh_makeshlibs:
	dh_makeshlibs --noscripts

override_dh_strip:
	dh_strip --dbg-package=synfigstudio-dbg

override_dh_builddeb:
	dh_builddeb -- -Zxz
