#!/usr/bin/make -f
# -*- makefile -*-

# 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

TARGET = $(CURDIR)/debian/pgmemcache-%v

include /usr/share/postgresql-common/pgxs_debian_control.mk

override_dh_auto_clean: debian/control
	+pg_buildext clean $(TARGET)
	dh_clean
	rm -rf results regression.*

override_dh_auto_build:
	+pg_buildext build $(TARGET) "$(CFLAGS)"
	# create results dir now so we can remove it later when the tests were run as root
	mkdir results

override_dh_auto_install:
	+pg_buildext install $(TARGET) postgresql-%v-pgmemcache

override_dh_installchangelogs:
	dh_installchangelogs NEWS

override_dh_installdocs:
	dh_installdocs --all README

%:
	dh $@

.PHONY: debian/control
