File: rules

package info (click to toggle)
packaging-tutorial 0.24
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,816 kB
  • sloc: makefile: 24
file content (32 lines) | stat: -rwxr-xr-x 1,132 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/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"