#!/usr/bin/make -f

SRCDIR=$(CURDIR)
include /usr/share/postgresql-common/pgxs_debian_control.mk
.PHONY: debian/control

build build-arch: build-stamp
build-stamp:
	dh_testdir
	+pg_buildext build $(CURDIR) build-%v
	touch $@

build-indep:

clean: debian/control
	dh_testdir
	dh_testroot
	rm -rf build-stamp build-?.?
	rm -rf debian/postgresql-*-plsh/ debian/*.substvars
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	+pg_buildext install $(CURDIR) build-%v postgresql-%v-plsh

binary binary-arch: install
	dh_testdir
	dh_testroot
	dh_installchangelogs -a
	dh_installdocs -a --all README.md
	dh_install -a
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary-indep:

.PHONY: build build-arch build-indep clean binary binary-arch binary-indep
