3 -- Build script for LaTeX2e files
5 -- No bundle or module here, but these have to be defined
9 -- A couple of custom variables: the order here is set up for 'importance'
10 bundles
= {"base", "doc"}
11 required
= {"cyrillic", "graphics", "tools"}
13 -- Location of main directory: use Unix-style path separators
16 -- Help for the master script is simple
19 print " build check - run automated check system "
20 print " build ctan - create CTAN-ready archive "
21 print " build doc - runs all documentation files "
22 print " build clean - clean out directory tree "
23 print " build install - install files in local texmf tree"
27 -- A custom main function
28 -- While almost all of this is customise, the need to be able to cp and
29 -- rm files means that loading l3build.lua is very useful
30 function main (target
)
31 local function dobundles (target
)
33 for _
,i
in ipairs (bundles
) do
34 errorlevel
= run (i
, "texlua " .. scriptname
.. " " .. target
)
35 if errorlevel
~= 0 then
39 if errorlevel
== 0 then
40 for _
,i
in ipairs (required
) do
41 errorlevel
= run ("required/" .. i
, "texlua " .. scriptname
.. " " .. target
)
42 if errorlevel
~= 0 then
49 if target
== "check" then
51 elseif target
== "clean" then
55 elseif target
== "ctan" then
56 local errorlevel
= dobundles ("ctan")
57 if errorlevel
== 0 then
58 for _
,i
in ipairs (bundles
) do
61 for _
,i
in ipairs (required
) do
62 cp ("*.zip", "required/" .. i
, ".")
65 elseif target
== "doc" then
67 elseif target
== "install" then
69 elseif target
== "unpack" then
71 elseif target
== "version" then
78 -- Find and run the build system
79 kpse
.set_program_name ("kpsewhich")
80 dofile (kpse
.lookup ("l3build.lua"))