File: rules

package info (click to toggle)
tetex-base 2.0.2c-8
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 154,924 kB
  • ctags: 4,018
  • sloc: perl: 5,721; sh: 1,250; makefile: 310; lisp: 289; python: 251
file content (430 lines) | stat: -rwxr-xr-x 15,374 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.

# Heavily updated to take advantage of debhelper
#  by C.M. Connelly <cmc@debian.org> on 2002 April 27.

# $Id: rules,v 1.65 2005/04/15 12:02:10 frank Exp $

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

# This is the debhelper compatibility version to use.
export DH_COMPAT=3

SHELL = /bin/bash

package=tetex-base
extra=tetex-extra
docpack=tetex-doc
txmfdir=debian/$(package)/usr/share/texmf
sharedir=debian/$(package)/usr/share/
pkgdir=debian/$(package)/usr/share/$(package)
vardir=debian/$(package)/var/lib/texmf
debetc=debian/$(package)/etc/texmf
etcdir=/etc/texmf
generated="download35.map builtin35.map psfonts_t1.map psfonts_pk.map pdftex_dl14.map pdftex_ndl14.map dvipdfm_dl14.map dvipdfm_ndl14.map ps2pk.map"
BASE_UCF=dvips/tetex/config.builtin35 web2c/updmap.cfg web2c/mktex.cnf dvipdfm/config/config texdoctk/texdocrc
BASE_CONFFILES=texsys.cfg latex.ini color.cfg graphics.cfg latex209.cfg ltxdoc.cfg ltxguide.cfg


build: build-stamp debian/po/templates.pot

debian/po/templates.pot: debian/templates
	debconf-updatepo
	grep "Last-Translator" debian/po/*.po | \
	  sed -e 's/.*\(<.*@.*>\).*/\1, /g' | \
	  tr "\n" " " | sed -e 's/,  $$/\n/' \
	  > debian/recent-translators


build-stamp:
	dh_testdir
# modification for Debian
	# dirty trick for cvs-upgrade
	-mv -f texmf/dvipdfm/config-2.0.2 texmf/dvipdfm/config
	patch -p0 -RNi debian/patches/patch-deb || true
	patch -p0 -Ni debian/patches/patch-deb
	patch -p1 -RNi debian/patches/patch-docs || true
	patch -p1 -Ni debian/patches/patch-docs
	patch -p1 -RNi debian/patches/patch-tmp || true
	patch -p1 -Ni debian/patches/patch-tmp

# Make sure that our build scripts are executable.
	chmod +x debian/restore-symlinks
	chmod +x debian/remove-bad-license-files
	chmod +x debian/setup-maps
	chmod +x debian/setup-conffiles
	chmod +x debian/setup-ucf

# Make sure all our expected symlinks are in place
	debian/restore-symlinks
# If this were a binary package, we would run configure and make now.

	touch build-stamp


### Clean up the source tree.

clean:
	dh_testdir
	dh_testroot

# Remove build-stamp.
	-rm -f build-stamp

# Make sure that our build scripts are executable.
	chmod +x debian/restore-symlinks
	chmod +x debian/remove-bad-license-files
	chmod +x debian/setup-maps
	chmod +x debian/setup-conffiles
	chmod +x debian/setup-ucf

# Make sure all our expected symlinks are in place.
#	debian/restore-symlinks
# Remove extra symlinks and modifications
	debian/restore-symlinks -rm
	# dirty trick for cvs-upgrade
	-mv -f texmf/dvipdfm/config texmf/dvipdfm/config-2.0.2
	patch -p1 -RNi debian/patches/patch-tmp || true
	patch -p1 -RNi debian/patches/patch-docs || true
	patch -p0 -RNi debian/patches/patch-deb || true
# very temporary
	rm -f texmf/doc/latex/styles/euler.dvi

# Remove any CVS directories that may be present in the source tree.
#	-rm -rf debian/$(package) `find debian/* -type d ! -name CVS ! -name patches `

# this was obsolete and even harmful.
	-rm -f debian/tetex-extra.preinst
# Remove files that we can't distribute if they're still in the tree
	debian/remove-bad-license-files

