File: rules

package info (click to toggle)
maint-guide 1.2.14
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,256 kB
  • ctags: 27
  • sloc: makefile: 186; sh: 39
file content (104 lines) | stat: -rwxr-xr-x 3,482 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/make -f
# Derived from the rules file for developers-reference (Adam Di Carlo)
# and debhelper rules.multi2 example (Joey Hess).

#export DH_VERBOSE=1
export DH_OPTIONS
export LANG=C
# stupid kludge around a stupid debiandoc-sgml bug

name		:= maint-guide
languagesfoo	:= fr ja ko es ru de it pl
languagesbar	:= pt_BR zh_CN zh_TW
docdir		:= usr/share/doc/$(name)
install_file	:= install -m 0644
BUILD_TYPE := package

build: stamp-build
stamp-build: $(name).sgml
	dh_testdir
	$(MAKE) "BUILD_TYPE=$(BUILD_TYPE)" validate all
	touch $@

clean:
	dh_testdir
	dh_testroot
	$(MAKE) "BUILD_TYPE=$(BUILD_TYPE)" clean
	# Remove unbuild sources for now
	dh_clean stamp-build debian/$(name)-*.p*

install: DH_OPTIONS=
install: stamp-build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs -Ai $(docdir)
	dh_installdirs -p$(name) $(docdir)
	install -m644 Credits debian/$(name)/$(docdir)
# English version:
	cp -a $(name).en.html debian/$(name)/$(docdir)
	$(install_file) $(name).en.txt $(name).sgml \
                        $(name).en.ps $(name).en.pdf \
                        debian/$(name)/$(docdir)
	ln -s index.en.html \
          debian/$(name)/$(docdir)/$(name).en.html/index.html
# most of the translations just use the language code
	@set -ex; for lang in $(languagesfoo); do \
          cp -a $(name).$$lang.html debian/$(name)-$$lang/$(docdir); \
          ln -s index.$$lang.html \
            debian/$(name)-$$lang/$(docdir)/$(name).$$lang.html/index.html; \
          $(install_file) $(name).$$lang.txt $(name).$$lang.sgml \
            debian/$(name)-$$lang/$(docdir); \
          $(install_file) $(name).$$lang.ps $(name).$$lang.pdf \
            debian/$(name)-$$lang/$(docdir); \
        done
# special case for translations using language_country code
	@set -ex; for i in $(languagesbar); do \
	  l=`echo $${i} | cut -d_ -f1`; \
	  s=`echo $${i} | cut -d_ -f2 | tr A-Z a-z`; \
	  cp -a $(name).$${i}.html debian/$(name)-$$l/$(docdir); \
	  $(install_file) $(name).$${i}.txt $(name).$${i}.sgml \
	    debian/$(name)-$${l}/$(docdir); \
	  $(install_file) $(name).$${i}.ps $(name).$${i}.pdf \
	    debian/$(name)-$${l}/$(docdir); \
	  ln -s index.$${l}-$${s}.html \
	    debian/$(name)-$${l}/$(docdir)/$(name).$${i}.html/index.html; \
	done

binary-indep: DH_OPTIONS=-i
binary-indep: build install
	dh_installdocs
	dh_installchangelogs
	@set -ex; for lang in $(languagesfoo) $(languagesbar); do \
	  l=`echo $$lang | cut -d_ -f1`; \
          ln -snf ../$(name) debian/$(name)-$${l}/$(docdir)-$${l}; \
        done
	dh_strip
	dh_fixperms
	dh_compress
	dh_installdeb
#	dh_gencontrol
# up to date versions, using the default value of 1.2* in debian/changelog:
	DH_OPTIONS="-p$(name)" dh_gencontrol
	DH_OPTIONS="-p$(name)-fr" dh_gencontrol
	DH_OPTIONS="-p$(name)-ja" dh_gencontrol
	DH_OPTIONS="-p$(name)-pl" dh_gencontrol
	DH_OPTIONS="-p$(name)-it" dh_gencontrol
	DH_OPTIONS="-p$(name)-zh" dh_gencontrol
	DH_OPTIONS="-p$(name)-ko" dh_gencontrol
	DH_OPTIONS="-p$(name)-de" dh_gencontrol
	DH_OPTIONS="-p$(name)-es" dh_gencontrol
	DH_OPTIONS="-p$(name)-pt" dh_gencontrol
	DH_OPTIONS="-p$(name)-ru" dh_gencontrol
# out of date versions:
	# If no change from old version, 
	# upload with the same version to prevent updating.
	#DH_OPTIONS="-p$(name)-XX -u"-v1.X.Y-Z"" dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch:
# There are no architecture-dependent packages here.

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