#!/usr/bin/make -f

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

SET_VERSION := $(shell cat src/core/set.version)
DEB_VERSION_UPSTREAM_STRIPPED := $(shell echo $(DEB_VERSION_UPSTREAM) | cut -d+ -f1)

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

override_dh_auto_configure:
override_dh_auto_clean:
override_dh_auto_build:
override_dh_auto_install:
override_dh_auto_test:
	# Setup.py is not usable

execute_after_dh_install:
	install -D debian/Signed_Update.jar $(CURDIR)/debian/set/usr/share/set/src/html/Signed_Update.jar.orig
	# Fail if package version doesn't match upstream version
	test $(DEB_VERSION_UPSTREAM_STRIPPED) = $(SET_VERSION)

override_dh_installchangelogs:
	dh_installchangelogs readme/CHANGELOG
