#!/usr/bin/make -f

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

# This has to be exported to make some magic below work.
export DH_OPTIONS

PHPCONFIG=/usr/bin/php-config
EXT_DIR=$(shell $(PHPCONFIG) --extension-dir)
phpapiver=$(shell $(PHPCONFIG) --phpapi)

%:
	dh $@ --with php5

override_dh_auto_configure:
	phpize
	dh_auto_configure -- --with-php-config=$(PHPCONFIG) --enable-json --with-libjson=/usr

override_dh_gencontrol:
	dh_gencontrol -- -V"php:Depends=phpapi-$(phpapiver)"

override_dh_auto_install:
	dh_auto_install -- INSTALL_ROOT=$(CURDIR)/debian/tmp
