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

override_dh_auto_build:
	phpab --output src/Pimple/autoload.php --blacklist 'pimple\\tests\\*'  src/Pimple
	mkdir --parents vendor
	phpab --output vendor/autoload.php --basedir vendor src/Pimple
#	dh_auto_build -O--sourcedirectory=ext/pimple

override_dh_auto_clean:
	rm -rf \
		ext/pimple/build \
		vendor
	dh_auto_clean -O--sourcedirectory=ext/pimple

#override_dh_auto_configure:
#	cd ext/pimple && phpize
#	dh_auto_configure -O--sourcedirectory=ext/pimple

#override_dh_auto_install:
#	dh_auto_install -O--sourcedirectory=ext/pimple -- INSTALL_ROOT=$(CURDIR)/debian/php5-pimple

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
#	NO_INTERACTION=1 dh_auto_test -O--sourcedirectory=ext/pimple
	phpunit
else
	@echo "** tests disabled"
endif
