#!/usr/bin/make -f

# Fix C++ linking on 9.5/9.6
export PG_CXXFLAGS = -fPIC

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

override_dh_auto_build:
	$(MAKE) -C doc

override_dh_auto_clean:
	dh_auto_clean
	rm -rf results/
	$(MAKE) -C doc clean

override_dh_auto_test:

override_dh_auto_install:
	+pg_buildext loop postgresql-%v-pgsphere
	# remove duplicate files from unwanted location
	rm -rv debian/postgresql-*-pgsphere/usr/share/doc/postgresql-doc-*

override_dh_installdocs:
	dh_installdocs --all doc/html/

%:
	dh $@
