1 ## Makefile.am for the TeX Live subdirectory texk/texlive/linked_scripts/
3 ## Copyright (C) 2016 Karl Berry <tex-live@tug.org>
4 ## Copyright (C) 2009-2015 Peter Breitenlohner <tex-live@tug.org>
5 ## You may freely use, modify and/or distribute this file.
7 ## TeX Live's extra scripts.
9 ## Build lists of texmf and texmf-dist scripts.
11 scripts-list: Makefile
13 @echo "texmf_scripts='" >$@
14 @for f in $(nobase_dist_texmf_scripts_SCRIPTS); do echo "$$f"; done >>$@
16 cmp -s $(srcdir)/scripts.lst $@ || cp -f $@ $(srcdir)/scripts.lst
19 all-local: scripts-list
22 endif !MAINTAINER_MODE
24 DISTCLEANFILES = scripts-list
26 EXTRA_DIST = scripts.lst
28 ## Make sure $(bindir) exists
31 $(MKDIR_P) $(DESTDIR)$(bindir)
33 # Copies of these scripts exist here for the sake of avoiding
34 # dangling symlinks produced by `make install'.
35 # The instances in texmf* are the masters (except when it is CTAN).
37 ## We distinguish several classes of scripts according to their
38 ## type: `shell', `context', or `other'.
40 ## On Unix systems a symlink from $(bindir) to the script is installed
41 ## for all of them; on Windows nothing is installed in $(bindir) for
42 ## `shell' scripts whereas for `other' (usually perl, lua, ...) scripts
43 ## the standard wrapper ../$(WIN_WRAPPER)/runscript.exe is installed or
44 ## the ConTeXt wrapper ../$(WIN_WRAPPER)/context/mtxrun.exe for
47 ## WIN_WRAPPER is w32_wrapper for 32-bit or w64_wrapper for 64-bit.
49 ## Some /bin/sh scripts are listed as `other' or `context'
50 ## scripts because they are correctly handled by the wrapper binaries.
51 ## Conversely, some non-sh scripts are listed as `shell' because they
52 ## depend on shell scripts or otherwise aren't useful on Windows.
54 texmf_scriptsdir = $(datarootdir)/texmf-dist/scripts
55 texmf_shell_scripts = \
56 adhocfilelist/adhocfilelist.sh \
57 bibexport/bibexport.sh \
58 checklistings/checklistings.sh \
60 installfont/installfont-tl \
61 latexfileversion/latexfileversion \
63 listings-ext/listings-ext.sh \
64 ltxfileinfo/ltxfileinfo \
65 lua2dox/lua2dox_filter \
73 pdfjam/pdfjam-pocketmod \
74 pdfjam/pdfjam-slides3up \
75 pdfjam/pdfjam-slides6up \
81 typeoutfileinfo/typeoutfileinfo.sh
82 texmf_other_scripts = \
88 authorindex/authorindex \
91 cachepic/cachepic.tlu \
92 checkcites/checkcites.lua \
93 cjk-gs-integrate/cjk-gs-integrate.pl \
94 context/perl/mptopdf.pl \
95 convbkmk/convbkmk.rb \
96 crossrefware/bibdoiadd.pl \
97 crossrefware/bibzbladd.pl \
98 crossrefware/ltx2crossrefxml.pl \
100 ctanupload/ctanupload.pl \
103 dosepsbin/dosepsbin.pl \
107 epspdf/epspdftk.tcl \
108 epstopdf/epstopdf.pl \
110 fig4latex/fig4latex \
115 fragmaster/fragmaster.pl \
116 getmap/getmapdl.lua \
117 glossaries/makeglossaries \
118 glossaries/makeglossaries-lite.lua \
119 jfontmaps/kanji-config-updmap-sys.sh \
120 jfontmaps/kanji-config-updmap.pl \
121 jfontmaps/kanji-fontmap-creator.pl \
122 kotex-utils/jamo-normalize.pl \
123 kotex-utils/komkindex.pl \
124 kotex-utils/ttf2kotexfont.pl \
125 latex-git-log/latex-git-log \
126 latex2man/latex2man \
127 latexdiff/latexdiff-vc.pl \
128 latexdiff/latexdiff.pl \
129 latexdiff/latexrevise.pl \
130 latexindent/latexindent.pl \
132 latexpand/latexpand \
133 lilyglyphs/lily-glyph-commands.py \
134 lilyglyphs/lily-image-commands.py \
135 lilyglyphs/lily-rebuild-pdfs.py \
137 luaotfload/luaotfload-tool.lua \
140 match_parens/match_parens \
141 mathspic/mathspic.pl \
143 mkgrkindex/mkgrkindex \
144 mkjobtexmf/mkjobtexmf.pl \
146 multibibliography/multibibliography.pl \
147 musixtex/musixflx.lua \
148 musixtex/musixtex.lua \
149 oberdiek/pdfatfi.pl \
150 pax/pdfannotextractor.pl \
152 pedigree-perl/pedigree.pl \
156 pfarrei/pfarrei.tlu \
157 pkfix-helper/pkfix-helper \
159 pmxchords/pmxchords.lua \
161 ptex2pdf/ptex2pdf.lua \
162 purifyeps/purifyeps \
163 pygmentex/pygmentex.py \
164 pythontex/depythontex.py \
165 pythontex/pythontex.py \
166 rubik/rubikrotation.pl \
167 splitindex/splitindex.pl \
168 srcredact/srcredact.pl \
170 svn-multi/svn-multi.pl \
171 tex4ebook/tex4ebook \
172 texcount/texcount.pl \
175 texdirflatten/texdirflatten \
178 texlive/fmtutil-sys.sh \
182 texlive/updmap-sys.sh \
184 texliveonfly/texliveonfly.py \
185 texloganalyser/texloganalyser \
186 thumbpdf/thumbpdf.pl \
191 texmf_context_scripts = \
192 context/stubs/unix/context \
193 context/stubs/unix/contextjit \
194 context/stubs/unix/luatools \
195 context/stubs/unix/mtxrun \
196 context/stubs/unix/mtxrunjit \
197 context/stubs/unix/texexec \
198 context/stubs/unix/texmfstart
201 context/stubs/unix/ctxtools \
202 context/stubs/unix/pstopdf
204 nobase_dist_texmf_scripts_SCRIPTS = \
205 $(texmf_shell_scripts) \
206 $(texmf_other_scripts) \
207 $(texmf_context_scripts)
209 ## Symlinks within $(bindir): FILE:LINK indicates LINK->FILE
214 # The idea is to install the scripts themselves in texmf*/scripts, and
215 # have bin/arch/foo be a symlink to, say,
216 # ../../texmf-dist/scripts/foo/foo.pl. That way we save a bit of disk
217 # space, but more importantly omit duplication, and most
218 # importantly of all make it possible to invoke the same Perl script on
219 # Windows (see ../$(WIN_WRAPPER)).
221 # The installation into texmf*/scripts is ideally done with ctan2tl.
222 # The copy of the wrapper for Windows is also done by ctan2tl. (And
223 # for shell scripts, its addition must be undone by hand.) The
224 # check-wrapper-consistency script checks after the fact for problems.
226 # We also keep a copy of all the scripts here and install into the runtime.
227 # This is purely for other distro builders, so symlinks are not dangling in
228 # the inst/bin dir (it is meaningless in native TL). We have not yet
229 # written the auto-update to ensure linked_scripts is actually up to date
230 # with the masters in Master/texmf*/scripts, but one day.
232 # We support native builds, multiplatform or not, as well as distro builds.
234 EXTRA_DIST += ../../../build-aux/relpath
235 relpath = $(SHELL) $(top_srcdir)/../../build-aux/relpath
236 runscript = $(top_srcdir)/$(WIN_WRAPPER)/runscript.exe
237 ctxscript = $(top_srcdir)/$(WIN_WRAPPER)/context/mtxrun.exe
238 install-data-hook: installdirs-local
240 @for s in $(texmf_other_scripts); do \
241 t=`basename $$s | sed 's,\.[^/]*$$,,' | tr '[A-Z]' '[a-z]'`; \
242 echo "$(INSTALL_SCRIPT) '$(runscript)' '$(DESTDIR)$(bindir)/$$t.exe'"; \
243 $(INSTALL_SCRIPT) $(runscript) $(DESTDIR)$(bindir)/$$t.exe; \
245 $(INSTALL_SCRIPT) $(top_srcdir)/$(WIN_WRAPPER)/runscript.dll $(DESTDIR)$(bindir)
246 $(INSTALL_SCRIPT) $(top_srcdir)/$(WIN_WRAPPER)/runscript.exe $(DESTDIR)$(bindir)
247 $(INSTALL_SCRIPT) $(top_srcdir)/w32_wrapper/runscript.tlu $(DESTDIR)$(bindir)
248 @for s in $(texmf_context_scripts); do \
249 t=`basename $$s | sed 's,\.[^/]*$$,,' | tr '[A-Z]' '[a-z]'`; \
250 echo "$(INSTALL_SCRIPT) '$(ctxscript)' '$(DESTDIR)$(bindir)/$$t.exe'"; \
251 $(INSTALL_SCRIPT) $(ctxscript) $(DESTDIR)$(bindir)/$$t.exe; \
253 $(INSTALL_SCRIPT) $(top_srcdir)/$(WIN_WRAPPER)/context/mtxrun.dll $(DESTDIR)$(bindir)
254 $(INSTALL_SCRIPT) $(srcdir)/context/stubs/unix/mtxrun $(DESTDIR)$(bindir)/mtxrun.lua
255 @for s in $(bin_links); do \
256 link=`echo $$s | sed 's,.*:,,'`; \
257 echo "$(INSTALL_SCRIPT) '$(runscript)' '$(DESTDIR)$(bindir)/$$link.exe'"; \
258 $(INSTALL_SCRIPT) $(runscript) $(DESTDIR)$(bindir)/$$link.exe || exit 1; \
261 ## Name the link as the basename, removing any extension,
262 ## except for listings-ext.sh, which is documented as that name.
263 ## Downcase for the sake of TeXcount.pl -> texcount.
264 @REL=`$(relpath) '$(DESTDIR)' '$(bindir)' '$(datarootdir)'`; \
265 if test -z "$$REL"; then \
266 echo 'unable to compute relative path for linked scripts' >&2; \
269 cd $(DESTDIR)$(bindir) && \
270 for s in $(nobase_dist_texmf_scripts_SCRIPTS); do \
271 target=`basename $$s | tr '[A-Z]' '[a-z]'`; \
272 echo "$$s" | grep listings-ext.sh >/dev/null \
273 || target=`echo $$target | sed 's,\.[^/]*$$,,'`; \
275 echo "creating link '$$target' -> '$$REL/texmf-dist/scripts/$$s'"; \
276 $(LN_S) $$REL/texmf-dist/scripts/$$s $$target || exit 1; \
278 for s in $(bin_links); do \
279 link=`echo $$s | sed 's,.*:,,'`; \
280 file=`echo $$s | sed 's,:.*,,'`; \
282 echo "creating link '$$link' -> '$$file'"; \
283 $(LN_S) $$file $$link || exit 1; \
285 ## man dir link for those mans which can use it, but don't overwrite a
286 ## real file, e.g., /usr/bin/man.
287 if test -d "$$REL/texmf-dist/doc/man" \
288 && test -z "$(TL_INSTALL_OMIT_MAN_LINK)" \
289 && (test -h man || test ! -e man); then \
290 echo "creating link 'man' -> '$$REL/texmf-dist/doc/man'"; \
292 (ln -s "$$REL/texmf-dist/doc/man" man || :); \
296 .PHONY: install-links
299 ## For WIN32 (MinGW or native) we have wrapper binaries with .exe,
300 ## for Cygwin and Unix we have symlinks without .exe.
306 @for s in $(nobase_dist_texmf_scripts_SCRIPTS); do \
307 target=`basename $$s | tr '[A-Z]' '[a-z]'`; \
308 echo "$$s" | grep listings-ext.sh >/dev/null \
309 || target=`echo $$target | sed 's,\.[^/]*$$,,'`; \
310 rm -f $(DESTDIR)$(bindir)/$$target$(WINEXT); \
312 @for s in $(bin_links); do \
313 link=`echo $$s | sed 's,.*:,,'`; \
314 rm -f $(DESTDIR)$(bindir)/$$link$(WINEXT); \
317 if test -h $(DESTDIR)$(bindir)/man; then \
318 rm -f $(DESTDIR)$(bindir)/man; \
323 ## This target is invoked by check-wrapper-consistency (run from cron).
324 .PHONY: echo-shell-scripts
325 shell_scripts = $(texmf_shell_scripts) $(texmf_context_scripts)
327 @echo $(shell_scripts)