#!/usr/bin/make -f

# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

include /usr/share/dpkg/pkg-info.mk

export PYBUILD_NAME = pacu

%:
	dh $@ --with python3 --buildsystem=pybuild

execute_before_dh_auto_configure:
	# This module imports awscli, and it clashes with python3-botocore
	# (because awscli has its own embedded copy of botocore, however if
	# python3-botocore is imported first, it takes over and then awscli
	# uses it instead of using its own copy, and that fails awscli).
	# It fails the tests, and maybe fails at runtime as well, dunno.
	# So let's just remove it.
	rm -fr pacu/modules/eks__collect_tokens/
	# This module requires python3-chalice, not packaged in Debian
	rm -fr pacu/modules/cfn__resource_injection/

execute_after_dh_install:
	echo $(DEB_VERSION_UPSTREAM) >> $(CURDIR)/debian/pacu/usr/lib/$$(py3versions --default)/dist-packages/pacu/version
	mkdir -p $(CURDIR)/debian/pacu/usr/share/pacu/
	cp $(CURDIR)/pyproject.toml $(CURDIR)/debian/pacu/usr/share/pacu/
