summaryrefslogtreecommitdiff
path: root/Build/source/texk/texlive/linked_scripts/Makefile.am
blob: 8fbfb6c36432ba340f8363c8f2d9628abbda8b06 (plain)
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
## $Id$
## Makefile.am for the TeX Live subdirectory texk/texlive/linked_scripts/
##
## Copyright 2016-2021 Karl Berry <tex-live@tug.org>
## Copyright 2009-2015 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.
##
## TeX Live's extra scripts.

## Build lists of scripts.
##
scripts-list: Makefile
	@echo "Create $@"
	@echo "texmf_scripts='" >$@
	@for f in $(nobase_dist_texmf_scripts_SCRIPTS); do echo "$$f"; done >>$@
	@echo "'" >>$@
	cmp -s $(srcdir)/scripts.lst $@ || cp -f $@ $(srcdir)/scripts.lst

if MAINTAINER_MODE
all-local: scripts-list
else !MAINTAINER_MODE
all-local:
endif !MAINTAINER_MODE

DISTCLEANFILES = scripts-list

EXTRA_DIST = scripts.lst

## Make sure $(bindir) exists
##
installdirs-local:
	$(MKDIR_P) $(DESTDIR)$(bindir)

# Copies of these scripts exist here for the sake of avoiding
# dangling symlinks produced by `make install'.
# The instances in texmf* are the masters (except when it is CTAN).
#
## We distinguish several classes of scripts according to their
## type: `shell', `context', or `other'.
## 
## On Unix systems a symlink from $(bindir) to the script is installed
## for all of them; on Windows nothing is installed in $(bindir) for
## `shell' scripts whereas for `other' (usually perl, lua, ...) scripts
## the standard wrapper ../$(WIN_WRAPPER)/runscript.exe is installed or
## the ConTeXt wrapper ../$(WIN_WRAPPER)/context/mtxrun.exe for
## `context' scripts.
##
## WIN_WRAPPER is w32_wrapper for 32-bit or w64_wrapper for 64-bit.
## 
## The "shell" list aren't just shell scripts, in either direction.
## Some /bin/sh scripts are listed as `other' or `context'
## scripts because they are correctly handled by the wrapper binaries.
## Conversely, some non-sh scripts are listed as `shell' because they
## depend on shell scripts or otherwise aren't useful on Windows.
## 
texmf_scriptsdir = $(datarootdir)/texmf-dist/scripts
texmf_shell_scripts = \
	adhocfilelist/adhocfilelist.sh \
	bibexport/bibexport.sh \
	checklistings/checklistings.sh \
	ctanbib/ctanbib \
	dtxgen/dtxgen \
	git-latexdiff/git-latexdiff \
	installfont/installfont-tl \
	latexfileversion/latexfileversion \
	listbib/listbib \
	listings-ext/listings-ext.sh \
	ltxfileinfo/ltxfileinfo \
	pdfbook2/pdfbook2 \
	pdfjam/pdfjam \
	pdftex-quiet/pdftex-quiet \
	pdfxup/pdfxup \
	pst-pdf/ps4pdf \
	simpdftex/simpdftex \
	texlive-extra/allcm.sh \
	texlive-extra/allneeded.sh \
	texlive-extra/dvi2fax.sh \
	texlive-extra/dvired.sh \
	texlive-extra/fontinst.sh \
	texlive-extra/kpsetool.sh \
	texlive-extra/kpsewhere.sh \
	texlive-extra/ps2frag.sh \
	texlive-extra/pslatex.sh \
	texlive-extra/rubibtex.sh \
	texlive-extra/rumakeindex.sh \
	texlive-extra/texconfig-dialog.sh \
	texlive-extra/texconfig-sys.sh \
	texlive-extra/texconfig.sh \
	texlive-extra/texlinks.sh \
	texlive-extra/xetex-unsafe.sh \
	texlive-extra/xelatex-unsafe.sh \
	texosquery/texosquery.sh \
	texosquery/texosquery-jre5.sh \
	texosquery/texosquery-jre8.sh \
	tikztosvg/tikztosvg \
	typeoutfileinfo/typeoutfileinfo.sh \
	wordcount/wordcount.sh

