File: rules

package info (click to toggle)
cjk 4.7.0%2Bgit20080122-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 5,300 kB
  • ctags: 593
  • sloc: sh: 34,282; lisp: 12,038; ansic: 4,167; perl: 1,325; makefile: 305
file content (162 lines) | stat: -rwxr-xr-x 5,242 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Made with the aid of debhelper by Joey Hess,
# based on the sample debian/rules file for GNU hello by Ian Jackson.
#
# This is free software; see the GNU General Public Licence
# version 2 or later for copying conditions.  There is NO warranty.
#
# Currently maintained by Danai SAE-HAN (韓達耐) <danai.sae-han@edpnet.be>
# for Debian GNU/Linux.

SHELL = /bin/sh

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# When you use the official CVS, SVN, GIT source tree. =CVS:.svn:.git
export DH_ALWAYS_EXCLUDE=.git:CVS:.svn

# The build directory for Thai fonts.
build_thaifonts = build_thaifonts

build: build-stamp
build-arch: patch
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE)

	touch build-arch-stamp

build-indep: patch
	dh_testdir

	# Extracting binary files
# How it was used: uuencode thaifonts.tar.gz thaifonts.tar.gz > thaifonts.tar.gz.uu
	cd debian && uudecode thaifonts.tar.gz.uu && tar xzf thaifonts.tar.gz

	mkdir $(build_thaifonts)
	(cd $(build_thaifonts) && cp ../utils/thaifont/tools/*c90.* ../utils/thaifont/tools/*.fontinst ../debian/thaifonts/* . && cd ../debian/thaifonts && prename 's/_//' * && prename 's/\./n\./' {norasi.*,garuda.*})
# If you depend on thailatex, change above command with this one:
#	(cd $(build_thaifonts) && cp ../utils/thaifont/tools/*{c90.,.fontinst}* /usr/share/texmf/fonts/afm/public/thai/{garuda,norasi}*.afm .)
	(cd $(build_thaifonts) && tex norasi.fontinst && tex garuda.fontinst && for i in f*.pl; do pltotf $$i; done)

	touch build-indep-stamp

build-stamp:
	touch build-stamp

clean: clean1 unpatch

clean1:
	dh_testdir doc/CJKutf8.txt examples/CJKbabel.tex debian/thaifonts.tar.gz.uu
	dh_testroot
	rm -f build-stamp build-indep-stamp build-arch-stamp

	# Add here commands to clean up after the build process.

# If a Debian dpatch has been applied on Makefile, then perform a distclean;
# if not, do nothing.  Reason: CJK upstream has no cleaning targets.
	if [[ `grep -c distclean Makefile` > 0 ]]; then $(MAKE) distclean; fi

	# Remove the binary files.
	rm -rf $(build_thaifonts)

	rm -f utils/hbf2gf/config.log

	rm -rf debian/thaifonts
	rm -f debian/thaifonts.tar.gz

	dh_clean


install:
	dh_testdir
	dh_testroot
#	dh_installdirs -platex-cjk-chinese usr/share/texmf/tex/latex/CJK/CEF

	# Add here commands to install the package into debian/tmp.
	$(MAKE) prefix=$(CURDIR)/debian/tmp/usr install


# Build architecture-independent files here.
binary-indep: build-indep
	dh_testdir -i
	dh_testroot -i

# Install files in the respective subpackages, according
# to the [package].install files.
	dh_install -i
	dh_link -platex-cjk-korean usr/share/doc/latex-cjk-common usr/share/doc/latex-cjk-korean
	dh_link -platex-cjk-all usr/share/doc/latex-cjk-common usr/share/doc/latex-cjk-all
	dh_link -pcjk-latex usr/share/doc/latex-cjk-common usr/share/doc/cjk-latex
	dh_link -platex-cjk-thai usr/share/doc/latex-cjk-common usr/share/doc/latex-cjk-thai
	dh_installtex -platex-cjk-thai --flavor=map:config_for_all_maps map=Map,garuda.map map=Map,norasi.map
	dh_installtex -platex-cjk-korean
	dh_installemacsen -i
	dh_compress -i
	dh_fixperms -i
	dh_shlibdeps -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build build-arch install
	dh_testdir -a
	dh_testroot -a

# Install files in the respective subpackages, according
# to the [package].install files.
	dh_install -a

	chmod +x debian/latex-cjk-common/usr/share/latex-cjk-common/utils/subfonts/*.pl


	dh_link -platex-cjk-chinese usr/share/doc/latex-cjk-common usr/share/doc/latex-cjk-chinese
	dh_link -platex-cjk-japanese usr/share/doc/latex-cjk-common usr/share/doc/latex-cjk-japanese

	# Get the documentation in texdoc.  texdoctk unfortunately uses another engine.
	dh_link -platex-cjk-common usr/share/doc/latex-cjk-common usr/share/doc/texmf/latex/latex-cjk

	dh_installtex -platex-cjk-common -platex-cjk-japanese
	dh_installtex -platex-cjk-chinese --priority=20 language=pinyin,pyhyph.tex

	dh_installdocs -platex-cjk-common
	dh_installexamples -platex-cjk-common
	dh_installman -a
	dh_installchangelogs -platex-cjk-common ChangeLog
	dh_installemacsen -a
	dh_strip --exclude=.pl -a
	dh_compress -a
	dh_fixperms -a
	dh_shlibdeps -a
	dh_installdeb -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

# Remove the .c file created by ctangle.
# This dirty hack will disappear with the
# upstream release of possibly 4.8.0.
#	rm -f utils/hbf2gf/hbf2gf.c

# And now the simple things for dpatch. Here we only apply/unapply the patches.
# You can do more things with dpatch, like having patches only applied on
# a special architecture - see the non-dh version of the sample for this!
# Command: dpatch patch-template -p "01_cvs-20060425" "Add the latest changes from the development snapshot, up to 25 April 2006." <../cjk20060425.diff >debian/patches/01_cvs-20060425.dpatch
patch: patch-stamp
patch-stamp:
#	dpatch apply 01_cvs-20060714 03_Makefile
	dpatch apply-all

	touch $@

unpatch:
	dpatch deapply-all
	rm -rf patch-stamp debian/patched

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install patch unpatch clean1