#!/usr/bin/make -f include /usr/share/dpkg/pkg-info.mk %: dh $@ #extract version number and date from Debian changelog TEXVERSION := $(shell grep 'footnotesize version' packaging-tutorial.tex | cut -d ' ' -f 3) YMD := $(shell date -d@$(SOURCE_DATE_EPOCH) +'%Y-%m-%d') DISTRIB := $(shell dpkg-parsechangelog -S Distribution) override_dh_auto_build: # version check if [ $(TEXVERSION) != $(DEB_VERSION) -a $(DISTRIB) != 'UNRELEASED' ]; then echo "Wrong version in .tex: $(DEB_VERSION) != $(TEXVERSION)"; exit 1; fi #translate source files before building pdf po4a po4a/po4a.cfg --verbose --keep 50 dh_auto_build override_dh_clean: dh_clean #remove translated source files rm -f packaging-tutorial.*.tex debiantutorial.*.sty override_dh_compress: dh_compress -X.pdf update-version-date: sed -i -e "s/.* % DATE - use debian\/rules update-version-date/\\\\date{\\\\footnotesize version $(DEB_VERSION) -- $(YMD)} \% DATE - use debian\/rules update-version-date/" packaging-tutorial.tex po-call: cd po4a && podebconf-report-po --postpone /tmp/po --notdebconf --call echo "Now use: mutt -e 'set postponed=/tmp/po' -p"