#!/usr/bin/make -f

PGVERSIONS = $(shell pg_buildext supported-versions)

%:
	dh $@ --with pgxs

override_dh_auto_clean:

override_dh_auto_configure:
	set -eux; \
	for v in $(PGVERSIONS); do \
		echo "### PostgreSQL $$v cmake ###"; \
		cmake -B build-$$v -DPostgreSQL_CONFIG=/usr/lib/postgresql/$$v/bin/pg_config; \
		echo "### End $$v cmake ###"; \
	done

override_dh_installdocs:
	dh_installdocs --all README.*

override_dh_pgxs_test:
	# defer testing to autopkgtest
	# testsuite creates its own PG instance and doesn't use extension_destdir (yet?)
