File: rules

package info (click to toggle)
debian-faq 9.0
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 4,612 kB
  • sloc: makefile: 291; perl: 145; sh: 58
file content (87 lines) | stat: -rwxr-xr-x 2,786 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/make -f
# derived from sample debian/rules file for GNU hello by Ian Jackson.

tmp = $(CURDIR)/debian/tmp
docdir = $(tmp)/usr/share/doc/debian
basedir = $(CURDIR)/debian/debian-faq
installdir = $(basedir)/usr/share/doc/debian

langs = de fr it nl ru zh_CN

build: build-arch build-indep
build-arch: stamp-build
build-indep: stamp-build
stamp-build:
	test -f Makefile -a -f debian/rules
	$(MAKE) po4a-translate html text ps pdf langs="$(langs)"
	gzip -9 debian-faq.en.txt debian-faq.en.ps debian-faq.en.pdf
	for l in $(langs); do \
          gzip -9 $$l/debian-faq.$$l.txt $$l/debian-faq.$$l.ps \
           $$l/debian-faq.$$l.pdf; \
        done
	touch $@

clean:
	test -f Makefile -a -f debian/rules
	dh_testroot
	$(MAKE) clean
	rm -f *.gz stamp-build debian/files `find . -name "*~"`
	dh_clean

binary: binary-indep binary-arch

binary-arch:

binary-indep: build
	test -f Makefile -a -f debian/rules
	dh_testroot
	dh_prep

	install -m 755 -d $(tmp)/DEBIAN $(docdir)/FAQ \
          $(tmp)/usr/share/doc-base $(tmp)/usr/share/doc/debian-faq \
          $(installdir)/FAQ $(basedir)/usr/share/doc-base \
          $(basedir)/usr/share/doc/debian-faq
	install -m 644 debian-faq.en.txt.gz debian-faq.en.ps.gz \
                    debian-faq.en.pdf.gz debian-faq.en.html/* $(installdir)/FAQ

	for l in $(langs); do \
          install -m 755 -d $(docdir)/FAQ/$$l; \
          install -m 644 $$l/debian-faq.$$l.txt.gz $$l/debian-faq.$$l.ps.gz \
           $$l/debian-faq.$$l.pdf.gz $(docdir)/FAQ; \
          install -m 644 $$l/debian-faq.$$l.html/* $(docdir)/FAQ/$$l/; \
        done

	cd $(installdir)/FAQ && for file in *.en.html; do \
          ln -s $$file $${file%$${file#$${file%.en.html}}}.html; \
        done
# Make links for the byhands
	ln -sf debian-faq.en.txt.gz $(installdir)/FAQ/debian-faq.txt.gz
	ln -sf debian-faq.en.ps.gz $(installdir)/FAQ/debian-faq.ps.gz
	ln -sf debian-faq.en.pdf.gz $(installdir)/FAQ/debian-faq.pdf.gz
	ln -sf debian-faq.en.pdf.gz $(installdir)/FAQ/debian-faq.pdf.gz

	dh_installdocs
	dh_installchangelogs
	dh_installdirs --all
	dh_install --sourcedir=$(tmp)
	dh_compress --all
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# The extra-package files:
	mv $(installdir)/FAQ/debian-faq.*txt.gz \
           $(installdir)/FAQ/debian-faq.*ps.gz \
           $(installdir)/FAQ/debian-faq.*pdf.gz \
             ../
	cd $(installdir)/FAQ/ && GZIP=-9 tar czf $(CURDIR)/../debian-faq.en.html.tar.gz *

# list them in the .changes file, so that they'll get uploaded properly:
	dpkg-distaddfile debian-faq.en.html.tar.gz byhand -
	dpkg-distaddfile debian-faq.en.txt.gz byhand -
	dpkg-distaddfile debian-faq.en.ps.gz byhand -
	dpkg-distaddfile debian-faq.en.pdf.gz byhand -

.PHONY: build clean binary binary-arch binary-indep