Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 by Joey Hess.
4 #
5 # This version is for a hypothetical package that builds an
6 # architecture-dependant package, as well as an architecture-independent
7 # package.
8
9 # Modified for the Debian GNU/Linux system packages 'ibrazilian' and
10 # 'brazilian-conjugate' by Carlos Laviola, with aid of rules file
11 # made by the previous maintainer, Rafael Laboissiere.
12
13 # Uncomment this to turn on verbose mode.
14 # export DH_VERBOSE=1
15
16 debdir := $(CURDIR)/debian
17 tmpdir := $(debdir)/tmp
18 usrdir := $(tmpdir)/usr
19 bindir := $(usrdir)/bin
20
21 libdir := $(usrdir)/lib/ispell
22 sharedir := $(tmpdir)/usr/share/ispell
23
24 # The following rules avoid the inclusion of changed conjugue and conjugue.1
25 # files in the diff.gz file, making dpkg-buildpackage reentrant
26
27 savefiles = conjugue conjugue.1
28
29 # These docs are ISO-8859-1, but should be released as UTF-8
30 DOCS_LATIN1 = ANUNCIO CHANGELOG README TODO FAQ.i
31
32 # Make sure build is always done in a reproducible and working
33 # language environment
34 LC_ALL=C
35 export LC_ALL
36
37 save-conjugue:
38 for f in $(savefiles) ; do \
39 test -f $$f-orig || cp $$f $$f-orig ; \
40 done
41
42 restore-conjugue:
43 for f in $(savefiles) ; do \
44 test ! -f $$f-orig || mv $$f-orig $$f ; \
45 done
46
47 recode-manpage:
48 perl debian/latin1-troff.pl conjugue.1
49
50 build: build-arch build-indep
51 build-arch: build-stamp
52 build-indep: build-stamp
53 build-stamp: save-conjugue recode-manpage recode-docs
54 dh_testdir
55
56 # Build everything besides aspell
57 $(MAKE) AWK=/usr/bin/gawk \
58 formas br.aff br.base br.ispell
59
60 # conjugue files
61 for e in UTF-8 ISO-8859-1 ; do \
62 cp verbos verbos-$$e ; \
63 done
64 recode l1..utf8 verbos-UTF-8
65
66 # wordlist file
67 iconv -f ISO-8859-1 -t UTF-8 formas > brazilian
68
69 touch build-stamp
70
71 recode-docs:
72 # Docs should be UTF-8
73 for doc in $(DOCS_LATIN1); do \
74 [ ! -e "$$doc.BKP" ] || exit 1; \
75 cp $$doc $$doc.BKP; \
76 recode l1..utf8 $$doc; \
77 done
78 touch $@
79
80 clean: restore-conjugue
81 dh_testdir
82 dh_testroot
83 rm -f build-stamp
84
85 $(MAKE) clean
86 rm -f brazilian
87
88 # Restore old latin1 docs
89 for doc in $(DOCS_LATIN1); do \
90 [ ! -e "$$doc.BKP" ] || mv -f "$$doc.BKP" "$$doc"; \
91 done
92 rm -f recode-docs
93
94 dh_clean
95
96 install: DH_OPTIONS=
97 install: build
98 dh_testdir
99 dh_testroot
100
101 mkdir -p $(sharedir)
102 # Add here commands to install the package into debian/ibrazilian.
103 $(MAKE) install prefix=$(usrdir) DESTDIR=$(tmpdir) \
104 MANDIR=$(usrdir)/share/man HASHDIR=$(usrdir)/lib/ispell \
105 VDIR=/usr/lib/brazilian-conjugate AWK=/usr/bin/gawk
106 ( cd $(bindir) ; \
107 for e in UTF-8 ISO-8859-1 ; do \
108 cp conjugue conjugue-$$e ; \
109 perl -pi -e "s|/verbos|/verbos-$$e|" conjugue-$$e ; \
110 done ; \
111 recode l1..utf8 conjugue-UTF-8 )
112 mv $(libdir)/br.aff $(libdir)/brasileiro.aff
113 rm -f $(libdir)/br.hash
114 rm -f $(libdir)/brazilian-conjugate/verbos
115 # -- Install gzipped affix compressed dictionary
116 gzip -n --best -c br.ispell > $(sharedir)/brasileiro.mwl.gz
117 install --mode=577 debian/conjugue-wrapper $(bindir)/conjugue
118 dh_install --package=ibrazilian --sourcedir=$(tmpdir)
119 dh_install --no-package=ibrazilian
120 for e in UTF-8 ISO-8859-1 ; do \
121 dh_link --package=brazilian-conjugate \
122 usr/share/man/man1/conjugue.1 \
123 usr/share/man/man1/conjugue-$$e.1 ; \
124 done
125
126 # Build architecture-independent files here.
127 # Pass -i to all debhelper commands in this target to reduce clutter.
128 binary-indep: build install
129 dh_testdir -i
130 dh_testroot -i
131 dh_installdocs --package=wbrazilian
132 dh_installdocs -A --no-package=wbrazilian README ANUNCIO FAQ.i
133 dh_installchangelogs -i CHANGELOG
134 dh_installman -i
135 installdeb-wordlist --package=wbrazilian
136 installdeb-ispell --package=ibrazilian
137 dh_compress -i
138 dh_fixperms -i
139 dh_installdeb -i
140 dh_link -i
141 dh_gencontrol -i
142 dh_md5sums -i
143 dh_builddeb -i
144
145 # Build architecture-dependent files here.
146 binary-arch: build install
147 # Nothing to do here
148
149 binary: binary-indep binary-arch
150 .PHONY: build clean binary-indep binary-arch binary install