# Run dh_clean to clean up the source tree.
	dh_clean ./files* ./debian/*.files


### Install the files for the packages.

install: build
# Make sure we're in the right directory and that we have root-like privileges.
	dh_testdir
	dh_testroot

	dh_clean -k

# We shouldn't need these lines -- the things they do should be taken
#   care of by the clean target.
#CMC#	-rm -rf debian/$(package) `find debian/* -type d`
#CMC#	-rm -f files.* debian/*.files

# Install the directories listed in debian/*dirs into package subdirectories.
	dh_installdirs -A

## Create a list of all files and links.
	find ./texmf/ -path ./texmf/source -prune -o -type f -print -o -type l -print > files.all

# Filter nonfree

# If we had a tetex-nonfree package, we'd pull the names of the files
#   that would go in that package here.


# Create a list of documentation files.

## Generate the pattern on-the-fly, catching some stuff we may have
## been missing.
	(docpattern=`find ./texmf/doc -mindepth 1 -maxdepth 1 -type d -print | \
		sed -e 's#\.#|#' | \
		awk -F"\n" '{ORS="";print $$1}' | \
		sed -e 's/^|//'` && \
	grep -E "$$docpattern" files.all | grep -Fv .pfb > files.doc)

# Create a list of files less documentation files.
	sort files.all files.doc | uniq -u > files.all-doc

# Change the pathnames of the files in files.doc and put the result
# into a debian/tetex-doc file list.
	sed -e "s#^\./#/usr/share/#g" files.doc | \
	sed -e "s#usr/share/texmf/doc#usr/share/doc/texmf#g" > \
	debian/tetex-doc.files


# Create a list of files for tetex-extra.
	grep -E "/bluesky/|/fonts/.*/(adobe|bitstrea)/|/fonts/.*/(cmextra|gothic|pandora|concrete|rsfs|stmary|bbold|bbm|wasy)/|/fonts/.*/(ec|tc)/|/fonts/.*/ams/|/fonts/.*/sauter|/fonts/.*/urw/|/eurosym|/french/|/hoekwater/|/omega/|/tex/.*/pictex/|/tex/amstex/|/texmf/.*/pstricks/|/texmf/.*/texdraw/|/texmf/.*/xypic/|/texmf/bibtex/|/texmf/metapost/" files.all-doc > files.extra

# Drop docs and extra from a list.
	sort files.all-doc files.extra | uniq -u > files.all-doc-extra

# Create a list of base files.
	grep -E "/tex/latex/(base|tools|graphics|mfnfss)|/fonts/.*/(public/latex|mflogo)" \
	   files.all-doc-extra > files.base
	# add to files.base the config files for base packages
	for file in $(BASE_CONFFILES); do find ./texmf -name $$file >> files.base; done

	sort files.all-doc-extra files.base | uniq -u > files.all-doc-extra-latexbase

# Append files with /tex/latex in their paths to files.extra
	grep -E "/tex/latex" files.all-doc-extra-latexbase >> files.extra

# Process files.extra into a debian/tetex-extra.files file that can be
# used by dh_movefiles. We also have to mirror the move of files in tex/latex/config
	sed -e "s#^\.#usr/share#;s#usr/share/texmf/tex/latex/config/#etc/texmf/latex/#" \
	   files.extra > debian/tetex-extra.files


### Install tetex-base.

# Copy the whole texmf tree to the install directory.
	cp -a texmf $(sharedir)

# Remove a source subdirectory, if it exists.
	rm -rf $(txmfdir)/source

# Remove any texinfo-related files.
	rm -rf $(txmfdir)/tex/texinfo

# handle ucf-managed configuration files
	cp debian/setup-ucf $(sharedir)/tetex-base/
# tetex-base
	mv $(txmfdir)/texdoctk/texdocrc.defaults $(txmfdir)/texdoctk/texdocrc
	for file in $(BASE_UCF); do \
	  mv $(txmfdir)/$${file} $(pkgdir)/; \
	  cp debian/md5sums/`basename $${file}`.md5sum $(pkgdir)/; \
	done
	(cd $(pkgdir); ln -s updmap.cfg 00updmap.cfg)
	(cd $(vardir)/web2c; ln -s /etc/texmf/mktex.cnf .)
	(cd $(txmfdir)/dvips/tetex; ln -s /etc/texmf/dvips/config.builtin35 .)
# texdoctk stuffs, texdoctrc is handled by ucf
	mkdir debian/$(package)/etc/texdoctk
	mv $(txmfdir)/texdoctk/texdoctk.dat debian/$(package)/etc/texdoctk/
	rmdir $(txmfdir)/texdoctk
	ln -s /etc/texdoctk $(txmfdir)
# tetex-extra handles its ucf files in setup-maps.

# Remove any web2c files. No, web2c stuffs are necessary now (since 2.0)!
# 2004-08-19, 2.0.2a-4: But we leave them in $txmfdir/web2c
#	rm -rf $(vardir)/web2c
#	cp $(txmfdir)/web2c/*.tcx $(vardir)/web2c
#	mv $(txmfdir)/web2c/mktex.cnf $(debetc) # now ucf
# 	(cd $(vardir)/web2c/; ln -s $(etcdir)/mktex.cnf .)
#	rm -rf $(txmfdir)/web2c

