#!/usr/bin/make -f
%:
	dh $@ --buildsystem=phppear --with phppear 

override_dh_auto_clean:
	rm -rf Autoload-*/build
	dh_auto_clean -O--buildsystem=phppear

override_dh_auto_configure:
	dh_auto_configure -O--buildsystem=phppear
	sed -i '/ role="doc" /d' */package.xml

override_dh_auto_install:
	dh_auto_install -O--buildsystem=phppear
	cd debian/phpab/usr/share/php && \
		../../bin/phpab \
		--output TheSeer/Autoload/autoload.php \
		TheSeer/Autoload

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	cd Autoload-*/ && phpunit 
else
	@echo "** tests disabled"
endif

override_dh_installman:
	mkdir $(CURDIR)/debian/tmp
	cd debian/phpab/usr/share/php && \
        help2man --no-info --no-discard-stderr \
        --name='PHPAB command line interface' \
        ../../bin/phpab \
        > $(CURDIR)/debian/tmp/phpab.1
	dh_installman

override_dh_installchangelogs:
	dh_installchangelogs -k Autoload-*/README.md
