sync with TeXLive rev. 40422
[luatex.git] / source / texk / texlive / linked_scripts / Makefile.am
blobe6347ac8ed2c3d774dcbf09a94617e8d957f0c5c
1 ## Makefile.am for the TeX Live subdirectory texk/texlive/linked_scripts/
2 ##
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.
6 ##
7 ## TeX Live's extra scripts.
9 ## Build lists of texmf and texmf-dist 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
18 if MAINTAINER_MODE
19 all-local: scripts-list
20 else !MAINTAINER_MODE
21 all-local:
22 endif !MAINTAINER_MODE
24 DISTCLEANFILES = scripts-list
26 EXTRA_DIST = scripts.lst
28 ## Make sure $(bindir) exists
30 installdirs-local:
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'.
39 ## 
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
45 ## `context' scripts.
47 ## WIN_WRAPPER is w32_wrapper for 32-bit or w64_wrapper for 64-bit.
48 ## 
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.
53 ## 
54 texmf_scriptsdir = $(datarootdir)/texmf-dist/scripts
55 texmf_shell_scripts = \
56         adhocfilelist/adhocfilelist.sh \
57         bibexport/bibexport.sh \
58         checklistings/checklistings.sh \
59         dtxgen/dtxgen \
60         installfont/installfont-tl \
61         latexfileversion/latexfileversion \
62         listbib/listbib \
63         listings-ext/listings-ext.sh \
64         ltxfileinfo/ltxfileinfo \
65         lua2dox/lua2dox_filter \
66         pdfbook2/pdfbook2 \
67         pdfjam/pdf180 \
68         pdfjam/pdf270 \
69         pdfjam/pdf90 \
70         pdfjam/pdfbook \
71         pdfjam/pdfflip \
72         pdfjam/pdfjam \
73         pdfjam/pdfjam-pocketmod \
74         pdfjam/pdfjam-slides3up \
75         pdfjam/pdfjam-slides6up \
76         pdfjam/pdfjoin \
77         pdfjam/pdfnup \
78         pdfjam/pdfpun \
79         pst-pdf/ps4pdf \
80         simpdftex/simpdftex \
81         typeoutfileinfo/typeoutfileinfo.sh
82 texmf_other_scripts = \
83         a2ping/a2ping.pl \
84         accfonts/mkt1font \
85         accfonts/vpl2ovp \
86         accfonts/vpl2vpl \
87         arara/arara.sh \
88         authorindex/authorindex \
89         bundledoc/arlatex \
90         bundledoc/bundledoc \
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 \
99         ctanify/ctanify \
100         ctanupload/ctanupload.pl \
101         de-macro/de-macro \
102         diadia/diadia.lua \
103         dosepsbin/dosepsbin.pl \
104         dviasm/dviasm.py \
105         ebong/ebong.py \
106         epspdf/epspdf.tlu \
107         epspdf/epspdftk.tcl \
108         epstopdf/epstopdf.pl \
109         exceltex/exceltex \
110         fig4latex/fig4latex \
111         findhyph/findhyph \
112         fontools/afm2afm \
113         fontools/autoinst \
114         fontools/ot2kpx \
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 \
131         latexmk/latexmk.pl \
132         latexpand/latexpand \
133         lilyglyphs/lily-glyph-commands.py \
134         lilyglyphs/lily-image-commands.py \
135         lilyglyphs/lily-rebuild-pdfs.py \
136         ltximg/ltximg.pl \
137         luaotfload/luaotfload-tool.lua \
138         makedtx/makedtx.pl \
139         make4ht/make4ht \
140         match_parens/match_parens \
141         mathspic/mathspic.pl \
142         mf2pt1/mf2pt1.pl \
143         mkgrkindex/mkgrkindex \
144         mkjobtexmf/mkjobtexmf.pl \
145         mkpic/mkpic \
146         multibibliography/multibibliography.pl \
147         musixtex/musixflx.lua \
148         musixtex/musixtex.lua \
149         oberdiek/pdfatfi.pl \
150         pax/pdfannotextractor.pl \
151         pdfcrop/pdfcrop.pl \
152         pedigree-perl/pedigree.pl \
153         perltex/perltex.pl \
154         petri-nets/pn2pdf \
155         pfarrei/a5toa4.tlu \
156         pfarrei/pfarrei.tlu \
157         pkfix-helper/pkfix-helper \
158         pkfix/pkfix.pl \
159         pmxchords/pmxchords.lua \
160         pst2pdf/pst2pdf.pl \
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 \
169         sty2dtx/sty2dtx.pl \
170         svn-multi/svn-multi.pl \
171         tex4ebook/tex4ebook \
172         texcount/texcount.pl \
173         texdef/texdef.pl \
174         texdiff/texdiff \
175         texdirflatten/texdirflatten \
176         texdoc/texdoc.tlu \
177         texfot/texfot.pl \
178         texlive/fmtutil-sys.sh \
179         texlive/fmtutil.pl \
180         texlive/rungs.tlu \
181         texlive/tlmgr.pl \
182         texlive/updmap-sys.sh \
183         texlive/updmap.pl \
184         texliveonfly/texliveonfly.py \
185         texloganalyser/texloganalyser \
186         thumbpdf/thumbpdf.pl \
187         ulqda/ulqda.pl \
188         urlbst/urlbst \
189         vpe/vpe.pl \
190         yplan/yplan
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
200 EXTRA_DIST += \
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
210 bin_links = \
211         epstopdf:repstopdf \
212         pdfcrop:rpdfcrop
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
239 if WIN32
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; \
244         done
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; \
252         done
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; \
259         done
260 else !WIN32
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; \
267           exit 1; \
268         fi; \
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,\.[^/]*$$,,'`; \
274             rm -f $$target; \
275             echo "creating link '$$target' -> '$$REL/texmf-dist/scripts/$$s'"; \
276             $(LN_S) $$REL/texmf-dist/scripts/$$s $$target || exit 1; \
277           done && \
278           for s in $(bin_links); do \
279             link=`echo $$s | sed 's,.*:,,'`; \
280             file=`echo $$s | sed 's,:.*,,'`; \
281             rm -f $$link; \
282             echo "creating link '$$link' -> '$$file'"; \
283             $(LN_S) $$file $$link || exit 1; \
284           done && \
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'"; \
291             rm -f man; \
292             (ln -s "$$REL/texmf-dist/doc/man" man || :); \
293           else :; fi
294 endif !WIN32
296 .PHONY: install-links
297 install-links:
299 ## For WIN32 (MinGW or native) we have wrapper binaries with .exe,
300 ## for Cygwin and Unix we have symlinks without .exe.
301 if WIN32
302 WINEXT = $(EXEEXT)
303 endif WIN32
305 uninstall-hook:
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); \
311         done
312         @for s in $(bin_links); do \
313           link=`echo $$s | sed 's,.*:,,'`; \
314           rm -f $(DESTDIR)$(bindir)/$$link$(WINEXT); \
315         done
316 if !WIN32
317         if test -h $(DESTDIR)$(bindir)/man; then \
318           rm -f $(DESTDIR)$(bindir)/man; \
319         else :; fi
320 endif !WIN32
322 ## \f
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)
326 echo-shell-scripts:
327         @echo $(shell_scripts)