texmf_other_scripts = \
	a2ping/a2ping.pl \
	accfonts/mkt1font \
	accfonts/vpl2ovp \
	accfonts/vpl2vpl \
	albatross/albatross.sh \
	arara/arara.sh \
	attachfile2/pdfatfi.pl \
	authorindex/authorindex \
	bib2gls/bib2gls.sh \
	bib2gls/convertgls2bib.sh \
	bundledoc/arlatex \
	bundledoc/bundledoc \
	cachepic/cachepic.tlu \
	checkcites/checkcites.lua \
	chklref/chklref.pl \
	cjk-gs-integrate/cjk-gs-integrate.pl \
	clojure-pamphlet/pamphletangler \
	cluttex/cluttex.lua \
	context/perl/mptopdf.pl \
	convbkmk/convbkmk.rb \
	crossrefware/bbl2bib.pl \
	crossrefware/bibdoiadd.pl \
	crossrefware/bibmradd.pl \
	crossrefware/biburl2doi.pl \
	crossrefware/bibzbladd.pl \
	crossrefware/ltx2crossrefxml.pl \
	ctan-o-mat/ctan-o-mat.pl \
	ctanify/ctanify \
	ctanupload/ctanupload.pl \
	de-macro/de-macro \
	diadia/diadia.lua \
	dosepsbin/dosepsbin.pl \
	dviasm/dviasm.py \
	dviinfox/dviinfox.pl \
	ebong/ebong.py \
	epspdf/epspdf.tlu \
	epspdf/epspdftk.tcl \
	epstopdf/epstopdf.pl \
	exceltex/exceltex \
	fig4latex/fig4latex \
	findhyph/findhyph \
	fontools/afm2afm \
	fontools/autoinst \
	fontools/ot2kpx \
	fragmaster/fragmaster.pl \
	getmap/getmapdl.lua \
	glossaries/makeglossaries \
	glossaries/makeglossaries-lite.lua \
	hyperxmp/hyperxmp-add-bytecount.pl \
	jfmutil/jfmutil.pl \
	ketcindy/ketcindy.pl \
	kotex-utils/jamo-normalize.pl \
	kotex-utils/komkindex.pl \
	kotex-utils/ttf2kotexfont.pl \
	l3build/l3build.lua \
	latex-git-log/latex-git-log \
	latex-papersize/latex-papersize.py \
	latex2man/latex2man \
	latex2nemeth/latex2nemeth \
	latexdiff/latexdiff-vc.pl \
	latexdiff/latexdiff.pl \
	latexdiff/latexrevise.pl \
	latexindent/latexindent.pl \
	latexmk/latexmk.pl \
	latexpand/latexpand \
	light-latex-make/llmk.lua \
	lilyglyphs/lily-glyph-commands.py \
	lilyglyphs/lily-image-commands.py \
	lilyglyphs/lily-rebuild-pdfs.py \
	ltximg/ltximg.pl \
	luaotfload/luaotfload-tool.lua \
	lwarp/lwarpmk.lua \
	m-tx/m-tx.lua \
	makedtx/makedtx.pl \
	make4ht/make4ht \
	match_parens/match_parens \
	mathspic/mathspic.pl \
	mf2pt1/mf2pt1.pl \
	mkgrkindex/mkgrkindex \
	mkjobtexmf/mkjobtexmf.pl \
	mkpic/mkpic \
	multibibliography/multibibliography.pl \
	musixtex/musixflx.lua \
	musixtex/musixtex.lua \
	optexcount/optexcount \
	pax/pdfannotextractor.pl \
	pdfcrop/pdfcrop.pl \
	pdflatexpicscale/pdflatexpicscale.pl \
	pedigree-perl/pedigree.pl \
	perltex/perltex.pl \
	petri-nets/pn2pdf \
	pfarrei/a5toa4.tlu \
	pfarrei/pfarrei.tlu \
	pkfix-helper/pkfix-helper \
	pkfix/pkfix.pl \
	pmxchords/pmxchords.lua \
	pst2pdf/pst2pdf.pl \
	ptex-fontmaps/kanji-config-updmap-sys.sh \
	ptex-fontmaps/kanji-config-updmap-user.sh \
	ptex-fontmaps/kanji-config-updmap.pl \
	ptex-fontmaps/kanji-fontmap-creator.pl \
	ptex2pdf/ptex2pdf.lua \
	purifyeps/purifyeps \
	pygmentex/pygmentex.py \
	pythontex/depythontex.py \
	pythontex/pythontex.py \
	rubik/rubikrotation.pl \
	spix/spix.py \
	splitindex/splitindex.pl \
	srcredact/srcredact.pl \
	sty2dtx/sty2dtx.pl \
	svn-multi/svn-multi.pl \
	tex4ebook/tex4ebook \
	texcount/texcount.pl \
	texdef/texdef.pl \
	texdiff/texdiff \
	texdirflatten/texdirflatten \
	texdoc/texdoc.tlu \
	texfot/texfot.pl \
	texlive/fmtutil-sys.sh \
	texlive/fmtutil-user.sh \
	texlive/fmtutil.pl \
	texlive/mktexlsr \
	texlive/mktexmf \
	texlive/mktexpk \
	texlive/mktextfm \
	texlive/rungs.tlu \
	texlive/tlmgr.pl \
	texlive/updmap-sys.sh \
	texlive/updmap-user.sh \
	texlive/updmap.pl \
	texlive-extra/e2pall.pl \
	texliveonfly/texliveonfly.py \
	texloganalyser/texloganalyser \
	texplate/texplate.sh \
	thumbpdf/thumbpdf.pl \
	tlcockpit/tlcockpit.sh \
	tlshell/tlshell.tcl \
	ulqda/ulqda.pl \
	urlbst/urlbst \
	vpe/vpe.pl \
	webquiz/webquiz.py \
	xindex/xindex.lua \
	yplan/yplan

