File: rules

package info (click to toggle)
debian-handbook 11.20220922
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 152,440 kB
  • sloc: xml: 32,387; sh: 241; makefile: 62; perl: 54; python: 26
file content (28 lines) | stat: -rwxr-xr-x 935 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.jpg  # 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