#!/usr/bin/make -f
%:
	dh $@ --with phpcomposer

override_dh_install:
	dh_install
	install -D -m 0755 bin/zf.sh debian/zendframework-bin/usr/bin/zf

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	# The following symlinks can’t be handled by dpkg’s own implementation of quilt
	ln -s /usr/share/fonts/truetype/ttf-bitstream-vera tests/Zend/Barcode/Object/_fonts
	ln -s /usr/share/fonts/truetype/ttf-bitstream-vera tests/Zend/Pdf/_fonts
	cd tests && ./runtests.sh
else
	@echo "** tests disabled"
endif

override_dh_clean:
	rm -rf tests/Zend/Filter/_files/home
	dh_clean -X.orig

override_dh_fixperms:
	dh_fixperms
	find debian/zendframework/usr/share/php/Zend -type f -executable | xargs chmod 0644

get-orig-source:
	uscan --verbose --rename --force
