#!/usr/bin/make -f

manpages = $(shell (ls doc/*.md | sed 's/.md//'))

export PYBUILD_NAME=comitup
export PYBUILD_DISABLE=test
export PYBUILD_INSTALL_ARGS=--install-lib=/usr/share/comitup\
 --install-scripts=/usr/share/comitup

%:
	dh $@ --buildsystem=pybuild

execute_after_dh_auto_build:
	for mn in ${manpages}; do \
	  pandoc $$mn.md -s -t man -o $$mn; \
	  sed -i 's/\\\[en\]/\\\-/' $$mn; \
	  pandoc $$mn.md -s -t html -o $$mn.html; \
	done

execute_after_dh_installsystemd:
	dh_installsystemd --name=comitup-web
