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

override_dh_auto_build:
	phpab \
		--output lib/Doctrine/DBAL/autoload.php \
		--template debian/autoload.php.tpl \
		lib/Doctrine/DBAL

override_dh_installman:
	mkdir $(CURDIR)/debian/tmp
	cd $(CURDIR)/lib && \
		help2man --help-option=\  --no-info \
		--name='Doctrine command line interface' \
		"php $(CURDIR)/bin/doctrine-dbal" \
		> $(CURDIR)/debian/tmp/doctrine-dbal.1
	dh_installman

override_dh_fixperms:
	dh_fixperms
	chmod -x $(CURDIR)/debian/php-doctrine-dbal/usr/bin/doctrine*.php \
		$(CURDIR)/debian/php-doctrine-dbal/usr/share/php/Doctrine/DBAL/Types/JsonArrayType.php \
		$(CURDIR)/debian/php-doctrine-dbal/usr/share/php/Doctrine/DBAL/Types/SimpleArrayType.php

override_dh_installchangelogs:
	dh_installchangelogs debian/upstream/changelog

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