# dvipdfm
	cp -a $(txmfdir)/dvipdfm/config debian/$(package)/etc/texmf/dvipdfm
	rm -rf $(txmfdir)/dvipdfm/*
	(cd $(txmfdir)/dvipdfm; ln -s /etc/texmf/dvipdfm config)

# Move the xdvi app-defaults file to the correct location and create a
#  link to it in its old location.
	mv $(txmfdir)/xdvi/XDvi debian/$(package)/etc/X11/app-defaults/XDvi
	(cd $(txmfdir)/xdvi/; ln -s /etc/X11/app-defaults/XDvi .)

# Move the dvips configuration directory to /etc/texmf and create a link.
	mv $(txmfdir)/dvips/config $(debetc)/dvips
	(cd $(txmfdir)/dvips/; ln -s /etc/texmf/dvips config)

# Move and link the METAFONT modes file.
	mv $(txmfdir)/metafont/misc/modes.mf $(debetc)/
	(cd $(txmfdir)/metafont/misc/; ln -s /etc/texmf/modes.mf .)

# Move and link language.dat.
	mv $(txmfdir)/tex/generic/config/language.dat $(pkgdir)/language.dflt
	#(cd $(txmfdir)/tex/generic/config/; ln -s /etc/texmf/language.dat .)

# Move pdftex/config to /etc/texmf and link it back.
	mv $(txmfdir)/pdftex/config $(debetc)/pdftex
	(cd $(txmfdir)/pdftex/; ln -s /etc/texmf/pdftex config)

# Move the documentation directory from the texmf tree to /usr/share/doc
	mv $(txmfdir)/doc $(sharedir)/doc/texmf

# Move the helpindex.html file to /var/lib/texmf (where it can be
# safely updated without violating the FHS), and link it back to
# /usr/share/doc/texmf.
	mv $(sharedir)/doc/texmf/helpindex.html $(vardir)/
	(cd $(sharedir)/doc/texmf/; ln -s /var/lib/texmf/helpindex.html .)

# Create a link within the texmf tree to the documentation.
	(cd $(txmfdir)/; ln -s ../doc/texmf doc)

# Create a link within the package doc directory to the documentation.
	(cd $(sharedir)/doc/tetex-base/; ln -s ../texmf texmf)

# Copy the dhelp definition file to the package documentation directory.
	cp debian/dhelp $(sharedir)/doc/tetex-base/.dhelp

# Copy the LPPL file to /usr/share/doc/tetex-base.
	cp -p texmf/doc/latex/base/lppl.txt debian/$(package)/usr/share/doc/tetex-base

# Remove the out-of-date ls-R file from /usr/share/texmf and create a
# link to one in /var/lib/texmf that we can update without violating
# the FHS.
	rm -f $(txmfdir)/ls-R
	(cd $(txmfdir); ln -s /var/lib/texmf/ls-R-TEXMFMAIN ls-R)

# xdvi.cfg was moved from tetex-bin to tetex-base (since 20021025).  But,
# moved tetex-bin again (and removed from upstream tetex-base) since teTeX 2.0
# Remove the xdvi.cfg file from the texmf tree.
#	rm -f $(txmfdir)/xdvi/xdvi.cfg

# setup conffiles
	debian/setup-maps -base
	debian/setup-conffiles -base
# removed generated files
	for m in "$(generated)"; do mv $(debetc)/dvips/$$m $(pkgdir)/maps; done


# Do something about making the mkhtml script usable.
## We should move this binary to tetex-bin, really, but at least into
## an appropriate directory.  In the meantime, we'll leave it where it
## is.
#	chmod +x $(txmfdir)/doc/mkhtml

# very temporary; marvosym.pfb was duplicated and should not be here.
	rm $(sharedir)/doc/texmf/fonts/marvosym/marvosym.pfb

# links so that files in texmf/etex are found; this will no longer be needed in teTeX-3.0
	ln -s ../etex/latex $(txmfdir)/tex/elatex
	ln -s ../../etex/plain/base $(txmfdir)/tex/eplain/base
	ln -s ../../etex/plain/config $(txmfdir)/tex/eplain/config

# ship /var/cache/fonts in the tetex-base package, with proper permissions
	mkdir --mode=1777 debian/$(package)/var/cache/fonts/pk
	mkdir --mode=1777 debian/$(package)/var/cache/fonts/tfm
	mkdir --mode=1777 debian/$(package)/var/cache/fonts/source

## Done installing tetex-base!


### Install tetex-extra and tetex-doc (and tetex-nonfree, if we had such
# a thing).

	dh_movefiles --sourcedir=debian/$(package)

# remove directories from tetex-base's doc directory that are empty after dh_movefiles: 
# We call it three times to remove directories that contain only empty directories
# (or directories that contain only empty dirs)
	find $(sharedir)/doc/texmf/ -type d -empty | xargs rmdir
	find $(sharedir)/doc/texmf/ -type d -empty | xargs rmdir
	find $(sharedir)/doc/texmf/ -type d -empty | xargs rmdir

# cweb stuff
	mkdir -p debian/$(docpack)/usr/share/doc/texmf/programs/cweb-examples
	cp debian/cweb-examples/* \
	   debian/$(docpack)/usr/share/doc/texmf/programs/cweb-examples

#	(cd debian/$(package); find . -type d -empty -prune -exec rm -rf {} \; && find . -type d -empty -prune -exec rm -rf {} \; && find . -type d -empty -prune -exec rm -rf {} \; || true)

# setup conffiles for tetex-extra
	debian/setup-maps -extra
	debian/setup-conffiles -extra

# unnecessary, not yet used.
	rm -f debian/$(docpack)/usr/share/doc/texmf/metapost/base/.cvsignore

# The floatflt package was removed, but later proved to have a free license
	for pdffile in floatflt floatfge floatexm; do \
           uudecode -o debian/$(docpack)/usr/share/doc/texmf/latex/floatflt/$$pdffile.pdf \
	   debian/patches/$$pdffile.pdf.uu; \
        done
# The sueterlin fonts had no documentation
	uudecode -o debian/$(docpack)/usr/share/doc/texmf/fonts/gothic/suet.pdf debian/patches/suet.pdf.uu



binary-indep: build install
	dh_testdir -i
	dh_testroot -i

# Build preinst script for tetex-base.
#	m4 -DTETEX_BASE debian/tetex-preinst.m4 > debian/preinst

# Build preinst script for tetex-extra.
#	m4 debian/tetex-preinst.m4 > debian/tetex-extra.preinst

# Install debconf config and template files.
	dh_installdebconf -p$(package)

# Install documentation (also creates /usr/share/doc/<package>
# directories).
	if [ ! -L debian/tetex-doc.README.Debian ]; then ln -s README.debian debian/tetex-doc.README.Debian; fi
	dh_installdocs -A debian/remove-oldmaps
# Install upstream changelog.
	dh_installchangelogs -A texmf/ChangeLog

# Remove the /usr/share/doc/{tetex-extra,tetex-doc} directories and
# replace them with links to the /usr/share/doc/tetex-base directory
# (so all are identical).
# 2004-09-24, 2.0.2b-6: tetex-doc must have it's own directory, because it
# does not depend on tetex-base. Instead, create a symlink to texmf:
#	rm -rf debian/$(docpack)/usr/share/doc/$(docpack)
	rm -rf debian/$(extra)/usr/share/doc/$(extra)
	(cd debian/$(extra)/usr/share/doc/; ln -s tetex-base tetex-extra)
#	(cd debian/$(docpack)/usr/share/doc/; ln -s tetex-base tetex-doc)
	ln -s ../texmf debian/$(docpack)/usr/share/doc/$(docpack)/
	cp debian/remove-oldmaps debian/$(docpack)/usr/share/doc/$(docpack)/
	cp debian/NEWS.Debian debian/$(docpack)/usr/share/doc/$(docpack)/
	cp debian/NEWS.Debian debian/$(package)/usr/share/doc/$(package)/
# Install any example files.
#	dh_installexamples -i


# Compress files in tetex-doc.
## (dh_compress does -9 level compression.)
#	find debian/$(docpack)/usr/share/doc -name "*dvi" -exec gzip -9 {} \;
	dh_compress -i -p tetex-doc -X.listing
#
# Install some other stuff we don't have.
#	dh_installmenu -i
#	dh_installlogrotate -i
#	dh_installemacsen -i
#	dh_installpam -i
#	dh_installmime -i
#	dh_installinit -i
#	dh_installcron -i
#	dh_strip
#
# Install manpages.
## There are none now, but if we fix the mkhtml situation without
## moving the script to tetex-bin, there will be need to be a manpage.
#	dh_installman -i
#	dh_undocumented -i
#
# Install any info files.
	dh_installinfo -i

# Install reportbug scripts
	install -D --mode=755 debian/reportbug.base debian/$(package)/usr/share/bug/tetex-base/script
	install -D --mode=644 debian/reportbug-control.base debian/$(package)/usr/share/bug/tetex-base/control
	install -D --mode=755 debian/reportbug.extra debian/$(extra)/usr/share/bug/tetex-extra/script

# Fix permissions.
	dh_fixperms -i --exclude=var/cache/fonts

# some other stuff we don't have.
#	dh_makeshlibs -V
#	dh_shlibdeps

	dh_gencontrol -i

# Install files into the DEBIAN directories.
	dh_installdeb -i

# Generate the DEBIAN/md5sums files.
	dh_md5sums -i

# Build the debs.
	dh_builddeb -i

# Beep to let the builder know we're done.
	echo -en "\a"

binary-arch: build

# There are no architecture-dependent files generated by this package.
# If there were any they would be made here.

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