texmf_context_scripts = \
	context/stubs/unix/context \
	context/stubs/unix/contextjit \
	context/stubs/unix/luatools \
	context/stubs/unix/mtxrun \
	context/stubs/unix/mtxrunjit \
	context/stubs/unix/texexec \
	context/stubs/unix/texmfstart

EXTRA_DIST += \
	context/stubs/unix/ctxtools \
	context/stubs/unix/pstopdf

nobase_dist_texmf_scripts_SCRIPTS = \
	$(texmf_shell_scripts) \
	$(texmf_other_scripts) \
	$(texmf_context_scripts)

## Symlinks within $(bindir): FILE:LINK here means "ln -s FILE LINK" is done.
bin_links = \
	allcm:allec \
	cluttex:clxelatex \
	cluttex:cllualatex \
	epstopdf:repstopdf \
	fmtutil:mktexfmt \
	kpsetool:kpsexpand \
	kpsetool:kpsepath \
	mktexlsr:texhash \
	pdfcrop:rpdfcrop \
	texdef:latexdef

# 
# The idea is to install the scripts themselves in texmf*/scripts, and
# have bin/arch/foo be a symlink to, say,
# ../../texmf-dist/scripts/foo/foo.pl.  That way we save a bit of disk
# space, but more importantly omit duplication, and most
# importantly of all make it possible to invoke the same Perl script on
# Windows (see ../$(WIN_WRAPPER)).
#
# The installation into texmf*/scripts is ideally done with ctan2tl.
# The copy of the wrapper for Windows is also done by ctan2tl.  (And
# for shell scripts, its addition must be undone by hand.)  The
# check-wrapper-consistency script checks after the fact for problems.
#
# We also keep a copy of all the scripts here and install into the runtime.
# This is purely for other distro builders, so symlinks are not dangling in
# the inst/bin dir (it is meaningless in native TL).  We have not yet
# written the auto-update to ensure linked_scripts is actually up to date
# with the masters in Master/texmf*/scripts, but one day.
#
# We support native builds, multiplatform or not, as well as distro builds.
#
EXTRA_DIST += ../../../build-aux/relpath
relpath = $(SHELL) $(top_srcdir)/../../build-aux/relpath
runscript = $(top_srcdir)/$(WIN_WRAPPER)/runscript.exe
ctxscript = $(top_srcdir)/$(WIN_WRAPPER)/context/mtxrun.exe
install-data-hook: installdirs-local
if WIN32
	@for s in $(texmf_other_scripts); do \
	  t=`basename $$s | sed 's,\.[^/]*$$,,' | tr '[A-Z]' '[a-z]'`; \
	  echo "$(INSTALL_SCRIPT) '$(runscript)' '$(DESTDIR)$(bindir)/$$t.exe'"; \
	  $(INSTALL_SCRIPT) $(runscript) $(DESTDIR)$(bindir)/$$t.exe; \
	done
	$(INSTALL_SCRIPT) $(top_srcdir)/$(WIN_WRAPPER)/runscript.dll $(DESTDIR)$(bindir)
	$(INSTALL_SCRIPT) $(top_srcdir)/$(WIN_WRAPPER)/runscript.exe $(DESTDIR)$(bindir)
	$(INSTALL_SCRIPT) $(top_srcdir)/w32_wrapper/runscript.tlu $(DESTDIR)$(bindir)
	@for s in $(texmf_context_scripts); do \
	  t=`basename $$s | sed 's,\.[^/]*$$,,' | tr '[A-Z]' '[a-z]'`; \
	  echo "$(INSTALL_SCRIPT) '$(ctxscript)' '$(DESTDIR)$(bindir)/$$t.exe'"; \
	  $(INSTALL_SCRIPT) $(ctxscript) $(DESTDIR)$(bindir)/$$t.exe; \
	done
	$(INSTALL_SCRIPT) $(top_srcdir)/$(WIN_WRAPPER)/context/mtxrun.dll $(DESTDIR)$(bindir)
	$(INSTALL_SCRIPT) $(srcdir)/context/stubs/unix/mtxrun $(DESTDIR)$(bindir)/mtxrun.lua
	@for s in $(bin_links); do \
	  link=`echo $$s | sed 's,.*:,,'`; \
	  echo "$(INSTALL_SCRIPT) '$(runscript)' '$(DESTDIR)$(bindir)/$$link.exe'"; \
	  $(INSTALL_SCRIPT) $(runscript) $(DESTDIR)$(bindir)/$$link.exe || exit 1; \
	done
