File: rules

package info (click to toggle)
debian-handbook 8.20180830
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 122,044 kB
  • sloc: xml: 28,069; sh: 145; makefile: 62; perl: 54
file content (28 lines) | stat: -rwxr-xr-x 936 bytes parent folder | download
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
#!/usr/bin/make -f

DOCDIR=debian/debian-handbook/usr/share/doc/debian-handbook/html
VERSION=$(shell sed -n -e 's|.*<productnumber>\(.*\)</productnumber>.*|\1|p' en-US/Book_Info.xml)
LANGS=$(shell echo [a-z][a-z]-[A-Z][A-Z])

%:
	dh $@ 

# Build multiple languages in parallel
override_dh_auto_build: $(foreach lang,$(LANGS),build-html-$(lang))
build-html-%:
	./bin/build-html --lang=$*

override_dh_auto_install:
	mkdir -p $(DOCDIR)
	for lang in $(LANGS); do \
		mv publish/$$lang/Debian/$(VERSION)/html/debian-handbook $(DOCDIR)/$$lang; \
	done
	# Drop some useless files
	rm -f $(DOCDIR)/*/images/chap-*.png # Chapter pictures only used in PDF
	rm -f $(DOCDIR)/*/images/cover.png  # Cover picture (only used in PDF/ePub)
	rm -f $(DOCDIR)/*/images/*.dia      # Sources of diagrams
	# Deduplicate the remaining files
	rdfind -makehardlinks true -makeresultsfile false $(DOCDIR)/en-US $(DOCDIR)

override_dh_auto_clean:
	publican clean