#!/usr/bin/make -f

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

PG_CONFIG = /usr/lib/postgresql/18/bin/pg_config

%:
	dh $@ --buildsystem=meson

override_dh_builddeb:
	dh_builddeb -- -Zgzip

override_dh_auto_clean:
	rm -rf build

override_dh_auto_configure:
	export PATH="$$(python3 -m site --user-base)/bin:$$PATH"; \
	dh_auto_configure -- -Dpg_config=$(PG_CONFIG)

override_dh_auto_install:
	dh_auto_install
	mkdir -p $(CURDIR)/debian/tmp/usr/lib/postgresql/18/lib/pgxs/src/test/perl/PostgreSQL/Test
	install -m 644 ci_scripts/perl/PostgreSQL/Test/TdeCluster.pm $(CURDIR)/debian/tmp/usr/lib/postgresql/18/lib/pgxs/src/test/perl/PostgreSQL/Test/

override_dh_auto_test:

override_dh_installdocs:
	dh_installdocs --all README.*