else !WIN32
## Name the link as the basename, removing any extension,
## except for listings-ext.sh, which is documented as that name.
## Downcase for the sake of TeXcount.pl -> texcount.
	@REL=`$(relpath) '$(DESTDIR)' '$(bindir)' '$(datarootdir)'`; \
	if test -z "$$REL"; then \
	  echo 'unable to compute relative path for linked scripts' >&2; \
	  exit 1; \
	fi; \
	cd $(DESTDIR)$(bindir) && \
	  for s in $(nobase_dist_texmf_scripts_SCRIPTS); do \
	    target=`basename $$s | tr '[A-Z]' '[a-z]'`; \
	    echo "$$s" | grep listings-ext.sh >/dev/null \
	    || target=`echo $$target | sed 's,\.[^/]*$$,,'`; \
	    rm -f $$target; \
	    echo "creating link '$$target' -> '$$REL/texmf-dist/scripts/$$s'"; \
	    $(LN_S) $$REL/texmf-dist/scripts/$$s $$target || exit 1; \
	  done && \
	  for s in $(bin_links); do \
	    link=`echo $$s | sed 's,.*:,,'`; \
	    file=`echo $$s | sed 's,:.*,,'`; \
	    rm -f $$link; \
	    echo "creating link '$$link' -> '$$file'"; \
	    $(LN_S) $$file $$link || exit 1; \
	  done && \
## man dir link for those mans which can use it, but don't overwrite a
## real file, e.g., /usr/bin/man.
	  if test -d "$$REL/texmf-dist/doc/man" \
	     && test -z "$(TL_INSTALL_OMIT_MAN_LINK)" \
	     && (test -h man || test ! -e man); then \
	    echo "creating link 'man' -> '$$REL/texmf-dist/doc/man'"; \
	    rm -f man; \
	    (ln -s "$$REL/texmf-dist/doc/man" man || :); \
	  else :; fi
endif !WIN32

.PHONY: install-links
install-links:

## For WIN32 (MinGW or native) we have wrapper binaries with .exe,
## for Cygwin and Unix we have symlinks without .exe.
if WIN32
WINEXT = $(EXEEXT)
endif WIN32

uninstall-hook:
	@for s in $(nobase_dist_texmf_scripts_SCRIPTS); do \
	  target=`basename $$s | tr '[A-Z]' '[a-z]'`; \
	  echo "$$s" | grep listings-ext.sh >/dev/null \
	  || target=`echo $$target | sed 's,\.[^/]*$$,,'`; \
	  rm -f $(DESTDIR)$(bindir)/$$target$(WINEXT); \
	done
	@for s in $(bin_links); do \
	  link=`echo $$s | sed 's,.*:,,'`; \
	  rm -f $(DESTDIR)$(bindir)/$$link$(WINEXT); \
	done
if !WIN32
	if test -h $(DESTDIR)$(bindir)/man; then \
	  rm -f $(DESTDIR)$(bindir)/man; \
	else :; fi
endif !WIN32

## 
## This target is invoked by check-wrapper-consistency (run from cron).
.PHONY: echo-shell-scripts
shell_scripts = $(texmf_shell_scripts) $(texmf_context_scripts)
echo-shell-scripts:
	@echo $(shell_scripts)