Debian Codegraph @

texk/texlive/linked_scripts/Makefile.am

raw
1 ## $Id: Makefile.am 78217 2026-03-01 02:26:07Z karl $
2 ## Makefile.am for the TeX Live subdirectory texk/texlive/linked_scripts/
3 ##
4 ## Copyright 2016-2025 Karl Berry <[email protected]>
5 ## Copyright 2009-2015 Peter Breitenlohner <[email protected]>
6 ## You may freely use, modify and/or distribute this file.
7 ##
8 ## TeX Live's extra scripts.
9
10 # Build lists of scripts.
11 scripts-list: Makefile
12 @echo "Create $@"
13 @echo "texmf_scripts='" >$@
14 @for f in $(nobase_dist_texmf_scripts_SCRIPTS); do echo "$$f"; done >>$@
15 @echo "'" >>$@
16 cmp -s $(srcdir)/scripts.lst $@ || cp -f $@ $(srcdir)/scripts.lst
17
18 # Hard to remember the target name different from final file name.
19 scripts-lst:
20 $(MAKE) scripts-list
21
22 if MAINTAINER_MODE
23 all-local: scripts-list
24 else !MAINTAINER_MODE
25 all-local:
26 endif !MAINTAINER_MODE
27
28 DISTCLEANFILES = scripts-list
29
30 EXTRA_DIST = scripts.lst
31
32 ## Make sure $(bindir) exists
33 ##
34 installdirs-local:
35 $(MKDIR_P) $(DESTDIR)$(bindir)
36
37 # Copies of these scripts exist here for the sake of avoiding
38 # dangling symlinks produced by `make install'.
39 # The instances in texmf* are the masters (except when it is CTAN).
40 #
41 ## We distinguish classes of scripts: `shell' and `other'.
42 ##
43 ## On Unix systems a symlink from $(bindir) to the script is installed
44 ## for all of them; on Windows nothing is installed in $(bindir) for
45 ## `shell' scripts whereas for `other' (usually perl, lua, ...) scripts
46 ## the standard wrapper ../$(WIN_WRAPPER)/runscript.exe is installed.
47 ##
48 ## WIN_WRAPPER is windows_wrapper (64-bit).
49 ##
50 ## The "shell" list aren't just shell scripts, in either direction. Some
51 ## /bin/sh scripts are listed as `other' scripts because they are
52 ## correctly handled by the wrapper binaries. Conversely, some non-sh
53 ## scripts are listed as `shell' because they depend on shell scripts or
54 ## otherwise aren't useful on Windows.
55 ##
56 texmf_scriptsdir = $(datarootdir)/texmf-dist/scripts
57 texmf_shell_scripts = \
58 adhocfilelist/adhocfilelist.sh \
59 bibexport/bibexport.sh \
60 checklistings/checklistings.sh \
61 ctanbib/ctanbib \
62 dtxgen/dtxgen \
63 git-latexdiff/git-latexdiff \
64 installfont/installfont-tl \
65 latexfileversion/latexfileversion \
66 listbib/listbib \
67 listings-ext/listings-ext.sh \
68 ltxfileinfo/ltxfileinfo \
69 pagelayout/pagelayoutapi \
70 pagelayout/textestvis \
71 pdfbook2/pdfbook2 \
72 pdfjam/pdfjam \
73 pdftex-quiet/pdftex-quiet \
74 pdfxup/pdfxup \
75 pst-pdf/ps4pdf \
76 simpdftex/simpdftex \
77 texaccents/texaccents.sno \
78 texlive-extra/allcm.sh \
79 texlive-extra/allneeded.sh \
80 texlive-extra/dvi2fax.sh \
81 texlive-extra/dvired.sh \
82 texlive-extra/fontinst.sh \
83 texlive-extra/kpsetool.sh \
84 texlive-extra/kpsewhere.sh \
85 texlive-extra/ps2frag.sh \
86 texlive-extra/pslatex.sh \
87 texlive-extra/rubibtex.sh \
88 texlive-extra/rumakeindex.sh \
89 texlive-extra/texconfig-dialog.sh \
90 texlive-extra/texconfig-sys.sh \
91 texlive-extra/texconfig.sh \
92 texlive-extra/texlinks.sh \
93 texlive-extra/xetex-unsafe.sh \
94 texlive-extra/xelatex-unsafe.sh \
95 texosquery/texosquery.sh \
96 texosquery/texosquery-jre5.sh \
97 texosquery/texosquery-jre8.sh \
98 tikztosvg/tikztosvg \
99 typeoutfileinfo/typeoutfileinfo.sh \
100 wordcount/wordcount.sh
101
102 #
103 texmf_other_scripts = \
104 a2ping/a2ping.pl \
105 accfonts/mkt1font \
106 accfonts/vpl2ovp \
107 accfonts/vpl2vpl \
108 albatross/albatross.sh \
109 aomart/aom-fullref.pl \
110 arara/arara.sh \
111 attachfile2/pdfatfi.pl \
112 authorindex/authorindex \
113 bib2gls/bib2gls.sh \
114 bib2gls/convertgls2bib.sh \
115 bib2gls/datatool2bib.sh \
116 bibcop/bibcop.pl \
117 bibtexperllibs/ltx2unitxt \
118 bookshelf/bookshelf-listallfonts \
119 bookshelf/bookshelf-mkfontsel \
120 bundledoc/arlatex \
121 bundledoc/bundledoc \
122 cachepic/cachepic.tlu \
123 checkcites/checkcites.lua \
124 citation-style-language/citeproc-lua.lua \
125 chklref/chklref.pl \
126 cjk-gs-integrate/cjk-gs-integrate.pl \
127 clojure-pamphlet/pamphletangler \
128 cluttex/cluttex.lua \
129 context/perl/mptopdf.pl \
130 convbkmk/convbkmk.rb \
131 crossrefware/bbl2bib.pl \
132 crossrefware/bibdoiadd.pl \
133 crossrefware/bibmradd.pl \
134 crossrefware/biburl2doi.pl \
135 crossrefware/bibzbladd.pl \
136 crossrefware/ltx2crossrefxml.pl \
137 ctan-o-mat/ctan-o-mat.pl \
138 ctanify/ctanify \
139 ctanupload/ctanupload.pl \
140 de-macro/de-macro \
141 diadia/diadia.lua \
142 digestif/digestif.texlua \
143 dosepsbin/dosepsbin.pl \
144 dviasm/dviasm.py \
145 dviinfox/dviinfox.pl \
146 easydtx/edtx2dtx.pl \
147 ebong/ebong.py \
148 eolang/eolang.pl \
149 epspdf/epspdf.tlu \
150 epspdf/epspdftk.tcl \
151 epstopdf/epstopdf.pl \
152 exceltex/exceltex \
153 expltools/explcheck.lua \
154 extractbb/extractbb.lua \
155 fig4latex/fig4latex \
156 findhyph/findhyph \
157 fontools/afm2afm \
158 fontools/autoinst \
159 fontools/ot2kpx \
160 fragmaster/fragmaster.pl \
161 getmap/getmapdl.lua \
162 glossaries/makeglossaries \
163 glossaries/makeglossaries-lite.lua \
164 hyperxmp/hyperxmp-add-bytecount.pl \
165 jfmutil/jfmutil.pl \
166 ketcindy/ketcindy.pl \
167 kotex-utils/jamo-normalize.pl \
168 kotex-utils/komkindex.pl \
169 kotex-utils/ttf2kotexfont.pl \
170 l3build/l3build.lua \
171 l3sys-query/l3sys-query.lua \
172 latex-git-log/latex-git-log \
173 latex-papersize/latex-papersize.py \
174 latex2man/latex2man \
175 latex2nemeth/latex2nemeth \
176 latexdiff/latexdiff-vc.pl \
177 latexdiff/latexdiff.pl \
178 latexdiff/latexrevise.pl \
179 latexindent/latexindent.pl \
180 latexmk/latexmk.pl \
181 latexpand/latexpand \
182 light-latex-make/llmk.lua \
183 lilyglyphs/lily-glyph-commands.py \
184 lilyglyphs/lily-image-commands.py \
185 lilyglyphs/lily-rebuild-pdfs.py \
186 ltximg/ltximg.pl \
187 luafindfont/luafindfont.lua \
188 luaotfload/luaotfload-tool.lua \
189 lwarp/lwarpmk.lua \
190 makedtx/makedtx.pl \
191 make4ht/make4ht \
192 markdown/markdown2tex.lua \
193 match_parens/match_parens \
194 mathspic/mathspic.pl \
195 memoize/memoize-clean.pl \
196 memoize/memoize-clean.py \
197 memoize/memoize-extract.pl \
198 memoize/memoize-extract.py \
199 mf2pt1/mf2pt1.pl \
200 minted/latexminted.py \
201 mkgrkindex/mkgrkindex \
202 mkjobtexmf/mkjobtexmf.pl \
203 mkpic/mkpic \
204 multibibliography/multibibliography.pl \
205 musixtex/musixflx.lua \
206 musixtex/musixtex.lua \
207 optexcount/optexcount \
208 pax/pdfannotextractor.pl \
209 pdfcrop/pdfcrop.pl \
210 pdflatexpicscale/pdflatexpicscale.pl \
211 pedigree-perl/pedigree.pl \
212 perltex/perltex.pl \
213 petri-nets/pn2pdf \
214 pfarrei/a5toa4.tlu \
215 pfarrei/pfarrei.tlu \
216 pkfix-helper/pkfix-helper \
217 pkfix/pkfix.pl \
218 pmxchords/pmxchords.lua \
219 ppmcheckpdf/ppmcheckpdf.lua \
220 pst2pdf/pst2pdf.pl \
221 ptex-fontmaps/kanji-config-updmap-sys.sh \
222 ptex-fontmaps/kanji-config-updmap-user.sh \
223 ptex-fontmaps/kanji-config-updmap.pl \
224 ptex-fontmaps/kanji-fontmap-creator.pl \
225 ptex2pdf/ptex2pdf.lua \
226 purifyeps/purifyeps \
227 pygmentex/pygmentex.py \
228 pythontex/depythontex.py \
229 pythontex/pythontex.py \
230 rubik/rubikrotation.pl \
231 runtexfile/runtexfile.lua \
232 runtexshebang/runtexshebang.lua \
233 show-pdf-tags/show-pdf-tags.lua \
234 spix/spix.py \
235 splitindex/splitindex.pl \
236 sqltex/sqltex \
237 srcredact/srcredact.pl \
238 sty2dtx/sty2dtx.pl \
239 svn-multi/svn-multi.pl \
240 tex4ebook/tex4ebook \
241 texblend/texblend \
242 texcount/texcount.pl \
243 texdef/texdef.pl \
244 texdiff/texdiff \
245 texdirflatten/texdirflatten \
246 texfindpkg/texfindpkg.lua \
247 texdoc/texdoc.tlu \
248 texfot/texfot.pl \
249 texlive/fmtutil-sys.sh \
250 texlive/fmtutil-user.sh \
251 texlive/fmtutil.pl \
252 texlive/mktexlsr \
253 texlive/mktexmf \
254 texlive/mktexpk \
255 texlive/mktextfm \
256 texlive/rungs.lua \
257 texlive/tlmgr.pl \
258 texlive/updmap-sys.sh \
259 texlive/updmap-user.sh \
260 texlive/updmap.pl \
261 texlive-extra/e2pall.pl \
262 texliveonfly/texliveonfly.py \
263 texloganalyser/texloganalyser \
264 texlogfilter/texlogfilter \
265 texlogsieve/texlogsieve \
266 texplate/texplate.sh \
267 thumbpdf/thumbpdf.pl \
268 tlcockpit/tlcockpit.sh \
269 tlshell/tlshell.tcl \
270 typog/typog-grep.pl \
271 ulqda/ulqda.pl \
272 urlbst/urlbst \
273 vpe/vpe.pl \
274 webquiz/webquiz.py \
275 xindex/xindex.lua \
276 yplan/yplan
277
278 nobase_dist_texmf_scripts_SCRIPTS = \
279 $(texmf_shell_scripts) \
280 $(texmf_other_scripts)
281
282 ## Symlinks within $(bindir): FILE:LINK here means "ln -s FILE LINK" is done.
283 bin_links = \
284 allcm:allec \
285 cluttex:clxelatex \
286 cluttex:cllualatex \
287 epstopdf:repstopdf \
288 extractbb:ebb \
289 fmtutil:mktexfmt \
290 kpsetool:kpsexpand \
291 kpsetool:kpsepath \
292 mktexlsr:texhash \
293 pdfcrop:rpdfcrop \
294 texdef:latexdef
295
296 #
297 # The idea is to install the scripts themselves in texmf*/scripts, and
298 # have bin/arch/foo be a symlink to, say,
299 # ../../texmf-dist/scripts/foo/foo.pl. That way we save a bit of disk
300 # space, but more importantly omit duplication, and most
301 # importantly of all make it possible to invoke the same Perl script on
302 # Windows (see ../$(WIN_WRAPPER)).
303 #
304 # The installation into texmf*/scripts is ideally done with ctan2tl.
305 # The copy of the wrapper for Windows is also done by ctan2tl. (And
306 # for shell scripts, its addition must be undone by hand.) The
307 # check-wrapper-consistency script checks after the fact for problems.
308 #
309 # We also keep a copy of all the scripts here and install into the runtime.
310 # This is purely for other distro builders, so symlinks are not dangling in
311 # the inst/bin dir (it is meaningless in native TL). We have not yet
312 # written the auto-update to ensure linked_scripts is actually up to date
313 # with the masters in Master/texmf*/scripts, but one day.
314 #
315 # We support native builds, multiplatform or not, as well as distro builds.
316 #
317 EXTRA_DIST += ../../../build-aux/relpath
318 relpath = $(SHELL) $(top_srcdir)/../../build-aux/relpath
319 runscript = $(top_srcdir)/$(WIN_WRAPPER)/runscript.exe
320
321 # Make a copy of all targets and link names, for distros etc., so they
322 # don't have to duplicate the special cases for memoize* etc. below. It
323 # would be cleaner to make the file and then use it in both the install
324 # and uninstall hooks, but we'll leave that for another time.
325 linkfile = $(abs_builddir)/scripts-targets.lst
326
327 install-data-hook: installdirs-local
328 if WIN32
329 @for s in $(texmf_other_scripts); do \
330 t=`basename $$s | sed 's,\.[^/]*$$,,' | tr '[A-Z]' '[a-z]'`; \
331 echo "$(INSTALL_SCRIPT) '$(runscript)' '$(DESTDIR)$(bindir)/$$t.exe'"; \
332 $(INSTALL_SCRIPT) $(runscript) $(DESTDIR)$(bindir)/$$t.exe; \
333 done
334 $(INSTALL_SCRIPT) $(top_srcdir)/$(WIN_WRAPPER)/runscript.dll $(DESTDIR)$(bindir)
335 $(INSTALL_SCRIPT) $(top_srcdir)/$(WIN_WRAPPER)/runscript.exe $(DESTDIR)$(bindir)
336 $(INSTALL_SCRIPT) $(top_srcdir)/$(WIN_WRAPPER)/runscript.tlu $(DESTDIR)$(bindir)
337 else !WIN32
338 >$(linkfile)
339 # Name the link as the basename, removing any extension,
340 # except for memoize* and listings-ext.sh, which are documented to be
341 # used with extension. Downcase for the sake of TeXcount.pl -> texcount.
342 # Unfortunately this logic is duplicated in uninstall-hook.
343 @REL=`$(relpath) '$(DESTDIR)' '$(bindir)' '$(datarootdir)'`; \
344 if test -z "$$REL"; then \
345 echo 'unable to compute relative path for linked scripts' >&2; \
346 exit 1; \
347 fi; \
348 cd $(DESTDIR)$(bindir) && \
349 for s in $(nobase_dist_texmf_scripts_SCRIPTS); do \
350 target=`basename $$s | tr '[A-Z]' '[a-z]'`; \
351 ## We can't portably use fgrep or egrep or grep -E or ere patterns,
352 ## since the [ef]grep in GNU grep issues gratuitous warnings.
353 echo "$$s" | grep 'memoize-.*\.' >/dev/null \
354 || echo "$$s" | grep 'listings-ext.sh' >/dev/null \
355 || target=`echo $$target | sed 's,\.[^/]*$$,,'`; \
356 rm -f $$target; \
357 echo "creating link '$$target' -> '$$REL/texmf-dist/scripts/$$s'";\
358 $(LN_S) $$REL/texmf-dist/scripts/$$s $$target || exit 1; \
359 echo texmf-dist/scripts/$$s $$target >>$(linkfile); \
360 done && \
361 for s in $(bin_links); do \
362 link=`echo $$s | sed 's,.*:,,'`; \
363 file=`echo $$s | sed 's,:.*,,'`; \
364 rm -f $$link; \
365 echo "creating bin link '$$link' -> '$$file'"; \
366 $(LN_S) $$file $$link || exit 1; \
367 echo $$file $$link >>$(linkfile); \
368 done && \
369 ## man dir link for those mans which can use it, but don't overwrite a
370 ## real file, e.g., /usr/bin/man.
371 if test -d "$$REL/texmf-dist/doc/man" \
372 && test -z "$(TL_INSTALL_OMIT_MAN_LINK)" \
373 && (test -h man || test ! -e man); then \
374 echo "creating link 'man' -> '$$REL/texmf-dist/doc/man'"; \
375 rm -f man; \
376 (ln -s "$$REL/texmf-dist/doc/man" man || :); \
377 else :; fi
378 # If we got to the end, update the $(linkfile) in srcdir if needed.
379 cmp -s $(srcdir)/`basename $(linkfile)` $(linkfile) \
380 || cp -f $(linkfile) $(srcdir)/`basename $(linkfile)`
381 endif !WIN32
382
383 .PHONY: install-links
384 install-links:
385
386 #
387 # For WIN32 (MinGW or native) we have wrapper binaries with .exe,
388 # for Cygwin and Unix we have symlinks without .exe.
389 if WIN32
390 WINEXT = $(EXEEXT)
391 endif WIN32
392
393 uninstall-hook:
394 @for s in $(nobase_dist_texmf_scripts_SCRIPTS); do \
395 target=`basename $$s | tr '[A-Z]' '[a-z]'`; \
396 echo "$$s" | grep 'memoize-.*\.' >/dev/null \
397 || echo "$$s" | grep 'listings-ext.sh' >/dev/null \
398 || target=`echo $$target | sed 's,\.[^/]*$$,,'`; \
399 rm -f $(DESTDIR)$(bindir)/$$target$(WINEXT); \
400 done
401 @for s in $(bin_links); do \
402 link=`echo $$s | sed 's,.*:,,'`; \
403 rm -f $(DESTDIR)$(bindir)/$$link$(WINEXT); \
404 done
405 if !WIN32
406 if test -h $(DESTDIR)$(bindir)/man; then \
407 rm -f $(DESTDIR)$(bindir)/man; \
408 else :; fi
409 endif !WIN32
410
411 #
412 # This target is invoked by tl-check-wrapper-consistency (run from cron).
413 .PHONY: echo-shell-scripts
414 shell_scripts = $(texmf_shell_scripts)
415 echo-shell-scripts:
416 @echo $(shell_scripts)
417
418 # just a shorter name for all the scripts for convenience.
419 all_scripts = $(nobase_dist_texmf_scripts_SCRIPTS)
420
421 # Compare the list of scripts to the extant files in the repo;
422 # should be exactly the same. Run from cron.
423 check-make-vs-files:
424 # We descend two levels here because of context/perl/mptopdf.pl.
425 find "$(srcdir)"/*/* -type f | sed "s,$(srcdir)/,," | sort \
426 >tmplist.files
427 echo $(all_scripts) | tr ' ' '\n' | sort >tmplist.make
428 comm -3 tmplist.files tmplist.make