#!/usr/bin/make -f
# -*- makefile -*-

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

# pybuild helpfully overrides debian/tmp with debian/PACKAGE if PYBUILD_NAME is
# set. We do not want that; we just need to build two separate packages and let
# dh_install take care of the install locations.
export PYBUILD_DESTDIR = debian/tmp_i_mean_it

%:
	dh $@ --buildsystem=pybuild

override_dh_auto_test:

override_dh_auto_clean \
override_dh_auto_configure \
override_dh_auto_build \
override_dh_auto_install: override_%:
	PYBUILD_NAME=rstcheck-core $* --buildsystem=pybuild --sourcedirectory=core
	PYBUILD_NAME=rstcheck $* --buildsystem=pybuild --sourcedirectory=.

override_dh_install:
	dh_install --sourcedir=debian/tmp_i_mean_it

execute_before_dh_installman: debian/rstcheck.1
	true

%.1: %.1.in
	sed -e 's/@VERSION@/$(DEB_VERSION_UPSTREAM)/g' $< > $@
