#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

SETUP_PY_VERSION := $(shell python3 setup.py --version)

ifneq ($(DEB_VERSION),$(SETUP_PY_VERSION))
$(error Version in debian/changelog does not match setup.py)
endif

MANPAGES = trydiffoscope.1

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

%.1: %.1.rst
	rst2man $< $@

override_dh_auto_clean:
	rm -f $(MANPAGES)

override_dh_auto_build: $(MANPAGES)
	dh_auto_build
