#!/usr/bin/env perl # $Id$ # # A script to TL-install a package from CTAN. # For a higher-level invocation, see ../tools/ctan2tl. # # Its actions, given a directory, are # 1. copy everything to texmf-dist/source// # 2. run any .ins files # 3. run any .mf files through mktextfm # 4. move .sty/.cls etc files to texmf-dist/tex// # 5. run LaTeX on .dtx/.tex and put the .dvi files in # texmf-dist/doc//. dtx files are run with just the # description if this is set up properly in the source. # 6. move .tex to texmf-dist/doc// # # All the patterns for what to move or run can be overridden for each package. # # PROBLEMS # 1. .tex files are used for lots of different purposes, so this is flaky # 2. if there is no .dtx, the .sty files are *moved*, rather than copied, # so the source directory is not complete. is this a bug or a feature? # [feature --karl] # 3. complex packages with subdirectories are not well catered for # # ENHANCEMENTS NEEDED # 1. a notation for dependencies; actually surprisingly few # 2. cleaner way of describing the various %special... hashes, so info # about a given package is in one place. # # Originally written by Sebastian Rahtz. Comments to tex-live@tug.org. # License: PUBLIC DOMAIN use English; use Getopt::Long; use File::Basename; use Cwd; # # programs used; must all be on the path $MV="mv"; $CP="cp -p"; $| = 1; select ((select (STDERR), $| = 1)[0]); # the destination destination tree $startdir=getcwd(); chdir(dirname($0)); chdir "cooked" || die "chdir(cooked) failed: $!"; $TDS = getcwd(); chdir $startdir || die "chdir($startdir) failed: $!"; # # packages to treat entirely on their own, or not at all. # the code here is evaluated by Perl, so special packages # can have their own subroutine. # %special = ( 'Catalogue', "&MAKEcatalog", 'HA-prosper', '&MAKEhaprosper', 'IEEEtran', "&MAKEIEEEtran", 'LingTrees', "warn \"skipping LingTrees, requires python\n\"", 'SIstyle', '&MAKEflatten', 'aastex', "&MAKEflatten", 'aeb_pro', "warn \"skipping aeb_pro, requires new acrobat + complicated\n\"", 'arabxetex', '&MAKEflatten', 'active-conf', "&MAKEflatten", 'ae', "&MAKEae", 'algorithmicx',"&MAKEnosymlinks", 'allrunes', "&MAKEflatten", 'alphabib', "warn \"skipping alphabib, shell script, and no doc source?\n\"", 'ams', "&MAKEamslatex", 'amscls', "&MAKEamslatex", 'amsmath', "&MAKEamslatex", 'amsldoc-vn', "&MAKEflatten", 'amsltx2', "&MAKEamslatex", 'amsrefs', "&MAKEamslatex", 'antomega', "&MAKEflatten", 'antt', "&MAKEflatten", 'apacite', "&MAKEflatten", 'arabi', "&MAKEarabi", 'arabtex', "&MAKEarabtex", 'archaic', "&MAKEwilson", 'arev', "&MAKEcopy", 'ascii', "&MAKEflatten", 'astron', "warn \"skipping astron, nonfree license\n\"", 'augie', "&MAKEaugie", 'aurical', "&MAKEaurical", 'babel', "&MAKEcopy", # we use latex-tds/babel.zip 'bangtex', "&MAKEflatten", 'bardiag', "&MAKEbardiag", 'barr', "&MAKEbarr", 'bbm', "&MAKEbbm", 'beamer', "&MAKEbeamer", 'beamer-contrib',"&MAKEflatten", 'beebe', "warn \"skipping beebe, MAKEbeebe needs work\n\"", 'bengali', '&MAKEflatten', 'bera', "&MAKEunzipandflatten", 'bookhands', "&MAKEwilson", 'borceux', "&MAKEborceux", 'burmese', "&MAKEflatten", 'cb', "&MAKEflatten", 'cbcoptic', "&MAKEcbcoptic", 'changebar', "&MAKEchangebar", 'chemsym', "warn \"skipping chemsym, nonfree\n\"", 'chessboard', "warn \"skipping chessboard, no doc source\n\"", 'chessfss', "warn \"skipping chessfss, no doc source\n\"", 'circuit_macros', "warn \"skipping circuit_macros, needs m4\n\"", 'cjhebrew', "&MAKEflatten", 'clock', "&MAKEflatten", 'cm-lgc', '&MAKEcmlgc', 'cmbright', "&MAKEflatten", 'cmcyr', "&MAKEflatten", 'cmll', "&MAKEflatten", 'concmath', "&MAKEconcmath", 'context', "&MAKEcontext", 'coptic', "warn \"skipping coptic, it has been replaced by cbcoptic\n\"", 'corridx', "warn \"skipping corridx, Pascal source\n\"", 'csvtools', "&MAKEflatten", 'ctable', "&MAKEflatten", 'ctib', "&MAKEflatten", 'cweb', "warn \"skipping cweb, programs\n\"", 'cyrillic', "&MAKEcopy", # we use latex-tds/cyrillic.zip 'dlfltxbcodetips', "warn \"skipping dlfltxbcodetips, no doc source\n\"", 'devanagr', "&MAKEdevanagr", 'diagnose', "&MAKEflatten", 'dictsym', "&MAKEunzipandflatten", 'disser', "&MAKEdisser", 'dmfonts', "warn \"skipping dmfonts, needs work\n\"", 'dps', "warn \"skipping dps, requires acrotex\n\"", 'dtk', "&MAKEflatten", 'dtxtut', "&setup", # straight copy 'easy', "&MAKEeasy", 'ebib', "warn \"skipping ebib, as it is Emacs\n\"", 'ebong', "&MAKEebong", 'ecc', "&MAKEecc", 'eco', "&MAKEeco", 'ednotes', "&MAKEnosymlinks", 'elhyphen', "&MAKEelhyphen", 'epiolmec', "&MAKEflatten", 'epix', "warn \"skipping epix, needs C++\n\"", 'eplain', "&MAKEcopy", 'eqnarray', "&MAKEeqnarray", 'eskdx', "&MAKEeskdx", 'esvect', "&MAKEflatten", 'ethiop', "&MAKEflatten", 'euclide', "&MAKEpst", 'eulervm', "&MAKEcopy", 'eurosym', "&MAKEflatten", 'expressgx', "&MAKEexpressg", 'fancyvrb', "&MAKEfancyvrb", 'fc', "&MAKEflatten", 'featpost', "&MAKEfeatpost", 'feynmf', "&MAKEfeynmf", 'fontinst', "&MAKEfontinst", 'footnpag', "&MAKEfootnpag", 'fourier', "&MAKEflatten", 'fouriernc', "&MAKEflatten", 'fp', "&MAKEfp", 'fpl', "&MAKEflatten", 'fragments', "warn \"skipping fragments, not a package\n\"", 'frcursive', "&MAKEflatten", 'germbib', "&MAKEgermbib", # 'gfsartemisia',"&MAKEflatten", 'graphics', "&MAKEcopy", # we use latex-tds/graphics.zip 'hfbright', "&MAKEflatten", 'hfoldsty', "&MAKEflatten", 'hyperref', "&MAKEhyperref", 'hyphen-german',"please install hyphen-german by hand, sorry\n\"", 'ibycus-babel',"&MAKEibycusbabel", 'ibygrk', "&MAKEflatten", 'invoice', "&MAKEflatten", 'iwona', "&MAKEcopy", 'japanese', "warn \"skipping japanese, requires ptex\n\"", 'jasthesis', "warn \"skipping jasthesis, license is unknown\n\"", 'kerkis', "&MAKEflatten", 'koma-script', "&MAKEkoma", 'kpfonts', "&MAKEflatten", 'kurier', "&MAKEcopy", 'kuvio', "warn \"skipping kuvio, nonfree license\n\"", 'latex', "&MAKEcopy", # we use latex-tds/base.zip 'latex-tds', "&MAKEcopy", # we use latex-tds/source.zip 'latexmp', "&MAKEflatten", 'leawood', "&MAKEflatten", 'lettre', "&MAKEflatten", 'lettrine', "&MAKEflatten", 'lexitex', "warn \"skipping lexitex, camel has replaced\n\"", 'lfb', "&MAKElfb", 'lh', "&MAKElh", 'lifia-th', "warn \"skipping lifia-th\n\"", 'linearA', "&MAKEflatten", "lineno", "&MAKEnosymlinks", 'listings', "&MAKElistings", 'literat', "&MAKEliterat", 'lm', "&MAKEcopy", 'lshort-bulgarian', '&MAKElshort', 'lshort-english', '&MAKElshort', 'lshort-finnish', '&MAKElshort', 'lshort-portuguese', '&MAKElshort', 'lshort-turkish', '&MAKElshort', 'lshort-vietnamese', '&MAKElshort', 'lshort-korean', '&MAKElshort', 'ltt', "&MAKEltt", 'ltxbase', "&MAKEbase", 'lucida', "&MAKElucida", 'makor', "&MAKEbase", 'manjutex', "&MAKEflatten", 'mathdesign', "&MAKEmathdesign", 'marginnote', "&MAKEunzip", 'mathmode', "&setup", 'mathpazo', "&MAKEmathpazo", 'metaobj', "&MAKEflatten", 'metauml', "&MAKEmetauml", 'mflogo', "&MAKEmflogo", 'mfpic', "&MAKEflatten", 'mh', "&MAKEflatten", 'minitoc', "&MAKEunzip", 'misc', "&MAKEmisc", 'mkbangtex', "warn \"skipping mkbangtex, no copyright (and python)\n\"", 'mnsymbol', "&MAKEflatten", 'montex', "&MAKEflatten", 'movie15', "&MAKEflatten", 'mpattern', "&MAKEmpattern", 'multido', "&MAKEpst", 'mxd', "&MAKEflatten", 'mxedruli', "&MAKEflatten", 'ncctools', "&MAKEflatten", 'oberdiek', "&MAKEoberdiek", 'ocherokee', "&MAKEflatten", 'ofs', "&MAKEflatten", 'omegajapanese',"&MAKEflatten", 'ot2cyr', "&MAKEot2cyr", 'otibet', "&MAKEflatten", 'pandora', "&MAKEflatten", 'pax', "warn \"skipping pax, needs java\n\"", 'pb-diagram', "&MAKEpbdiagram", 'pclnfss', "&MAKEpclnfss", 'pdcmac', "warn \"skipping pdcmac, needs work\n\"", 'perltex', "&MAKEperltex", 'pgf', "&MAKEpgf", 'phaistos', "&MAKEflatten", 'pict2e', "&MAKEpict2e", 'pictex', "&MAKEpictex", 'pl-qx', "&MAKEplqx", 'poster', "warn \"skipping poster, nonfree license\n\"", 'powerdot', '&MAKEflatten', 'probsoln', '&MAKEflatten', 'prosper', '&MAKEflatten', 'ps4pdf', "warn \"skipping ps4pdf, obsolete\n\"", 'psfragx', "&MAKEflatten", 'pslatex', "&MAKEpslatex", 'psnfss', "&MAKEpsnfss", # we use latex-tds/psnfss.zip 'psnfss-addons', "warn \"skipping psnfss-addons\n\"", 'psnfssx', "&MAKEflatten", 'pst-2dplot', "&MAKEpst", 'pst-3d', "&MAKEpst", 'pst-3dplot', "&MAKEpst", 'pst-asr', "&MAKEpst", 'pst-bar', "&MAKEpst", 'pst-barcode', "&MAKEpst", 'pst-blur', "&MAKEpst", 'pst-circ', "&MAKEpst", 'pst-coil', "&MAKEpst", 'pst-dbicons', "&MAKEpst", 'pst-eps', "&MAKEpst", 'pst-eucl', "&MAKEpst", 'pst-fill', "&MAKEpst", 'pst-fr3d', "&MAKEpst", 'pst-fractal', "&MAKEpst", 'pst-func', "&MAKEpst", 'pst-geo', "&MAKEpstgeo", 'pst-ghsb', "&MAKEpst", 'pst-gr3d', "&MAKEpst", 'pst-grad', "&MAKEpst", 'pst-infixplot',"&MAKEpst", 'pst-jftree', "&MAKEpst", 'pst-jtree', "&MAKEpst", 'pst-labo', "&MAKEpst", 'pst-lens', "&MAKEpst", 'pst-light3d', "&MAKEpst", 'pst-math', "&MAKEpst", 'pst-optexp', "&MAKEpst", 'pst-optic', "&MAKEpst", 'pst-osci', "&MAKEpst", 'pst-pdf', "&MAKEpst", 'pst-pdgr', "&MAKEpst", 'pst-poly', "&MAKEpst", 'pst-qtree', "&MAKEpst", 'pst-slpe', "&MAKEpst", 'pst-text', "&MAKEpst", 'pst-uml', "&MAKEpst", 'pst-vue3d', "&MAKEpst", 'pstricks', "&MAKEpstricks", 'pstricks-add',"&MAKEpst", 'pxfonts', "&MAKEflatten", 'refstyle', "&MAKEcopy", 'revtex', "&MAKEflatten", 'seminar', "&MAKEseminar", 'showexpl', "&MAKEflatten", 'siam', "&MAKEsiam", 'skak', "&MAKEflatten", 'songs', "warn \"skipping symbolindex, requires binary\n\"", 'stellenbosch',"&MAKEcopy", 'symbolindex', "warn \"skipping symbolindex, requires binary\n\"", 't2', "&MAKEt2", 'tabvar', "&MAKEflatten", 'tamethebeast',"&MAKEtamethebeast", 'tengwarscript',"&MAKEflatten", 'tex-gyre', "&MAKEcopy", 'tex-refs', "warn \"skipping tex-refs, needs work\n\"", 'texdraw', "&MAKEtexdraw", 'texsis', "&MAKEtexsis", 'thaifonts-scalable', "warn \"Thai, fontforge format only, skip\n\"", 'thailatex', "warn \"Thai, requires preprocessor (?), skip\n\"", 'thumbpdf', "&MAKEthumbpdf", 'thuthesis', "warn \"Chinese, may as well skip\n\"", 'ticket', "&MAKEflatten", 'tipa', "&MAKEtipa", 'titlepage-uni-dortmund', "warn \"needs graphics (too short names) in .\n\"", 'tpcmfont', "warn \"skipping tpcmfont\n\"", 'tools', "&MAKEcopy", # we use latex-tds/tools.zip 'txfonts', "&MAKEflatten", 'ucs', "&MAKEucs", 'ukrhyph', "&MAKEukrhyph", 'unitsdef', "&MAKEflatten", 'velthuis', "&MAKEcopy", 'verbatimcopy', "warn \"skipping verbatimcopy, no doc source\n\"", 'vhistory', "&MAKEflatten", 'vntex', "&MAKEcopy", 'voss-de', "&MAKEvossde", 'vpe', "&MAKEvpe", 'vrsion', "warn \"skipping vrsion, nonfree license\n\"", 'wasy2', "&MAKEflatten", 'wordcount', "&MAKEwordcount", 'xfor', "&MAKEflatten", 'xfrac', "&MAKEflatten", 'xkeyval', "&MAKExkeyval", 'xmltex', "&MAKExmltex", 'xymtex', "&MAKExymtex", 'xypic', "&MAKExypic", 'zefonts', "&MAKEflatten", ); # needs special TeX program to run the doc. %specialTEX = ( 'arabtex', 'tex', 'barr', 'latex', 'beamer', 'pdflatex', 'bytefield', 'pdflatex', 'esint-type1', 'pdftex', 'euro-ce', 'tex', 'floatrow', 'latex', 'genealogy', 'tex', 'insbox', 'tex', 'iso10303', 'pdflatex', 'mfpic', 'tex', 'mpattern', 'true', # requires running mpp, but it's not executable and # anyway it's just a test file. ignore it. 'ofs', 'csplain', 'pdfpages', 'pdflatex', 'pdfscreen', 'pdflatex', 'pdfslide', 'pdflatex', 'pl-qx', 'platex', 'semaphor', 'tex', 'subfig', 'pdflatex', 'texsis', 'tex', 'typespec', 'tex', 'wasy2', 'tex', 'webeq', 'pdflatex', ); $standardsource='\.fdd|\.dtx|\.ins|\.c$|Makefile|\.drv'; %specialsource= ( 'amsldoc-vn', 'NULL', 'apl', ".*", # just get everything, seems simplest 'arabxetex', 'NULL', # keep dtx with others, why not 'blacklettert1', '\.dtx|\.ins|\.pl|Makefile', 'carlisle', '\.dtx|\.ins|ltxtable\.tex', 'epsf', 'NULL', 'epslatex-fr', 'NULL', 'eskdx', 'NULL', # do not move makefiles 'mff', '\.mfj|\.bat|\.diz', ); %specialfoundry = ( 'fc', 'jknappen', 'mfpic', 'metafont', ); $standardfoundry='public'; %specialdest = ( 'MemoirChapStyles', 'texmf-doc', 'Type1fonts', 'texmf-doc', 'amsldoc-it', 'texmf-doc', 'amsldoc-vn', 'texmf-doc', 'amsthdoc-it', 'texmf-doc', 'beamer-tut-pt', 'texmf-doc', 'catalogue', 'texmf-doc', 'comprehensive', 'texmf-doc', 'cursolatex', 'texmf-doc', 'dtxtut', 'texmf-doc', 'elhyphen', 'texmf', 'epslatex-fr', 'texmf-doc', 'es-tex-faq', 'texmf-doc', 'free-math-font-survey', 'texmf-doc', 'l2picfaq', 'texmf-doc', 'l2tabu-english', 'texmf-doc', 'lshort-bulgarian', 'texmf-doc', 'lshort-english', 'texmf-doc', 'lshort-finnish', 'texmf-doc', 'lshort-portuguese', 'texmf-doc', 'lshort-turkish', 'texmf-doc', 'lshort-vietnamese', 'texmf-doc', 'lshort-korean', 'texmf-doc', 'mathmode', 'texmf-doc', 'ntheorem-vn', 'texmf-doc', 'tamethebeast', 'texmf-doc', 'tds', 'texmf-doc', 'tex-refs', 'texmf-doc', 'visualfaq', 'texmf-doc', 'voss-de', 'texmf-doc', 'xypic-tut-pt', 'texmf-doc', 'wp-conv', 'texmf-doc', 'xetexref', 'texmf-doc', ); # %specialsourcefmt = ( 'antomega', 'omega', 'apl', 'fonts', 'arabxetex', 'xelatex', 'archaic', 'fonts', 'arev', 'fonts', 'arrayjob', 'generic', 'babel', 'generic', 'bidi', 'xelatex', 'blacklettert1','fonts', 'blockdraw_mp','metapost', 'cb', 'fonts', 'cirth', 'fonts', 'cirth', 'generic', 'cjhebrew', 'fonts', 'cmpica', 'fonts', 'cryst', 'fonts', 'eplain', 'eplain', 'epsf', 'generic', 'eurosym', 'fonts', 'fc', 'fonts', 'fge', 'fonts', 'fontspec', 'xelatex', 'fourier', 'fonts', 'fouriernc', 'fonts', 'fpl', 'fonts', 'frcursive', 'fonts', 'genmisc', 'generic', 'germbib', 'bibtex', 'gost', 'bibtex', 'greenpoint', 'fonts', 'hfoldsty', 'fonts', 'kixfont', 'fonts', 'latexmp', 'metapost', 'leawood', 'fonts', 'lfb', 'fonts', 'latexmp', 'metapost', 'mathdots', 'generic', 'mfpic', 'generic', 'multido', 'generic', 'ofs', 'generic', 'pdcmac', 'plain', 'philokalia', 'xelatex', 'pictex', 'generic', 'pstricks', 'generic', 'ruhyphen', 'generic', 'skaknew', 'metapost', 'splines', 'metapost', 'thumbpdf', 'generic', 'trajan', 'fonts', 'variations', 'generic', 'velthuis', 'fonts', 'wasy2', 'fonts', 'xltxtra', 'xelatex', ); $standardsourcefmt='latex'; %specialfmt = ( 'abbr', 'generic', 'abstyles', 'generic', 'antomega', 'omega', 'arabxetex', 'xelatex', 'arrayjob', 'generic', 'babel', 'generic', 'bghyphen', 'generic', 'bidi', 'xelatex', 'cirth', 'generic', 'edmac', 'generic', 'eijkhout', 'generic', 'eplain', 'eplain', 'epsf', 'generic', 'esint-type1', 'plain', 'fenixpar', 'generic', 'fltpoint', 'generic', 'fontch', 'plain', 'fontspec', 'xelatex', 'genmisc', 'generic', 'hyplain', 'plain', 'ifxetex', 'generic', 'jadetex', 'jadetex', 'mathdots', 'generic', 'metatex', 'plain', 'mfpic', 'generic', 'mkpattern', 'plain', 'ocherokee', 'lambda', 'ofs', 'generic', 'passivetex', 'xmltex', 'pdcmac', 'plain', 'pdf-trans', 'generic', 'philokalia', 'xelatex', 'pictex', 'generic', 'plnfss', 'plain', 'pstricks', 'generic', 'ruhyphen', 'generic', 'shapepar', 'generic', 'texsis', 'texsis', 'thumbpdf', 'generic', 'tugboat-plain','plain', 'variations', 'generic', 'wasy2', 'plain', 'xltxtra', 'xelatex', 'xmlplay', 'xmltex', 'xunicode', 'xelatex', ); $standardfmt='latex'; %specialdocfmt = ( 'abbr', 'generic', 'abstyles', 'bibtex', 'amsldoc-it', 'italian', 'amsldoc-vn', 'vietnamese', 'amsthdoc-it', 'italian', 'antomega', 'omega', 'arabxetex', 'xelatex', 'archaic', 'fonts', 'arev', 'fonts', 'arrayjob', 'generic', 'aurical', 'fonts', 'automata', 'metapost', 'ascii', 'fonts', 'babel', 'generic', 'beamer-tut-pt','portuguese', 'bera', 'fonts', 'bghyphen', 'generic', 'bidi', 'xelatex', 'blacklettert1','fonts', 'cb', 'fonts', 'cirth', 'fonts', 'cjhebrew', 'fonts', 'cmarrows', 'metapost', 'cursolatex', 'portuguese', 'devanagr', 'fonts', 'dictsym', 'fonts', 'doublestroke','fonts', 'economic', 'bibtex', 'edmac', 'generic', 'elhyphen', 'generic', 'elsevier-bib','bibtex', 'eplain', 'eplain', 'epsf', 'generic', 'epslatex-fr', 'french', 'es-tex-faq', 'spanish', 'eurosym', 'fonts', 'exteps', 'metapost', 'fc', 'fonts', 'featpost', 'metapost', 'fenixpar', 'generic', 'fge', 'fonts', 'fontch', 'plain', 'fontspec', 'xelatex', 'fourier', 'fonts', 'fouriernc', 'fonts', 'frcursive', 'fonts', 'genmisc', 'generic', 'germbib', 'bibtex', 'gost', 'bibtex', 'greepoint', 'fonts', 'hfoldsty', 'fonts', 'hieroglf', 'fonts', 'hyplain', 'plain', 'ifxetex', 'generic', 'ijqc', 'bibtex', 'iopart-num', 'bibtex', 'kixfont', 'fonts', 'kpfonts', 'fonts', 'l2picfaq', 'german', 'latexmp', 'metapost', 'leawood', 'fonts', 'lfb', 'fonts', 'lshort-portuguese', 'portuguese', 'mathdots', 'generic', 'metatex', 'plain', 'metauml', 'metapost', 'mfpic', 'generic', 'mkpattern', 'plain', 'mpattern', 'metapost', 'ntheorem-vn', 'vietnamese', 'ofs', 'generic', 'pacioli', 'fonts', 'pdcmac', 'plain', 'pdf-trans', 'generic', 'phaistos', 'fonts', 'philokalia', 'xelatex', 'pictex', 'generic', 'plnfss', 'plain', 'pxfonts', 'fonts', 'shapepar', 'generic', 'splines', 'metapost', 'texsis', 'texsis', 'textpath', 'metapost', 'thumbpdf', 'generic', 'trajan', 'fonts', 'tugboat-plain','plain', 'txfonts', 'fonts', 'variations', 'generic', 'velthuis', 'fonts', 'voss-de', 'german', 'wasy2', 'fonts', 'xltxtra', 'xelatex', 'xq', 'fonts', 'xunicode', 'xelatex', 'xypic-tut-pt','portuguese', ); $standarddocfmt='latex'; # special cases of which .ins files to run; used to remove # normal choices, and get the most general. %specialins = ( 'aastex', 'NULL', # everything is pregenerated 'babel', 'babel.ins', 'base', 'NULL', 'blacklettert1','NULL', # don't try to do fontinst 'bosisio', '.*\.dtx', 'carlisle', '\.ins|ltxtable.tex', 'ccfonts', 'ccfonts.ins', 'dotseqn', 'dotseqn.dtx', 'feynmf', 'feynmf.ins', 'floatrow', 'floatrow.ins', 'iso', 'alliso.ins', 'lettre', 'NULL', 'localloc', 'localloc.dtx', 'makecell', 'makecell.dtx', 'minitoc', 'NULL', # takes forever, and files are pregenerated 'paper', 'install.02', 'parrun', 'parrun.ins', 'stmaryrd', 'stmaryrd.dtx', 'thesis', 'install.01|install.ndx', 'toptesi', 'NULL', ); $standardins='\.ins'; %specialinsrunner = ( 'bullcntr', 'latex', # requires interaction, ugh ); $standardinsrunner="latex"; # -interaction=nonstopmode? %specialins_postdelete = ( 'dateiliste', 'dateiliste.README*', # already in dist ); %specialmakeindex= ( ); $standardmakeindex='\.ist'; # packages which need special .tex/.sty files installed $standardtex='\.cfg|\.sty|\.clo|\.ldf|\.cls|\.def|\.fd$'; %specialtex= ( 'abbr', '\.tex', 'abstyles', "apreambl.tex", # not a4c.sty 'ae', '\.fd$|\.sty', 'apacite', "\.apc|$standardtex", 'arabtex', "\.tex|$standardtex", 'babel', 'b.*plain.tex|\.ldf|\.ltx|\.cfg|\.sty|\.clo|\.cls|\.def|\.fd$', 'babelbib', '\.bdf|\.sty', 'bardiag', '\.bar|\.sty|\.cfg', 'barr', 'diagram.tex', 'base', 'idx.tex|lablst.tex|latexbug.tex|lablst.tex|docstrip.tex|nfssfont.tex|sample2e.tex|small2e.tex|testpage.tex|ltxcheck.tex|\.cfg|\.fd$|\.cls|\.clo|\.ltx|\.sty|\.def|^\.', 'bghyphen', '\.tex', 'breqn', '\.sty|\.sym', 'calxxxx', 'cal.*\.tex', 'carlisle', '\.sty|\.ltx', 'chemstyle', "\.jdf|$standardtex", 'cirth', 'num\.tex', 'clock', '\.sty|clock\.tex', 'cmap', '\.sty|\.cmap', 'codepage', '\.sty|\.tex', 'contour', '\.cfg|\.sty|\.cnt', 'ctib', '\.sty|\.clo|\.ldf|\.cls|\.def|\.fd$|ctib\.tex', 'custbib', '\.mbs|\.tex', 'custom-bib', '\.mbs|\.tex', 'cyrillic', '\.tex|\.sty|\.fd$|\.def', 'dialogl', '\.sty|listouti\.tex', 'disser', "\.rtx|$standardtex", 'dlfltxb', '\.sty', # no sample.cfg 'dvdcoll', "\.dcl|$standardtex", 'ean', 'ean[0-9]*\.tex', 'edmac', 'edmac.tex|edstanza.tex|\.sty', 'eijkhout', '\.tex', 'epsf', 'epsf.(tex|sty)', 'epslatex-fr', 'NULL', 'esint-type1', 'esint.tex', 'europecv', 'EuropeFlag|europasslogo|\.cls|\.def', 'expl3', "\.ltx|$standardtex", 'fltpoint', '\.sty|\.tex', 'fontch', '\.tex', 'footnpag', 'footnpag\.sty', 'frankenstein',"\.(sto|stq)|$standardtex", 'genmisc', '\.sty|\.tex', 'geometry', '\.sty|\.clo|\.ldf|\.cls|\.def|\.fd$', # not cfg 'ginpenc', '\.gie|\.sty', 'hfoldsty', '\.sty|\.fd|\.cpa', 'hyper', '\.sty|\.hyp', 'hyplain', '(hyrules|hy.*plain|hylang)\..*', 'insbox', 'insbox.tex', 'iso10303', 'a.*tex|b.*tex|e.*tex|stp.*tex|\.sty|\.4ht', 'isodate', '\.idf|\.sty', 'isodoc', 'iso.*\.sty', # not mystyle.sty, etc. 'jadetex', '\.ltx|\.def|\.tex|\.ini|\.sty', 'karnaugh', 'kvmacros.tex', 'keystroke', 'keystroke_.*|\.sty', 'kuvio', '\.tex|\.sty', 'lettre', '\.ins|\.cls', 'lettrine', '\.sty|\.cfl|\.cfg', 'magyar', 'NULL', # don't want to conflict with standard babel 'manjutex', '\.sty|\.clo|\.ldf|\.cls|\.def|\.fd$|manju.tex', 'mathdots', "mathdots\.tex|$standardtex", 'metatex', 'metatex.tex', 'mff', '\.sty|mf[^f].*\.tex', 'mfpic', 'mfpic.tex|mfpic.sty|mfppatch.tex', 'mh', '\.sty|\.cls|\.fix', 'minitoc', "\.ml[do]|$standardtex", 'misc', '\.sty|\.ltx|\.cls', 'mkpattern', 'mkpatter.tex', 'msg', "$standardtex|-msg\.tex", 'nag', "$standardtex|\.cfg|\.nag", 'ntheorem', '\.sty|\.std', 'ofs', '^ofs\.tex|ofsdef\.tex|ofs-.*\.tex|\.sty|a.*\.tex|.*fn\.tex', 'patch', '\.tex', 'pdf-trans', 'pdf-trans.tex', 'pdfcprot', '\.cpa|\.sty', 'pdfscreen', 'overlay.*pdf|but.*pdf|left.*pdf|right\.pdf|pdfscreen.sty', 'pdfslide', '\.jpg|\.sty|\.clo|\.cfg|meta.*\.pdf', 'petri-nets', 'pnets\.tex|pntext\.tex|\.sty|pndraw\.tex|pnversion\.tex|\.sty|pndraw\.tex', 'pictex', '\.sty|\.tex', 'plgraph', '\.tex', 'plnfss', '\.tex|\.pfd', 'powerdot', "\.ps|$standardtex", 'ppchtex', 'm.*tex|m.*sty', 'prosper', '\.ps|\.eps|\.sty|\.cls', 'pstricks', 'pst-*\.tex', 'pst-geo', 'pst-map.*\.tex|pst-map.*\.sty', 'pst-infixplot', 'infix-RPN\.tex|pst-infixplot\.tex', 'qobitree', 'qobitree.tex', 'realcalc', 'realcalc.tex', 'revtex', '\.sty|\.cls|\.rtx', 'rlepsf', 'rlepsf.tex', 'seminar', '\.bug|\.bg2|\.cls|\.sty|2up.tex', 'shapepar', '\.sty', # not def 'showexpl', '\.sty|\.clo|\.ldf|\.cls|\.def|\.fd$', # not cfg 'splitindex', "splitindex\.tex|$standardtex", 'spotcolor', 'spotcolor*.tex', 'startex', '\.tex', 'subfig', '\.sty|[^c]\.cfg', # omit ltxdoc.cfg, would be system-wide 'subfigure', '\.sty|[^c]\.cfg', # omit ltxdoc.cfg, would be system-wide 'syntax', 'syntax\.tex', 'tabvar', '\.sty|\.cfg|\.[0-9]', 'taylor', 'diagrams.tex', 'texsis', '\.txs|TXS.*tex|texsis.tex', 'thumbpdf', '\.tex|\.sty', 'ticket', "\.tdf|$standardtex", 'titlesec', '\.tss|\.sty|ttlhref.tex|\.def', 'tools', '\.cfg|\.sty|\.clo|\.cls|\.def|\.fd$|.?\.tex|^\.tex$', 'tugboat-plain',"$standardtex|\.cmn", 'variations', "^variations\.tex|$standardtex", 'vhistory', '\.sty', # not hyperref.cfg 'wasy2', 'wasyfont\.tex', 'wordcount', '\.tex', 'zefonts', '\.sty|\.fd', ); # packages which need special documentation files run %specialdvi= ( 'aastex', 'NULL', 'abstyles', 'NULL', 'abbr', 'NULL', 'aguplus', 'NULL', 'antomega', 'NULL', 'apl', 'NULL', 'arabtex', 'NULL', 'archaic', 'NULL', 'arev', 'NULL', 'autotab', 'NULL', 'babel', 'babel\.drv', 'barcode2', 'eandoc.tex', 'bardiag', 'bar.*tex', 'barr', 'diagdoc.tex', 'base', '.*info.tex|.*guide.*tex|.*news.*tex', 'bbding', 'NULL', 'blacklettert1','\.dtx', 'calendar', 'demo.*\.tex|calguide\.tex', 'calxxxx', 'NULL', 'caption', 'NULL', 'carlisle', '\.dtx|ltxtable.tex', 'cbcoptic', 'NULL', # needs coptic fonts + hyphenation 'changebar', 'NULL', 'chess', '\.ltx', 'circ', '\.dtx', 'cirth', 'cirth\.tex', 'cjw', 'NULL', 'clock', 'NULL', 'cmcyralt', 'NULL', 'computational-complexity', 'NULL', 'codepage', 'codepage\.drv', 'crop', 'crop.dtx', 'crosswrd', 'NULL', 'ctib', 'ctib4tex.tex', 'curve', 'cv.tex', 'custbib', '\.dtx', 'custom-bib', '\.dtx', 'cyrillic', 'NULL', 'dates', 'NULL', 'dialogl', 'dia-driv\.tex|codialog\.tex', 'dingbat', 'NULL', 'directory', '\.tex', 'dotseqn', 'NULL', 'edmac', 'NULL', 'eepic', 'eepic.tex', 'elhyphen', 'NULL', # greek hyphenation 'emp', 'NULL', 'esint-type1', 'NULL', # already provided 'ethiop', 'ethiodoc\.tex', 'euro', 'euro.dtx', 'exams', 'NULL', 'fancynum', 'examples.tex', 'feynmf', 'NULL', 'fltpoint', 'NULL', 'footnpag', 'NULL', 'fourier', 'NULL', 'fouriernc', 'NULL', 'fp', 'example.tex', 'frcursive', '.*\.dtx', 'gatech-thesis', 'gatech-thesis.tex|jules-verne.tex', 'genmisc', 'NULL', 'german', 'germdoc\.tex', 'glossary', 'NULL', 'hh', 'NULL', 'ibycus-babel','NULL', # needs special hyphenation 'indxcite', 'NULL', 'insbox', 'demo.tex', 'iso', 'layman.tex', 'iso10303', 'NULL', 'isostds', 'isosty.tex', 'jadetex', 'NULL', 'jurabib', 'jbtest.tex', 'karnaugh', 'kvdoc\.tex', 'latexmp', 'NULL', 'ledmac', 'NULL', 'ledpar', 'NULL', 'lettrine', 'NULL', 'levy', 'NULL', 'lfb', 'NULL', 'lgreek', 'NULL', 'manjutex', 'manjutex.tex', 'mapcodes', 'mapcode\.drv', 'maple', 'NULL', 'mdwtools', 'NULL', 'metatex', 'NULL', 'mff', 'mffdoc.tex', 'mfnfss', 'NULL', 'mfpic', 'NULL', 'midnight', '\.doc', 'minutes', 'Sample.tex', 'newlfm', 'NULL', 'ocherokee', 'NULL', 'ofs', 'ofsdoc-e\.tex|ofsdoc\.tex|ofs-slt\.tex', 'ogonek', 'togonek\.ltx|\.tex', 'ot2cyr', 'OT2.*tex', 'othello', 'othello\.tex', 'otibet', 'NULL', 'paper', 'paper.drv', 'parrun', 'parrun.dtx', 'passivetex', 'NULL', 'patch', 'NULL', 'pdfscreen', 'NULL', 'petri-nets', 'pndoc\.tex', 'pictex', 'NULL', 'plgraph', 'NULL', 'plnfss', 'NULL', 'poligraf', 'NULL', 'powerdot', 'NULL', 'ppchtex', 'NULL', 'prosper', 'pros.*tex', 'pst-3dplot', '.*-e\.tex|doc-.*.tex|pst-3dplot-doc', 'pst-bar', '.*-e\.tex|doc-.*.tex|pst-bar-doc.tex', 'pst-barcode', 'NULL', # showexpl.sty? 'pst-blur', '.*-e\.tex|doc-.*.tex|pst-blur-doc.tex', 'pst-circ', '.*-e\.tex|doc-.*.tex|pst-circ-doc.tex', 'pst-fr3d', 'doc-.*.tex|pst-fr3d-doc', 'pst-func', '.*-e\.tex|doc-.*.tex|pst-func-doc', 'pst-geo', '.*-e\.tex|doc-.*.tex|pst-geo-doc.tex', 'pst-ghsb', '.*-e\.tex|doc-.*.tex|pst-ghsb-doc.tex', 'pst-gr3d', '.*-e\.tex|doc-.*.tex|pst-gr3d-doc.tex', 'pst-jftree', '.*-e\.tex|doc-.*.tex|pst-jftree-doc.tex', 'pst-lens', '.*-e\.tex|doc-.*.tex|pst-lens-doc.tex', 'pst-light3d', '.*-e\.tex|doc-.*.tex|pst-light3d-doc', 'pst-math', '.*-e\.tex|doc-.*.tex|pst-math-doc.tex', 'pst-optic', '.*-e\.tex|doc-.*.tex|pst-optic-doc.tex', 'pst-osci', '.*-e\.tex|doc-.*.tex|pst-osci-doc.tex', 'pst-poly', '.*-e\.tex|doc-.*.tex|pst-poly-doc.tex', 'pst-slpe', '.*-e\.tex|doc-.*.tex|pst-slpe-doc.tex', 'pst-uml', '.*-e\.tex|doc[-_].*.tex|pst-uml-doc.tex', 'pst-vue3d', '.*-e\.tex|doc-.*.tex|pst-vue3d-doc.tex', 'qobitree', 'example\.tex', 'qsymbols', 'NULL', 'r_und_s', 'NULL', 'rcsinfo', 'rcsinfo2html.tex', 'refman', 'layout.tex|\.dtx', 'rlepsf', 'NULL', 'semaphor', 'example.tex', 'skak', 'skakdoc.tex', 'songbook', 'sample-sb.tex', 'soul', 'soul.dtx', 'startex', 'NULL', 'syntax', 'syntax[a-z].*\.tex', 'taylor', 'NULL', 'texpower', 'manual\.tex', 'texsis', 'Manual.tex', 'textmerg', 'tmexamp[[0-9]\.tex', 'thesis', '\.drv', 'thumbpdf', 'NULL', 'timing', 'timing.tex', 'tipa', 'tipaman\.tex|tipatug\.tex', 'titlesec', 'titlesec.tex', 'tools', '\.dtx', 'totpages', 'NULL', 'umrand', 'umrand\.tex', 'universa', 'NULL', 'ulsy', '\.dtx', 'velthuis', 'manual.tex', 'vhistory', 'NULL', 'wasy2', 'wasydoc\.tex', 'wordcount', 'NULL', 'xkeyval', 'NULL', 'xymtex', 'xymtx200.tex', 'yfonts', 'NULL', 'youngtab', 'NULL', 'zefonts', 'zefonts.tex', ); #$standarddvi='\.tex|\.ltx'; $standarddvi='NULL'; # let's try relying on authors uploading pdf's. # packages which need special MetaPost files $standardmp='\.mp$'; %specialmp= ( 'automata', 'automata.mp', # skip example.mp 'feynmp', 'feynmp.mp', 'latexmp', 'latexmp.mp', 'mpattern', 'mpattern.mp', # don't install test.mp 'semioneside', 'NULL', # don't install figure*.mp 'textpath', 'textpath.mp', # don't install textpathfigs.mp ); # packages which need special BibTeX styles installed %specialcsf= (); $standardcsf='\.csf'; $standardbst='\.bst'; %specialbst= ( 'umthesis', 'NULL', ); # packages which need special BibTeX data files (not) installed. $standardbib='\.bib$'; # $ so we don't find README.bibtex in IEEEtran %specialbib= ( 'active-conf', 'NULL', 'aguplus', 'NULL', 'babelbib', 'NULL', 'classicthesis','NULL', 'dlfltxb', 'NULL', # don't install doc. 'doipubmed', 'NULL', 'economic', 'NULL', 'eplain', 'NULL', 'epslatex-fr', 'NULL', 'germbib', 'NULL', # no second xampl.bib, test bibs, etc. 'ijqc', 'NULL', 'iopart-num', 'NULL', 'mslapa', 'NULL', 'munich', 'NULL', 'pst-labo', 'NULL', 'ucthesis', 'NULL', 'umthesis', 'NULL', ); # packages which have Metafont sources to compile or install. $standardmf='[0-9]\.mf'; %specialmf= ( 'astro', 'astro.mf', 'backgammon', 'bg\.mf', 'cherokee', 'cherokee.mf', 'circ', 'csybimos\.mf|csycirc\.mf|csydiod\.mf|csyrest\.mf|csywidko\.mf|csysym\.mf|optic\.mf', 'cirth', 'cir.*\.mf', 'clock', 'clock.mf', 'cmpica', 'cmpic.*\.mf', 'dancers', 'dancers\.mf', 'dice', 'dice3d\.mf', 'dingbat', '\.mf', 'eiad', 'e.*10\.mf', 'engwar', 'engwar\.mf', ## 'ethiop', 'NULL', 'euro-ce', 'eu.*\.mf|ce.*\.mf', 'feynmf', 'feynmf\.mf', 'greenpoint', 'greenpoint\.mf', 'hands', 'hands\.mf', 'ibygrk', 'NULL', 'ifsym', '\.mf|\.gen', 'logic', 'milstd\.mf', 'mfpic', 'grafbase\.mf', 'morse', 'morse10.mf|morse.def', 'ogham', 'ogham\.mf', 'skak', 'skak.*[0-9].*\.mf', 'tengwar', 'tengwar\.mf', 'umrand', 'umrand[ab]\.mf', 'xq', 'xq(normal|large)\.mf', ); # packages which have dvips header files $standardpro='\.pro'; %specialpro= ( 'carlisle', 'pspicture.ps', 'dvipsconfig', '.*', # addpsctrl should be in bin, but ... 'esint-type1', 'config.esint', 'zefonts', 'slantcm.cfg', ); $standardmap='\.map'; %specialmap = ( 'arabxetex' => '\.(map|tec)$', 'kerntest' => 'NULL', # skip test map file ); $standardmapdest = "fonts/map/dvips"; %specialmapdest = ( 'arabxetex' => "fonts/misc/xetex/fontmapping", ); $standardvmap='\.ali'; $standardenc='\.enc'; $standardafm='\.afm'; %specialafm= (); $standardpfm='\.pfm'; %specialpfm= (); $standardpfb='\.pfb|\.inf'; %specialpfb= (); $standardotf='\.otf'; %specialotf= (); $standardovf='\.ovf'; %specialovf= (); $standardofm='\.ofm'; %specialofm= (); $standardovp='\.ovp'; %specialovp= ( 'psfragx', 'NULL', ); $standardotp='\.otp'; %specialotp= (); $standardocp='\.ocp'; %specialocp= (); # packages which have xmltex files %specialxmt= ( 'passivetex', '\.xmt|fotex.sty', ); $standardxmt='\.xmt'; # which suffixes to remove after building $cleanpatt='\.head|\.tmp|\.dvi|\.log|\.out|\.aux|\.toc|\.lof|\.lot|\.bbl|\.blg|\.idx|\.ind|\.ilg|\.glo|\.gls|\.loa'; %moreclean = ( 'epslatex-fr' => 'R?Danger.eps', 'minitoc' => 'minitoc-texmf.zip', # should just use it, actually ); # command line options $opt_debug = 1; # verbosity is good? $result = GetOptions ( "debug!", "test!" ); if ($result eq 0 ) { die ("OPTION FAILURE"); } # Read from config file to make local adjustments to above readconfig(); # for (@ARGV) { $packagedir=$_; if (! -d $packagedir) { warn "$0: $packagedir not a directory, skipping.\n"; next; } @x=split(/\//,$packagedir); $package=pop(@x); my $dest=$specialdest{$package} || "texmf-dist"; $TOPDEST="$TDS/$package"; $DEST="$TOPDEST/$dest"; my $MAKE=0; if (-f "$packagedir/Makefile") { open(X,"$packagedir/Makefile"); while (<>) { if (/^texlive:/) {$MAKE=1;} } close(X); } if ($MAKE) { &SYSTEM("cd $packagedir; make -f Makefile texlive; mkdir -p $DEST; mv texmf/* $DEST)"); print "Package $packagedir has a TeXlive-aware Makefile. Make and send to $DEST\n"; } else { $insrunner = $specialinsrunner{$package} || $standardinsrunner; $whichformat = $specialfmt{$package} || $standardfmt; $whichdocformat = $specialdocfmt{$package} || ($dest eq "texmf-doc" ? "english" : $standarddocfmt); print "pkg=$package (fmt=$whichformat docfmt=$whichdocformat) -> $DEST\n"; if ($special{$package}) { print "doing $special{$package}...\n"; eval $special{$package}; die "failure in $special{$package} (for $package): $@" if $@; } else { &donormal; } } &xchdir ($startdir); } sub xchdir { my ($dir) = @_; chdir ($dir) || die "chdir($dir) failed: $!"; chomp (my $pwd = `pwd`); print "\t CHDIR $dir (now $pwd)\n"; } # some packages (e.g., vntex) are tl-ready (or near enough). # sub MAKEcopy { my $dest = $_[0] || $DEST; chomp (my $abspackagedir = `cd $packagedir && pwd`); print "\t COPY from $abspackagedir to $dest\n"; &xchdir ($packagedir); &SYSTEM ("mkdir -p $dest"); # do the copy. &SYSTEM ("$CP -r * $dest"); # remove top-level README (shouldn't overwrite texmf-dist/README!), # needed for vntex, pgf, others. Do this before removing symlinks, # in case the README is a symlink (e.g., iwona). -r "$dest/README" && &SYSTEM ("rm -f $dest/README $dest/00*"); # for arev et al., remove symlinks. &SYSTEM ("find $dest -type l | xargs --no-run-if-empty rm"); # ditto assorted other for lm (files are in doc subtree already). -r "$dest/MANIFEST.txt" && &SYSTEM ("cd $dest && rm -f GUST*.txt MANIFEST.txt README.eng"); # move CHANGELOG for stellenbosch. -r "$dest/CHANGELOG" && &SYSTEM ("mv $dest/CHANGELOG $dest/doc/$whichdocformat/$package/"); # move README.eulervm for eulervm. -r "$dest/README.eulervm" && &SYSTEM ("mv $dest/README.eulervm $dest/doc/$whichdocformat/$package/"); # for tex-gyre, rename context subdir. (shouldn't be needed next time.) if (-d "$dest/fonts/map/pdftex/context") { print "$package: rename context map dir.\n"; &SYSTEM ("mv $dest/fonts/map/pdftex/context $dest/fonts/map/pdftex/tex-gyre"); } # for eplain, move info file (with warning). if (-r "$dest/doc/$package/doc/eplain.info") { warn "WARNING: moving eplain.info to /tmp\n"; warn " -- YOU must put it in texmf/doc/info!\n"; &SYSTEM ("mv $dest/doc/$package/doc/eplain.info /tmp"); } # for velthuis, remove bin dir (with warning). if (-d "$dest/bin") { warn "WARNING: removing bin/ dir in $dest\n"; warn " -- YOU must deal with it!\n"; &SYSTEM ("rm -rf $dest/bin"); } # preserve the lm sources. if ($package eq "lm") { my $srcdir = " $dest/source/$whichdocformat/$package/"; &SYSTEM ("mkdir -p $srcdir"); &SYSTEM ("mv $dest/lm*mt1.zip $srcdir/"); } } # # For most packages, this is the first thing called. # sub setup { my ($ctl) = @_; print "doing setup($ctl)...\n"; # precreate the directories we might need $DOCDIR = "$DEST/doc/$whichdocformat/$package"; &SYSTEM("mkdir -p $DOCDIR"); &SYSTEM("mkdir -p $DEST/tex/$whichformat/$package"); &SYSTEM("mkdir -p $DEST/source/$whichdocformat/$package"); # junk we don't ever want. &SYSTEM ("rm -f $packagedir/00*"); return if $ctl eq "nocopytodoc"; # copy everything to the doc directory # and work in there &SYSTEM("$CP -r $packagedir/* $DEST/doc/$whichdocformat/$package"); } sub donormal { print "doing donormal()...\n"; &setup; chdir("$DEST/doc/$whichdocformat/$package"); &buildfilelist; # run the .ins files (if any) supplied $inspatt = $specialins{$package }; if ($inspatt eq "") { $inspatt=$standardins; } $Foundry = $specialfoundry{$package} || $standardfoundry; &runins($inspatt); # rebuild the list of files in the directory &buildfilelist; if ($Foundry eq "metafont") { &dosimplemf; } else { &domf; } &dodvi; # rebuild again, as we have .dvi files now &buildfilelist; &dobst; &domp; &dobib; &doxmt; &dotex; &runfonts; &domakeindex; &doomega; &dosource; &dotype1; # # this is a bit weird, but its an easy way to remove # empty directories that we never used. &SYSTEM("rmdir $DEST/*/$whichformat/$package 2> /dev/null"); killfiles($cleanpatt); killfiles($moreclean{$package}) if $moreclean{$package}; } sub runins { my ($thispatt) = @_; print "\t RUNINS $thispatt\n"; for (grep (/$thispatt/, @filenames)) { print "\t RUN $_\n" ; &runjob ("yes | $insrunner $_"); } my $postdelete = $specialins_postdelete{$package}; &SYSTEM ("rm -f $postdelete") if $postdelete; } sub install { local($destdir,$thispatt) = @_; print "\t INSTALL $thispatt to $destdir\n"; &SYSTEM ("mkdir -p $destdir") unless -d $destdir; for (grep (/$thispatt/, @filenames)) { next if $_ eq "dtx-style.sty"; # this should never be in runtime &SYSTEM ("$MV $_ $destdir"); } } # build the documentation files sub dodvi { $dvipatt = $specialdvi{$package}; # packages which are doc themselves rarely rebuild cleanly, # and aren't worth it. $dvipatt = "NULL" if $specialdest{$package} eq "texmf-doc"; if ($dvipatt eq "") { $dvipatt=$standarddvi; } &rundvi($dvipatt); } # move the runtime files sub dotex { my $texpatt = $specialtex{$package} || $standardtex; &install("$DEST/tex/$whichformat/$package", $texpatt); } # move the makeindex runtime files sub domakeindex { $makeindexpatt = $specialmakeindex{$package}; if ($makeindexpatt eq "") { $makeindexpatt=$standardmakeindex; } &install("$DEST/makeindex/$package",$makeindexpatt); } # BibTeX style files: sub dobst { $csfpatt = $specialcsf{$package}; if ($csfpatt eq "") { $csfpatt=$standardcsf; } &install("$DEST/bibtex/csf/$package",$csfpatt); $bstpatt = $specialbst{$package}; if ($bstpatt eq "") { $bstpatt=$standardbst; } &install("$DEST/bibtex/bst/$package",$bstpatt); } # simple MF files, e.g., if specialfoundry eq "metafont". sub dosimplemf { my $mfpatt = $specialmf{$package} || $standardmf; &install ("$DEST/metafont/$package", $mfpatt); } # MetaPost files: sub domp { $mppatt = $specialmp{$package} || $standardmp; &install("$DEST/metapost/$package", $mppatt); } # BibTeX bibliography files: sub dobib{ $bibpatt = $specialbib{$package} || $standardbib; &install("$DEST/bibtex/bib/$package", $bibpatt); } # source files: sub dosource{ $sourceformat = $specialsourcefmt{$package} || $standardsourcefmt; # default to using specialdocfmt, as we do in setup? $sourcepatt = $specialsource{$package} || $standardsource; &install("$DEST/source/$sourceformat/$package", $sourcepatt); } sub doomega{ $ovfpatt = $specialovf{$package}; if ($ovfpatt eq "") { $ovfpatt=$standardovf; } &install("$DEST/fonts/ovf/public/$package",$ovfpatt); $ofmpatt = $specialofm{$package}; if ($ofmpatt eq "") { $ofmpatt=$standardofm; } &install("$DEST/fonts/ofm/public/$package",$ofmpatt); $ovppatt = $specialovp{$package}; if ($ovppatt eq "") { $ovppatt=$standardovp; } &install("$DEST/fonts/ovp/public/$package",$ovppatt); $otppatt = $specialotp{$package}; if ($otppatt eq "") { $otppatt=$standardotp; } &install("$DEST/omega/otp/$package",$otppatt); $ocppatt = $specialocp{$package}; if ($ocppatt eq "") { $ocppatt=$standardocp; } &install("$DEST/omega/ocp/$package",$ocppatt); } # the dvips and font mapping files: sub dotype1{ my $encpatt = $specialenc{$package} || $standardenc; &install("$DEST/fonts/enc/dvips/$package", $encpatt); my $mappatt = $specialmap{$package} || $standardmap; my $mapdest = $specialmapdest{$package} || $standardmapdest; &install ("$DEST/$mapdest/$package", $mappatt); my $vmappatt = $specialvmap{$package} || $standardvmap; &install("$DEST/fonts/map/vtex/$package", $vmappatt); my $propatt = $specialpro{$package} || $standardpro; &install("$DEST/dvips/$package", $propatt); my $pfbpatt = $specialpfb{$package} || $standardpfb; &install("$DEST/fonts/type1/public/$package", $pfbpatt); my $afmpatt = $specialafm{$package} || $standardafm; &install("$DEST/fonts/afm/public/$package", $afmpatt); my $pfmpatt = $specialpfm{$package} || $standardpfm; &install("$DEST/fonts/type1/public/$package", $pfmpatt); my $otfpatt = $specialotf{$package} || $standardotf; &install("$DEST/fonts/opentype/public/$package", $otfpatt); } # xmltex files sub doxmt{ my $xmtpatt = $specialxmt{$package} || $standardxmt; &install("$DEST/tex/xmltex/$package", $xmtpatt); } # build the font files sub domf { $mfpatt = $specialmf{$package} || $standardmf; &runmf ($mfpatt); } sub rundvi { local($thispatt) = @_; $TEX = $specialTEX{$package}; if ($TEX eq "") { if ($whichformat eq 'latex') { $TEX="pdflatex"; } else { $TEX=$whichformat; } } if ($TEX eq "generic") { $TEX="pdflatex"; } print "\t MAKEDVI $thispatt using $TEX (@filenames)\n"; for (grep(/$thispatt/,@filenames)) { ($FileBase,$Filepath,$Filesuffix) = fileparse($_,"\.[A-z]*"); print "found $FileBase\n"; if (-r "$FileBase.drv" && $Filesuffix eq ".dtx" ) { $Filesuffix=".drv" ; } print "\t DOC: run $TEX on $FileBase$Filesuffix\n"; open(TMP,">$FileBase.aux"); close(TMP); &runjob("TEXMFLOCAL=. $TEX '\\nonstopmode\\input $FileBase$Filesuffix'"); &runjob("bibtex $FileBase"); &runjob("TEXMFLOCAL=. $TEX '\\nonstopmode\\input $FileBase$Filesuffix'"); if ($Filesuffix eq ".drv" || $Filesuffix eq ".dtx" ) { &runjob("$CP $startdir/gind.ist ."); &runjob("makeindex -s gind.ist $FileBase"); unlink "gind.ist"; } else { &runjob("makeindex $FileBase"); } &runjob("$TEX '\\nonstopmode\\input $FileBase$Filesuffix'"); } print "\t MAKEDVI done\n"; } # # run a &SYSTEM job, and append stderr output to log file # sub runjob { local($job) = @_; if ($opt_test) { print "RUNJOB $job\n"} else{ $Jobid="_$$"; &SYSTEM("$job 2> $Jobid.log"); open(TMP,"$Jobid.log") || die("Failed to open $Jobid.log") ; print ">> $_" while (); close(TMP); unlink "$Jobid.log"; } } # remove all files matching something in $killpatt. # also remove .ps files for which we have a .pdf. # sub killfiles { my ($killpatt) = @_; for (grep (/$killpatt/, @filenames)) { print "\t Remove $_\n"; unlink $_; } for (grep (/\.ps$/, @filenames)) { (my $pdf = $_) =~ s/ps$/pdf/; next unless grep (/$pdf/, @filenames); print "\t Remove ps $_ (since have $pdf)\n"; unlink $_; } } # rebuild list of input files, e.g., after flattening sub buildfilelist { print "doing buildfilelist()...\n"; opendir(DIR,'.') || die ("ERROR: cannot open directory"); @filenames =grep(!/^\.\.?$/,readdir(DIR)); closedir(DIR); } sub runmf { my ($mfpatt) = @_; my $needdir=0; print "\t Make fonts for $package ($mfpatt)\n"; for (grep(/$mfpatt/,@filenames)) { $needdir=1; ($FileBase,$Filepath,$Filesuffix) = fileparse($_,"\.[A-z]*"); if (! -e "$FileBase.tfm") { print "\t\t Make TFM from $_\n"; &runjob("mktextfm --destdir=`pwd` $FileBase.tfm"); } } if ($needdir) { &SYSTEM("mkdir -p $DEST/fonts/source/$Foundry/$package"); # don't use $mfpatt since that's only the tfm-able mf files. &runjob("$MV *.mf $DEST/fonts/source/$Foundry/$package"); &SYSTEM("rm -f *pk"); # not worth the space } else { print "\t (no $mfpatt)\n"; } } sub runfonts { for (grep(/.vf/,@filenames)) { $needdir=1; print "\t\t install VF $_\n"; ($FileBase,$Filepath,$Filesuffix) = fileparse($_,"\.[A-z]*"); if ($needdir) { &SYSTEM("mkdir -p $DEST/fonts/vf/$Foundry/$package"); $needdir=0; } &SYSTEM("$MV $FileBase.vf $DEST/fonts/vf/$Foundry/$package "); } for (grep(/.tfm/,@filenames)) { $needdir=1; print "\t\t INSTALL tfm $_\n"; ($FileBase,$Filepath,$Filesuffix) = fileparse($_,"\.[A-z]*"); if ($needdir) { &SYSTEM("mkdir -p $DEST/fonts/tfm/$Foundry/$package"); $needdir=0; } &SYSTEM("$MV $FileBase.tfm $DEST/fonts/tfm/$Foundry/$package "); } } sub SYSTEM { local ($job) = @_; if ($opt_test) { print "\t SYSTEM $job\n"; } else { print "\t SYSTEM $job\n" if $opt_debug; system($job); } } sub MAKEflatten { &setup; &xchdir ("$DEST/doc/$whichdocformat/$package"); print "\t SPECIAL flatten $package\n"; # so far we've only seen README's at one level. &SYSTEM('for d in *; do test -r $d/README && mv $d/README README.$d; done'); -d <*/*/*/*/*/.> && &SYSTEM("$MV -f */*/*/*/* ."); -d <*/*/*/*/.> && &SYSTEM("$MV -f */*/*/* ."); -d <*/*/*/.> && &SYSTEM("$MV -f */*/* ."); -d <*/*/.> && &SYSTEM("$MV -f */*/* ."); -d <*/.> && &SYSTEM("$MV -f */* ."); &SYSTEM("find -type d -print | xargs rmdir 2>/dev/null"); &SYSTEM("find -type f -print >/tmp/find"); &buildfilelist; &donormal; } # a ctan-ready zip file. sub MAKEunzip { &SYSTEM("mkdir -p $DEST"); &xchdir ($DEST); &SYSTEM ("unzip -q -o -a $startdir/$packagedir/$package*.zip"); } sub MAKEunzipandflatten { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &SYSTEM("unzip -q -o -a $package.zip; rm $package.zip"); &SYSTEM("$MV */*/*/*/* .; rmdir */*/*/*"); &SYSTEM("$MV */*/*/* .; rmdir */*/*"); &SYSTEM("$MV */*/*/* .; rmdir */*/*"); &SYSTEM("$MV */*/* .; rmdir */*"); &SYSTEM("$MV */*/* .; rmdir */*"); &SYSTEM("$MV */* .; rmdir *"); &buildfilelist; &donormal; } sub MAKEnosymlinks { &setup; chdir("$DEST/doc/$whichdocformat/$package"); print "\t SPECIAL nosymlinks $package\n"; &SYSTEM("find . -type l | xargs rm"); # remove from lineno package, it's in the ltabptch package (which # doesn't use this function). Told Uwe, hopefully he will fix. &SYSTEM("rm -f ltabptch.sty"); # remove from ednotes package, it's a copy from bigfoot. Sigh. &SYSTEM("rm -f perpage.sty"); &buildfilelist; &donormal; } # do some stuff for simple packages with hyphenation files, like # cbcoptic and ibycus-babel. The arguments are: # LANGNAME - full language name, like "coptic" (first arg of .dat) # LANGABBREV - abbreviated language name, like "cop" (in .dat filename) # HYPHFILE - hyphenation .tex file name, like "copthyph.tex" # # General procedure is: # # create: /home/karl/src/Master/texmf/tpm/hyphen-language.tpm # (must be done by hand) # create: texmf/tex/generic/config/language.ll.dat # (done here, unless it already exists) # install pattern file from ctan: texmf/tex/generic/hyphen/langhyph.tex # (done here) # add in: /home/karl/src/Master/texmf/tpm/collection-langother.tpm # (must be done by hand) # sub GENMAKEhyphenation { my ($langname,$langabbrev,$hyphfile) = @_; &setup; &buildfilelist; &donormal; print "\t SPECIAL $package: install $hyphfile\n"; my $generichyphdir = "$TOPDEST/texmf/tex/generic/hyphen"; &SYSTEM("mkdir -p $generichyphdir"); &SYSTEM("$MV $hyphfile $generichyphdir"); my $genericconfigdir = "$TOPDEST/texmf/tex/generic/config"; my $configfile = "$genericconfigdir/language.$langabbrev.dat"; if (! -r $configfile) { print "\t SPECIAL $package: create $configfile\n"; &SYSTEM("mkdir -p $genericconfigdir"); &SYSTEM("echo $langname $hyphfile >$configfile"); } print "YOU-MUST-DO! $package: create texmf/tpm/hyphen-$langname.tpm\n"; print "YOU-MUST-DO! $package: add to texmf/tpm/collection-langsomething.tpm\n"; } sub MAKEcbcoptic { &GENMAKEhyphenation ("coptic", "cop", "copthyph.tex"); } sub MAKEibycusbabel { &GENMAKEhyphenation ("ibycus", "iby", "ibyhyph.tex"); } # package subroutines sub MAKEamslatex { # Here is an unusual special case. The AMS distributes an # amslatex.zip file which actually unpacks into numerous # subdirectories, none of which are named amslatex: # bibtex/bst/ams, doc/latex/amscls, doc/latex/amsmath, etc. # # For each of these directories, we make a TL package, since TL # so strongly ties directories to package names. # # We make those TL packages by unpacking the optimized amslatex.zip # provided as part of the latex-tds project; that is what has been # done by ctan2tl before this script has been called. Our job here is # to throw away all the *other* directories, so that if we are called # to update (say) the "amscls" package, we delete everything but that. # print "\t SPECIAL extract $package from amslatex\n"; # Start with the usual straight copy. &MAKEcopy (); &xchdir ($DEST); # List of subsubdirectories, at the package level. my @deldir = (); chomp (my @dirlist = `find */*/* -type d | sort -u`); for my $dir (@dirlist) { next if $dir =~ m!$package$!; # keep matching directories push (@deldir, $dir); } &SYSTEM ("rm -rf @deldir"); # discard the rest } sub MAKEarabi { &xchdir ("$packagedir/arabi/texmf"); # author will remove these next time # print "\t SPECIAL $package: removing microsoft and nonfree\n"; &SYSTEM('find -name microsoft -o -name nonfree | xargs rm -rf'); # print "\t SPECIAL $package: rearranging for tds\n"; &SYSTEM ("mkdir -p tex; mv latex tex"); &SYSTEM ("rm -f tex/latex/arabi/updmap.cfg") &SYSTEM ("rm -rf dvips"); # print "\t SPECIAL $package: copying to $DEST\n"; # do the copy. &SYSTEM ("mkdir -p $DEST"); &SYSTEM ("$CP -r * $DEST/"); } sub MAKEarabtex { &xchdir ($packagedir); # print "\t SPECIAL $package: removing top-level links\n"; &SYSTEM('for f in apatch.sty arabtex.tex hebtex.tex hepatch.sty; do test -h $f && rm -v $f; done'); # print "\t SPECIAL $package: removing top-level tgz's\n"; &SYSTEM('for f in *.tgz; do rm -v $f; done'); # print "\t SPECIAL $package: renaming arabtex.htm\n"; &SYSTEM('mv doc/html/arabtex.htm arabtex1.htm'); &SYSTEM('mv doc/txt/arabtex.htm arabtex2.htm'); # print "\t SPECIAL $package: flatten\n"; &xchdir (".."); &MAKEflatten (); } sub MAKEaurical { &xchdir ($packagedir); # # basically have a tds hier to unzip, with some cleanups. &SYSTEM ("unzip -q aurical_texmf.zip"); &SYSTEM ("$MV fonts/map/dvips/misc fonts/map/dvips/$package"); &SYSTEM ("mkdir -p fonts/source/public/aurical/"); &SYSTEM ("$MV aurical_source.zip fonts/source/public/aurical/"); &SYSTEM ("rm -f aurical.pdf aurical_texmf.zip"); # &xchdir (".."); &MAKEcopy (); } sub MAKEbabel { &setup; &buildfilelist; &donormal; # maybe also remove bulgarian? print "\t SPECIAL $package: remove old lahyph.tex\n"; # since braams hasn't &SYSTEM("rm -f $DEST/doc/generic/$package/lahyph.tex"); my $files = "icehyph.tex iahyphen.tex "; print "\t SPECIAL move to /tmp: $files\n"; # since not separate on CTAN &SYSTEM("cd $DEST/doc/generic/$package && mv $files /tmp"); print "YOU-MUST-DO! check those against texmf/tex/generic/hyphen\n"; } sub MAKEbbm { &setup; &xchdir("$DEST/doc/latex/$package/fonts"); &buildfilelist; &domf; chdir("$DEST/doc/latex/$package"); &buildfilelist; &donormal; } sub MAKEeskdx { &setup; &xchdir ("$DEST/doc/$whichdocformat/$package"); print "\t SPECIAL $package: flatten unpacked/ dir (only)\n"; &SYSTEM ("$MV unpacked/Makefile Makefile.unpacked"); &SYSTEM ("$MV unpacked/* ."); &SYSTEM ("rmdir unpacked"); &buildfilelist; &donormal; } sub MAKEmathdesign { &setup (); &xchdir ($DOCDIR); # # basically have several tds hiers to unzip, with some cleanups. print "\t SPECIAL unzip etc.\n"; for my $zip (<*.zip>) { &SYSTEM ("cd $DEST && unzip -q -o $DOCDIR/$zip; rm -f $DOCDIR/zip"); } &SYSTEM ("mv $DEST/dvips/config $DEST/dvips/mathdesign"); } sub MAKEmetauml { &setup; &xchdir ("$DEST/doc/$whichdocformat/$package"); &SYSTEM ("$MV doc/* examples/* inputs/* ."); &SYSTEM ("rmdir doc examples inputs"); &buildfilelist; &donormal; } sub MAKEmflogo{ &setup; chdir("$DEST"); &runjob("tar xvf $DEST/doc/latex/$package/logofont.tar"); chdir("$DEST/doc/latex/$package"); &donormal; } sub MAKEfp { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &runjob("mkdir -p $DEST/tex/plain/fp; $CP fp.tex $DEST/tex/plain/fp"); &donormal; } sub MAKEgermbib { &xchdir ($packagedir); # print "\t SPECIAL $package remove symlinks\n"; &SYSTEM ("find . -type l | xargs --no-run-if-empty rm"); # # we can't conflict with standard apalike.sty. print "\t SPECIAL $package rename second apalike.sty\n"; &SYSTEM ("$MV styles/apalike.sty styles/apalike.germbib_sty"); # # spurious ^M's. &SYSTEM ("perl -pie 'tr/\r//' document/btxdoc.tex"); # &xchdir (".."); &MAKEflatten (); } sub MAKEhyperref { &xchdir ($packagedir); # print "\t SPECIAL $package unzip tds and copy\n"; &SYSTEM ("rm -rf doc test"); # we will use prepared zip &SYSTEM ("unzip -q $package-tds.zip"); &SYSTEM ("rm -f * 2>/dev/null"); # remove top-level files # &xchdir (".."); &MAKEcopy (); } sub MAKEoberdiek { &xchdir ($packagedir); # print "\t SPECIAL $package unzip tds and copy\n"; &SYSTEM ("unzip -q $package-tds.zip"); &SYSTEM ("rm -f * 2>/dev/null"); # remove top-level files # &xchdir (".."); &MAKEcopy (); } sub MAKExkeyval { # needs files in both latex and generic. &MAKEflatten (); print "\t SPECIAL $package moving .tex\n"; my $generic = "$DEST/tex/generic/$package/"; &SYSTEM ("mkdir -p $generic; mv *.tex $generic"); } sub MAKExymtex { &setup; chdir("$DEST/doc/latex/$package"); &SYSTEM("$MV doc200/* ."); &SYSTEM("rmdir doc"); &buildfilelist; &donormal; } # handle mpp script a la perltex. sub MAKEmpattern { &setup; &buildfilelist; &donormal; print "\t SPECIAL move mpp from doc to /tmp\n"; &SYSTEM("$MV $DEST/doc/metapost/$package/mpp /tmp"); &SYSTEM("chmod a+x /tmp/mpp"); print "YOU-MUST-DO! update mpp to source/.../texlive/\n"; } sub MAKEpbdiagram { &setup; chdir("$DEST/doc/latex/$package"); &SYSTEM("rm -rf mf tfm"); &buildfilelist; &donormal; } # the perltex.pl generated from perltex.dtx must go to the source dir, # so it ends up installed in the bin dir for each arch. sub MAKEperltex { &setup; &buildfilelist; &donormal; print "\t SPECIAL move $package.pl from doc to /tmp\n"; &SYSTEM("$MV $DEST/doc/latex/$package/$package.pl /tmp"); &SYSTEM("chmod a+x /tmp/$package.pl"); print "YOU-MUST-DO! update /tmp/$package.pl to source/.../texlive/\n"; } # pgf mostly is just a copy to the tex dir, but Till has a doc dir at # the same level. # sub MAKEpgf { print "\t SPECIAL pgf\n"; &MAKEcopy ("$DEST/tex"); chdir ("$DEST/tex") || die "chdir($DEST/tex) failed: $!"; print "\t SPECIAL move tex/doc/generic/pgf to doc/generic/pgf\n"; &SYSTEM ("mkdir -p $DEST/doc/generic"); &SYSTEM ("$MV doc/generic/pgf $DEST/doc/generic/pgf"); } # copy seminar files. sub MAKEseminar { &SYSTEM("mkdir -p $DEST/tex/latex/$package"); &SYSTEM("$CP $packagedir/inputs/* $DEST/tex/latex/$package"); # &SYSTEM("mkdir -p $DEST/source/latex/$package"); &SYSTEM("$CP $packagedir/src/* $DEST/doc/latex/$package"); # &SYSTEM("mkdir -p $DEST/doc/latex/$package"); &SYSTEM("$CP $packagedir/*read* $packagedir/doc/* $DEST/doc/latex/$package"); } sub MAKExypic { # this simply copies source files as per INSTALL instructions chdir($packagedir) || die ("ERROR: cannot open directory"); &runjob("mkdir -p $DEST/fonts/source/$Foundry/xypic"); &runjob("mkdir -p $DEST/fonts/type1/$Foundry/xypic"); &runjob("mkdir -p $DEST/fonts/tfm/$Foundry/xypic"); &runjob("mkdir -p $DEST/fonts/pk/cx/$Foundry/xypic"); &runjob("mkdir -p $DEST/tex/generic/xypic"); &runjob("mkdir -p $DEST/dvips/xypic"); &runjob("mkdir -p $DEST/doc/generic/xypic"); &runjob("mkdir -p $DEST/source/generic/xypic"); &runjob("$CP texinputs/* $DEST/tex/generic/xypic"); &runjob("$CP texfonts/* $DEST/fonts/tfm/$Foundry/xypic"); &runjob("$CP mfinputs/* $DEST/fonts/source/$Foundry/xypic"); &runjob("$CP src/* $DEST/doc/generic/xypic"); &runjob("$CP type1/* $DEST/fonts/type1/$Foundry/xypic"); &runjob("$CP ps/* $DEST/dvips/xypic"); &runjob("$CP doc/*.* $DEST/doc/generic/xypic"); &runjob("$CP [A-Z]* $DEST/doc/generic/xypic"); open (TMP,">$DEST/texmf-dist/dvips/xypic/config.xyp"); print TMP "p +xypic.map"; close(TMP); # do the PK files chdir("pkfonts"); &buildfilelist; for (@filenames) { if (-d $_) { chdir $_; s/cx([0-9]*)//; $dpi=$1; opendir(DIR,'.'); @ffontnames =grep(!/^\.\.?$/,readdir(DIR)); closedir(DIR); for (@ffontnames) { ($FileBase,$Filepath,$Filesuffix) = fileparse($_,"\.[A-z0-9]*"); &SYSTEM("mkdir -p $DEST/fonts/pk/cx/$Foundry/xypic/dpi$dpi"); &SYSTEM("$MV $_ $DEST/fonts/pk/cx/$Foundry/xypic/dpi$dpi/$FileBase.pk"); } chdir '..'; } } } sub MAKEborceux { &setup; chdir("$DEST/doc/$whichdocformat/$package/user-guides"); &SYSTEM("$MV -f * $DEST/doc/$whichdocformat/$package"); chdir("$DEST/doc/$whichdocformat/$package/diagram"); &SYSTEM("$MV -f * $DEST/tex/$whichformat/$package"); } sub MAKEbarr { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &SYSTEM("rm *.zip"); &buildfilelist; &dodvi; # rebuild again, as we have .dvi files now &buildfilelist; &domakeindex; &dotex; &dosource; } sub MAKEconcmath { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &SYSTEM("$MV fonts/*/* ."); &buildfilelist; &domf; &dodvi; # rebuild again, as we have .dvi files now &buildfilelist; &domakeindex; &dotex; &dosource; } sub MAKEecc { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &SYSTEM("$MV tfm/* ."); &SYSTEM("$MV src/* ."); &SYSTEM("rmdir src tfm"); &buildfilelist; &domf; &dodvi; # rebuild again, as we have .dvi files now &buildfilelist; &dotex; &domakeindex; &dosource; } sub MAKEplqx { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &SYSTEM("$MV tex/* ."); &SYSTEM("$MV doc/* ."); &SYSTEM("rmdir doc tex"); &buildfilelist; &donormal; } sub MAKEaugie { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &SYSTEM("$MV dvips/* ."); &SYSTEM("$MV tfm/* ."); &SYSTEM("$MV afm/* ."); &SYSTEM("$MV doc/* ."); &SYSTEM("$MV vf/* ."); &SYSTEM("$MV tex/* ."); &SYSTEM("$MV type1/* ."); &SYSTEM("rmdir type1 tex vf afm dvips doc tfm"); &buildfilelist; &donormal; } sub MAKEae { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &SYSTEM("$MV tfm/* ."); &SYSTEM("$MV vf/* ."); &SYSTEM("$MV src/* ."); &SYSTEM("$MV tex/* ."); &SYSTEM("rmdir tex vf src tfm"); &buildfilelist; &dosource; &dotex; &domakeindex; &runfonts; } sub MAKEdevanagr { &xchdir ($packagedir); # print "\t SPECIAL $package: renaming README files\n"; &SYSTEM('for f in *; do test -r $f/README && mv $f/README README.$f; done'); # print "\t SPECIAL $package: moving .c and .exe to /tmp\n"; &SYSTEM('mv bin/devnag.c bin/devnag.exe /tmp'); # print "\t SPECIAL $package: flatten\n"; &xchdir (".."); &MAKEflatten; print "YOU-MUST-DO! update /tmp/devnag.c and devnag.exe into Build\n"; } # We don't want to flatten the templates, only the source. # sub MAKEdisser { &setup; &xchdir ("$DEST/doc/$whichdocformat/$package"); print "\t SPECIAL $package\n"; &SYSTEM ("$MV -f src/* ."); &buildfilelist; &donormal; } sub MAKEeasy { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &SYSTEM("rm doc/*.ps"); &SYSTEM("$MV doc/* $DEST/doc/$whichdocformat/$package"); &buildfilelist; &dodvi; # rebuild again, as we have .dvi files now &buildfilelist; &dotex; &domakeindex; &dosource; } sub MAKEebong { &xchdir ($packagedir); # print "\t SPECIAL $package: moving .py to /tmp\n"; &SYSTEM('mv -v *.py /tmp'); # print "\t SPECIAL $package: flatten\n"; &xchdir (".."); &MAKEflatten; print "YOU-MUST-DO! update /tmp/ebong.py into Build\n"; } sub MAKEfootnpag { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &SYSTEM("$MV src/* ."); &buildfilelist; &dodvi; # rebuild again, as we have .dvi files now &buildfilelist; &dotex; &domakeindex; &dosource; } sub MAKEeplain { print "\t SPECIAL $package\n"; &setup; chdir ($DEST) || die "chdir($DEST) failed: $!"; rename ("tex/eplain/eplain", "tex/eplain/base"); &SYSTEM ("$MV $DOCDIR/eplain.tex tex/eplain/base"); &SYSTEM ("$MV $DOCDIR/btxmac.tex tex/eplain/base"); &SYSTEM ("$MV $DOCDIR/arrow.tex tex/eplain/base"); &SYSTEM ("$MV $DOCDIR/doc doc/eplain/base"); &SYSTEM ("$MV $DOCDIR/[A-L]* $DOCDIR/[M-Z]* doc/eplain/base/"); unlink ("doc/eplain/base/texinfo.tex"); rename ("source/eplain/eplain", "source/eplain/base"); &SYSTEM ("$MV $DOCDIR/* source/eplain/base"); } sub MAKEeqnarray { &setup; chdir("$DEST/doc/$whichdocformat/$package"); open(TMP,">eqnarray.ins"); print TMP "\\def\\batchfile{eqnarray.ins}\n"; print TMP "\\input docstrip\n"; print TMP " \\keepsilent\n"; print TMP " \\generateFile{eqnarray.sty}f{\\from{eqnarray.dtx}{code}}\n"; print TMP "\\end\n"; close(TMP); &buildfilelist; &runins($standardins); &dodvi; &dotex; &domakeindex; &dosource; } sub MAKEfeynmf { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &SYSTEM("gunzip manual.ps"); &buildfilelist; &runins('feynmf.ins'); &buildfilelist; &dosimplemf; &dodvi; &buildfilelist; &domp; &dotex; &domakeindex; &dosource; killfiles($cleanpatt); } sub MAKEchangebar { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &buildfilelist; &donormal; } sub MAKEot2cyr { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &buildfilelist; &dodvi; &buildfilelist; &dotex; &domakeindex; &dosource; &SYSTEM("mkdir -p $DEST/fonts/afm/monotype/timescyr"); &SYSTEM("$MV mnt*.afm $DEST/fonts/afm/monotype/timescyr"); &SYSTEM("mkdir -p $DEST/fonts/tfm/monotype/timescyr"); &SYSTEM("$MV mnt*.tfm $DEST/fonts/tfm/monotype/timescyr"); &SYSTEM("mkdir -p $DEST/fonts/vf/monotype/timescyr"); &SYSTEM("$MV mnt*.vf $DEST/fonts/vf/monotype/timescyr"); &SYSTEM("mkdir -p $DEST/fonts/tfm/bh/luccyr"); &SYSTEM("$MV hl*.tfm ls*.tfm $DEST/fonts/tfm/bh/luccyr"); &SYSTEM("mkdir -p $DEST/fonts/vf/bh/luccyr"); &SYSTEM("$MV hl*.vf $DEST/fonts/vf/bh/luccyr"); killfiles($cleanpatt); } sub MAKEsiam { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &buildfilelist; &dodvi; &buildfilelist; &dobst; &dotex; &domakeindex; &dosource; &SYSTEM("mkdir -p $DEST/doc/plain/siam"); &SYSTEM("mkdir -p $DEST/doc/amstex/siam"); &SYSTEM("mkdir -p $DEST/tex/plain/siam"); &SYSTEM("mkdir -p $DEST/tex/plain/amstex"); &SYSTEM("$MV plain/*doc* $DEST/doc/plain/siam"); &SYSTEM("$MV plain/* $DEST/tex/plain/siam"); &SYSTEM("$MV amstex/*doc* $DEST/doc/amstex/siam"); &SYSTEM("$MV amstex/* $DEST/tex/amstex/siam"); killfiles($cleanpatt); } sub MAKEmisc { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &buildfilelist; &dotex; &domakeindex; killfiles($cleanpatt); } sub MAKEtamethebeast { my $destdir = "$DEST/doc/english/$package"; &SYSTEM("mkdir -p $destdir"); &SYSTEM("$CP -r $packagedir/* $destdir"); } sub MAKEtexdraw { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &buildfilelist; &dotex; &domakeindex; &SYSTEM("mkdir -p $DEST/doc/generic/texdraw"); &SYSTEM("$MV manual/* $DEST/doc/generic/texdraw"); killfiles($cleanpatt); } sub MAKEexpressg { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &buildfilelist; $inspatt = $specialins{$package}; &buildfilelist; if ($inspatt eq "") { $inspatt=$standardins; } &runins($inspatt); &SYSTEM("mpost expeg.mp"); # rebuild the list of files in the directory &buildfilelist; &dodvi; # rebuild again, as we have .dvi files now &buildfilelist; &runfonts; &dobst; &dobib; &dotex; &domakeindex; &dosource; &dotype1; # # this is a bit weird, but its an easy way to remove # empty directories that we never used. # &SYSTEM("rmdir $DEST/tex/$whichformat/$package 2> /dev/null"); &SYSTEM("rmdir $DEST/doc/$whichdocformat/$package 2> /dev/null"); &SYSTEM("rmdir $DEST/source/$whichformat/$package 2> /dev/null"); killfiles($cleanpatt); } sub MAKEtipa { # this simply copies source files chdir($packagedir) || die ("ERROR: cannot open directory"); &runjob("mkdir -p $DEST/fonts/source/$Foundry/tipa"); &runjob("mkdir -p $DEST/fonts/type1/$Foundry/tipa"); &runjob("mkdir -p $DEST/fonts/tfm/$Foundry/tipa"); &runjob("mkdir -p $DEST/fonts/map/dvips/tipa"); &runjob("mkdir -p $DEST/tex/latex/tipa"); &runjob("mkdir -p $DEST/doc/fonts/tipa"); &runjob("mkdir -p $DEST/source/latex/tipa"); &runjob("$CP dvips/* $DEST/fonts/map/dvips/tipa"); &runjob("$CP sty/* $DEST/tex/latex/tipa"); &runjob("$CP tfm/* $DEST/fonts/tfm/$Foundry/tipa"); &runjob("$CP type1/* $DEST/fonts/type1/$Foundry/tipa"); &runjob("$CP mf/* $DEST/fonts/source/$Foundry/tipa"); &runjob("$CP doc/* $DEST/doc/fonts/tipa"); } sub MAKEpslatex { # this simply copies source files chdir($packagedir) || die ("ERROR: cannot open directory"); &runjob("mkdir -p $DEST/fonts/tfm/$Foundry/pslatex"); &runjob("mkdir -p $DEST/fonts/vf/$Foundry/pslatex"); &runjob("mkdir -p $DEST/tex/latex/pslatex"); &runjob("mkdir -p $DEST/dvips/pslatex"); &runjob("mkdir -p $DEST/doc/latex/pslatex"); &runjob("$CP latex/* $DEST/tex/latex/pslatex"); &runjob("$CP tfm/* $DEST/fonts/tfm/$Foundry/pslatex"); &runjob("$CP vf/* $DEST/fonts/vf/$Foundry/pslatex"); &runjob("$CP dvips/* $DEST/dvips/pslatex"); &runjob("$CP -r fontinst $DEST/doc/latex/pslatex"); &runjob("$CP -r shell $DEST/doc/latex/pslatex"); } sub MAKEeco { # this simply copies source files chdir($packagedir) || die ("ERROR: cannot open directory"); &runjob("mkdir -p $DEST/fonts/tfm/$Foundry/eco"); &runjob("mkdir -p $DEST/fonts/vf/$Foundry/eco"); &runjob("mkdir -p $DEST/tex/latex/eco"); &runjob("mkdir -p $DEST/dvips/eco"); &runjob("mkdir -p $DEST/doc/latex/eco"); &runjob("$CP src/*sty $DEST/tex/latex/eco"); &runjob("$CP fd/* $DEST/tex/latex/eco"); &runjob("$CP tfm/* $DEST/fonts/tfm/$Foundry/eco"); &runjob("$CP vf/* $DEST/fonts/vf/$Foundry/eco"); &runjob("$CP -r src/*tex src/*x src/*sh $DEST/doc/latex/eco"); &runjob("$CP -r [A-Z]* $DEST/doc/latex/eco"); } sub MAKEelhyphen { &setup; &buildfilelist; &donormal; print "\t SPECIAL $package: lowercase names\n"; &SYSTEM('for f in GR*hyph*.tex; do mv $f `echo $f | tr A-Z a-z`; done'); print "\t SPECIAL $package: install gr*hyph.tex files\n"; my $generichyphdir = "$TOPDEST/texmf/tex/generic/hyphen"; &SYSTEM("mkdir -p $generichyphdir"); &SYSTEM("$MV gr*hyph*.tex $generichyphdir"); print "YOU-MUST-DO! $package: update texmf/tex/generic/config/language.gr.dat\n"; print "YOU-MUST-DO! $package: update texmf/tpm/hyphen-greek.tpm\n"; print "YOU-MUST-DO! $package: add to texmf/tpm/collection-langgreek.tpm\n"; } sub MAKEcatalog { # this simply copies source files $DEST="$TDS/catalogue/texmf-doc"; chdir($packagedir) || die ("ERROR: cannot open directory"); &runjob("mkdir -p $DEST/doc/english/catalogue"); &runjob("$CP -r * $DEST/doc/english/catalogue"); chdir("$DEST/doc/html/catalogue/entries") || die ("ERROR cannot chdir $DEST/doc/english/catalogue/entries"); &buildfilelist; foreach $File (grep(/.html$/,@filenames)) { print "process $File\n"; open FOO,">$File.new"; open BAR,"$File"; while () { s|\.\./\.\./\.\.|http://theory.uwinnipeg.ca/scripts/CTAN|g; print FOO ; } close FOO; close BAR; &SYSTEM("$MV $File.new $File"); } } # all the lshort translations are pretty similar. sub MAKElshort { print "MAKElshort\n"; (my $lang = $package) =~ s,.*-,,; # lshort-english -> english my $destdir = "$DEST/doc/$lang/$package"; &SYSTEM("mkdir -p $destdir"); &SYSTEM("$CP -r $packagedir/* $destdir"); # keep only pdf's to save space. &SYSTEM("cd $destdir && rm -f lshort*.ps *lshort*.ps.*z* lshort*.dvi lshort-*-book.zip"); } sub MAKEltt { # this simply copies source files chdir($packagedir) || die ("ERROR: cannot open directory"); &runjob("mkdir -p $DEST/doc/ltt"); &runjob("$CP * $DEST/doc/ltt"); } sub MAKEpstricks { # this simply copies source files &xchdir ($packagedir); &runjob("mkdir -p $DEST/tex/generic/pstricks"); &runjob("mkdir -p $DEST/doc/generic/pstricks"); &runjob("mkdir -p $DEST/source/generic/pstricks"); &runjob("mkdir -p $DEST/tex/latex/pstricks"); &runjob("mkdir -p $DEST/dvips/pstricks"); &runjob("$CP generic/* $DEST/tex/generic/pstricks"); &runjob("$CP latex/* $DEST/tex/latex/pstricks"); &runjob("$CP -r doc/* $DEST/doc/generic/pstricks"); &runjob("mv $DEST/doc/generic/pstricks/Changes $DEST/doc/generic/pstricks/Changes.doc"); &runjob("$CP dvips/* $DEST/dvips/pstricks"); &runjob("$CP [A-Z]* $DEST/doc/generic/pstricks"); chdir($packagedir); } sub MAKEwilson { &setup; my $docdir = "$DEST/doc/$whichdocformat/$package"; chdir ($docdir) || die "chdir($docdir) failed: $!"; my $mapdir = "$DEST/fonts/map/dvips/$package"; -d $mapdir || &SYSTEM ("mkdir -p $mapdir"); &SYSTEM ("$MV *.map $mapdir"); # archaicprw.map opendir(DIR,'.') || die "opendir(.) failed: $!"; @dirnames =grep(!/^\.\.?$/,readdir(DIR)); closedir(DIR); for my $d (@dirnames) { if ($d =~ /\.zip$/) { unlink ("$docdir/$d"); next; } my $target = "$docdir/$d"; next if ! -d $target; # samples/readme files print "PROCESS Wilson subdir $d\n"; chdir ($target) || die "chdir($target) failed: $!"; if ($d) { for my $f (glob ("try*"), glob ("*.pdf"), "README") { my $dest = "$docdir/"; $dest .= "$d-" if $f !~ /$d/; $dest .= $f; &runjob("$MV $f $dest"); } } &buildfilelist; # run the .ins files (if any) supplied $inspatt = $specialins{$package}; &buildfilelist; &runins($inspatt || $standardins); &dodvi; &domf; &dodvi; # rebuild again, as we have .dvi files now &buildfilelist; &runfonts; &dobst; &dobib; &dotex; &domakeindex; &dosource; &dotype1; killfiles($cleanpatt); } killfiles($cleanpatt); } sub MAKEt2 { # this simply copies source files chdir($packagedir) || die ("ERROR: cannot open directory"); &runjob("mkdir -p $DEST/dvips/t2"); &runjob("mkdir -p $DEST/tex/fontinst/cyrfinst"); &runjob("mkdir -p $DEST/tex/plain/cyrplain"); &runjob("mkdir -p $DEST/tex/latex/t2"); &runjob("mkdir -p $DEST/doc/generic/t2"); &runjob("$CP -r cyrfinst/* $DEST/tex/fontinst/cyrfinst"); &runjob("$CP -r cyrplain/* $DEST/tex/plain/cyrplain"); &runjob("$CP enc-maps/encfiles/* $DEST/fonts/enc/t2"); &runjob("$CP enc-maps/*.* enc-maps/[A-Z]* $DEST/doc/generic/t2"); &runjob("$CP -r etc examples $DEST/doc/generic/t2"); chdir("$DEST/doc/generic/t2/etc"); &runjob("latex mathtext.ins"); &runjob("rm *log; mv *sty $DEST/tex/latex/t2"); } sub MAKEcontext { # this simply copies source files chdir($packagedir) || die ("ERROR: cannot open directory"); &runjob("mkdir -p $DEST"); &runjob("$CP cont-tmf.zip cont-wrk.zip cont-uti.zip $DEST"); chdir($DEST) || die ("ERROR: cannot open directory"); &runjob("unzip -o cont-tmf"); &runjob("unzip -o cont-uti"); &runjob("unzip -o cont-wrk"); &runjob("mkdir web2c"); &runjob("cd tex/context/config; mv texexec.rm texexec.ini"); &runjob("rm cont-tmf.zip cont-wrk.zip cont-uti.zip "); open FOO,">tex/context/config/cont-cz.ini"; print FOO "\\input cont-cz.tex\n"; print FOO "\\endinput"; close FOO; open FOO,">tex/context/config/cont-de.ini"; print FOO "\\input cont-de.tex\n"; print FOO "\\endinput"; close FOO; open FOO,">tex/context/config/cont-en.ini"; print FOO "\\input cont-en.tex\n"; print FOO "\\endinput"; close FOO; open FOO,">tex/context/config/cont-nl.ini"; print FOO "\\input cont-nl.tex\n"; print FOO "\\endinput"; close FOO; open FOO,">tex/context/config/cont-uk.ini"; print FOO "\\input cont-uk.tex\n"; print FOO "\\endinput"; close FOO; open FOO,">tex/context/config/context.ini"; print FOO "\\input context.tex\n"; print FOO "\\endinput"; close FOO; # &runjob("sed 's/\#\#//' < `kpsewhich fmtutil.cnf` > /tmp/fmtutil.$Jobid"); # &runjob("TEXMFLOCAL=$DEST VARTEXMF=$DEST fmtutil --cnffile /tmp/fmtutil.$Jobid --fmtdir web2c --byfmt cont-en"); # &runjob("TEXMFLOCAL=$DEST VARTEXMF=$DEST fmtutil --cnffile /tmp/fmtutil.$Jobid --fmtdir web2c --byfmt cont-de"); # &runjob("TEXMFLOCAL=$DEST VARTEXMF=$DEST fmtutil --cnffile /tmp/fmtutil.$Jobid --fmtdir web2c --byfmt cont-nl"); # &runjob("rm /tmp/fmtutil.$Jobid"); } # docs in two languages. The English one is in a separate package, # mathmode. Just remove it from the copy when building the German one. # sub MAKEvossde { my $docdir = "$DEST/doc/german/$package"; &SYSTEM("mkdir -p $docdir"); &SYSTEM("$CP -r $packagedir/* $docdir"); &SYSTEM("rm -r $docdir/mathmode"); } # includes shell script. sub MAKEvpe { &xchdir ($packagedir); # print "\t SPECIAL $package: moving vpe.pl to /tmp\n"; &SYSTEM('mv vpe.pl /tmp/vpe'); # &xchdir (".."); &donormal (); # print "YOU-MUST-DO! update /tmp/vpe to source/texk/texlive\n"; } sub MAKEwordcount { &xchdir ($packagedir); # print "\t SPECIAL $package: moving wordcount.sh to /tmp\n"; &SYSTEM('mv wordcount.sh /tmp/'); # &xchdir (".."); &donormal (); # print "YOU-MUST-DO! update /tmp/wordcount.sh to source/texk/texlive\n"; } sub MAKEukrhyph { # this simply copies source files chdir($packagedir) || die ("ERROR: cannot open directory"); &runjob("mkdir -p $DEST/tex/generic/ukrhyph"); &runjob("mkdir -p $DEST/doc/generic/ukrhyph"); &runjob("$CP README $DEST/doc/generic/ukrhyph"); &runjob("$CP *.* $DEST/tex/generic/ukrhyph"); &runjob("$MV $DEST/tex/generic/ukrhyph/*.pdf $DEST/doc/generic/ukrhyph"); &runjob("rm $DEST/tex/generic/ukrhyph/*.ps"); } sub MAKElfb { # remove pregenerated pk files. &MAKEflatten (); print "\t SPECIAL removing lfb PK files\n"; &SYSTEM("rm *pk"); } sub MAKElh { &MAKEcopy (); } sub MAKEliterat { # this simply copies source files chdir($packagedir) || die ("ERROR: cannot open directory"); &runjob("mkdir -p $DEST/fonts/tfm/paragrap/literat"); &runjob("mkdir -p $DEST/fonts/vf/paragrap/literat"); &runjob("mkdir -p $DEST/fonts/type1/paragrap/literat"); &runjob("mkdir -p $DEST/fonts/afm/paragrap/literat"); &runjob("mkdir -p $DEST/tex/latex/literat"); &runjob("mkdir -p $DEST/dvips/literat"); &runjob("mkdir -p $DEST/doc/fonts/literat"); &runjob("$CP dvips/* $DEST/dvips/literat"); &runjob("$CP tex/*tex $DEST/doc/fonts/literat"); &runjob("$CP psfonts/*pfb $DEST/fonts/type1/paragrap/literat"); &runjob("$CP psfonts/*inf $DEST/fonts/type1/paragrap/literat"); &runjob("$CP psfonts/*afm $DEST/fonts/afm/paragrap/literat"); &runjob("$CP tex/*sty tex/*fd $DEST/tex/latex/literat"); &runjob("$CP tfm/* $DEST/fonts/tfm/paragrap/literat"); &runjob("$CP tfm-raw/* $DEST/fonts/tfm/paragrap/literat"); &runjob("$CP vf/* $DEST/fonts/vf/paragrap/literat"); &runjob("$CP [A-Z]* insta* license $DEST/doc/fonts/literat"); } sub MAKExmltex { # this simply copies source files chdir($packagedir) || die ("ERROR: cannot open directory"); &runjob("mkdir -p $DEST/tex/xmltex/config"); &runjob("mkdir -p $DEST/tex/xmltex/base"); &runjob("mkdir -p $DEST/doc/xmltex/base"); &runjob("$CP *.ini $DEST/tex/xmltex/config"); &runjob("$CP xmltex.tex *xmt xmltex.cfg $DEST/tex/xmltex/base"); &runjob("$CP manual* *xml test* *txt $DEST/doc/xmltex/base"); } sub MAKEbase { &SYSTEM("mkdir -p $DEST/tex/latex/base"); &SYSTEM("mkdir -p $DEST/doc/latex/base"); &SYSTEM("mkdir -p $DEST/doc/latex/base"); if (-f "$packagedir/00Contents" ) { unlink "$packagedir/00Contents" ; } &SYSTEM("$CP -r $packagedir/* $DEST/doc/latex/base"); chdir($packagedir) || die ("ERROR: cannot open directory"); $package="base"; $DEST="$TDS/ltxbase/texmf-dist"; print "!$whichformat $packagedir ($package) -> $DEST\n"; &donormal; } sub MAKEfancyvrb { &setup; chdir("$DEST/doc/latex/$package"); print "\t SPECIAL $package: move contrib\n"; &SYSTEM("$MV contrib/README README.contrib"); &SYSTEM("$MV contrib/* .; rmdir contrib"); &buildfilelist; &donormal; } sub MAKEfeatpost { &setup; chdir("$DEST/doc/metapost/$package") || die "chdir($DEST/doc/metapost/$package) failed: $!"; print "\t SPECIAL $package, leaving most in doc\n"; @filenames = glob("macro/*.mp"); &install("$DEST/metapost/featpost", ".mp"); &SYSTEM("rm -rf system"); # seeing his texmf.cnf will only confuse people } sub MAKEucs { &setup; chdir("$DEST/doc/latex/$package"); &SYSTEM("$MV data $DEST/tex/latex/ucs"); &SYSTEM("$MV *def *sty $DEST/tex/latex/ucs"); &SYSTEM("$MV contrib/* $DEST/tex/latex/ucs"); } sub MAKEtexsis { &setup; chdir("$DEST/doc/texsis/$package"); &SYSTEM("make TXSsite.tex"); &buildfilelist; &donormal; &SYSTEM("rm *.ps"); } sub MAKEthumbpdf { &donormal; my $myscriptdir = "$TOPDEST/texmf/scripts/thumbpdf"; &SYSTEM("mkdir -p $myscriptdir/"); &SYSTEM("mv thumbpdf.pl $myscriptdir/"); } sub MAKEIEEEtran { print "\t SPECIAL renaming README files, then flatten\n"; chdir ($packagedir) || die "chdir($packagedir) failed: $!"; &SYSTEM('for f in *; do test -r $f/README && mv $f/README README.$f; done'); chdir (".."); &MAKEflatten; # let's not worry about the fact that the tex run on testflow fails (it # wants a paper size); we still get the distributed pdf, which is good enough. } sub MAKEbardiag { &setup; chdir("$DEST/doc/latex/$package"); &SYSTEM("$MV doc/* ."); &buildfilelist; &donormal; } sub MAKEmathpazo { &setup; chdir("$DEST/doc/latex/$package"); &SYSTEM("$MV latex/* type1/* afm/* vf/* tfm/* dvips/* .; rmdir latex type1 afm vf tfm dvips"); &buildfilelist; &donormal; } sub MAKEhaprosper { &setup ("nocopytodoc"); # create dirs but that's all chdir("$packagedir"); &SYSTEM("mkdir -p $DEST"); print "\t SPECIAL copying HA-prosper\n"; &SYSTEM("$CP -r README Doc/* $DEST/doc/latex/HA-prosper"); &SYSTEM("$CP -r Run/* $DEST/tex/latex/HA-prosper"); &SYSTEM("$CP -r Source/* $DEST/source/latex/HA-prosper"); } sub MAKEpclnfss { chdir("$packagedir"); &SYSTEM("mkdir -p $DEST/source/fonts/pclnfss"); &SYSTEM("mkdir -p $DEST/doc/fonts/pclnfss"); &SYSTEM("$CP -r [A-Z]* $DEST/doc/fonts/pclnfss"); &SYSTEM("$CP -r fonts $DEST"); &SYSTEM("$CP -r tex $DEST"); &SYSTEM("$CP -r src/* tests $DEST/source/fonts/pclnfss"); } sub MAKEbeamer { &xchdir ($packagedir); my $destdoc = "$DEST/doc/latex/beamer"; &SYSTEM ("mkdir -p $destdoc"); &SYSTEM ("$CP -r * $destdoc"); &xchdir ($destdoc); my $desttex = "$DEST/tex/latex/beamer"; &SYSTEM("mkdir -p $desttex"); &SYSTEM("$MV base/* themes emulation extensions/multimedia $desttex"); } # this doesn't really work yet. sub MAKEbeebe { &setup; print "\t SPECIAL moving beebe .bib and .bst\n"; chdir ("$DEST/doc/latex/$package") || die; &SYSTEM("mkdir -p $DEST/bibtex/bib/beebe $DEST/bibtex/bst/beebe"); &SYSTEM("$MV tex*.bib tug*.bib $DEST/bibtex/bib/beebe"); #xx ugh, they aren't there &SYSTEM("$MV *.bst $DEST/bibtex/bst/beebe"); &SYSTEM("rm *"); } # pstricks packages usually support both plain and latex. # sub MAKEpst { print "\t SPECIAL pst $package starts\n"; $standardtex = qq{^$package(Obj)?\.(tex|sty)}; # for pst-laboObj.tex $whichformat='generic'; $whichdocformat='generic'; $specialsourcefmt{$package}='generic'; &setup; &xchdir("$DEST/doc/$whichdocformat/$package"); &buildfilelist; $inspatt=$standardins if ! $inspatt; &runins($inspatt); &buildfilelist; &dosource; &dotex; &dotype1; killfiles($cleanpatt); &SYSTEM("mkdir -p $DEST/tex/latex/$package"); &SYSTEM("mv $DEST/tex/generic/$package/*sty $DEST/tex/latex/$package"); &SYSTEM("mv $DEST/doc/generic/$package/*sty $DEST/tex/latex/$package"); &SYSTEM("mv $DEST/doc/generic/$package/*cfg $DEST/tex/latex/$package"); if (-f "scripts/ps4pdf") { print "YOU-MUST-DO! copy scripts/ps4pdf to source/texk/tetex\n"; } } # pst-geo specialities # sub MAKEpstgeo { print "\t SPECIAL pst-geo $package starts\n"; $standardtex = qq{^$package(Obj)?\.(tex|sty)}; # for pst-laboObj.tex $whichformat='generic'; $whichdocformat='generic'; $specialsourcefmt{$package}='generic'; &setup; &xchdir("$DEST/doc/$whichdocformat/$package"); -d <*/*/*/*/*/.> && &SYSTEM("$MV -f */*/*/*/* ."); -d <*/*/*/*/.> && &SYSTEM("$MV -f */*/*/* ."); -d <*/*/*/.> && &SYSTEM("$MV -f */*/* ."); -d <*/*/.> && &SYSTEM("$MV -f */*/* ."); -d <*/.> && &SYSTEM("$MV -f */* ."); &SYSTEM("find -type d -print | xargs rmdir 2>/dev/null"); &SYSTEM("find -type f -print >/tmp/find"); &buildfilelist; $inspatt=$standardins if ! $inspatt; &runins($inspatt); &buildfilelist; &dosource; &dotex; &dotype1; killfiles($cleanpatt); &SYSTEM("mkdir -p $DEST/tex/latex/$package"); &SYSTEM("mv $DEST/tex/generic/$package/*sty $DEST/tex/latex/$package"); &SYSTEM("mv $DEST/doc/generic/$package/*sty $DEST/tex/latex/$package"); &SYSTEM("mv $DEST/doc/generic/$package/*cfg $DEST/tex/latex/$package"); } sub MAKEfontinst { chdir("$packagedir"); &runjob("mkdir -p $DEST/tex/latex/fontinst"); &runjob("mkdir -p $DEST/tex/fontinst"); &runjob("mkdir -p $DEST/source/fontinst"); &runjob("mkdir -p $DEST/doc/fontinst/base"); &runjob("$CP -r examples test $DEST/doc/fontinst/base"); &runjob("$CP -r doc/* README test $DEST/doc/fontinst/base"); &runjob("$CP -r source $DEST/source/fontinst/base"); &runjob("$CP -r latex/* $DEST/tex/latex/fontinst"); &runjob("$CP -r inputs/* $DEST/tex/fontinst"); } sub MAKEpsnfss { # we use the psnfss.zip from the latex-tds project. # But we don't want the actual tfm/vf; TL has many more tfm's (in # different packages), and we don't want to mess with that. So just # remove the fonts subdir -- except for the map files, which we do want. # print "\t SPECIAL omit fonts from latex-tds $package\n"; # Start with the usual straight copy. &MAKEcopy (); # Then remove the entire fonts tree. &xchdir ("$DEST/fonts"); &SYSTEM ("rm -rf enc tfm vf"); } sub MAKEkoma { # tds zip file provided, unzip and copy. # &xchdir ($packagedir); # print "\t SPECIAL $package unzip and copy\n"; &SYSTEM ("unzip -q komascript.tds.zip"); &SYSTEM ("rm -f *"); # remove the top-level files, they're in the zip # &xchdir (".."); &MAKEcopy (); } sub MAKEcmlgc { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &SYSTEM("rm -rf vtex"); &MAKEflatten; } sub MAKEpict2e { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &setup; chdir("$DEST/doc/$whichdocformat/$package"); &buildfilelist; # run the .ins files (if any) supplied $inspatt = $specialins{$package} || $standardins; $Foundry = $specialfoundry{$package} || $standardfoundry; &runins($inspatt); # rebuild the list of files in the directory &SYSTEM("$MV pict2e-example.cfg pict2e.cfg"); &buildfilelist; &dodvi; # rebuild again, as we have .dvi files now &buildfilelist; &dotex; &dosource; &SYSTEM("rmdir $DEST/tex/$whichformat/$package 2> /dev/null"); &SYSTEM("rmdir $DEST/source/$whichformat/$package 2> /dev/null"); &SYSTEM("rmdir $DEST/doc/$whichdocformat/$package 2> /dev/null"); killfiles($cleanpatt); } sub MAKEpictex { &setup; chdir ($DOCDIR) || die "chdir($DOCDIR) failed: $!"; &SYSTEM("rm -rf mathspic"); # separate package &SYSTEM("mv addon/* .; rmdir addon"); &donormal; } sub MAKElistings { &setup; chdir("$DEST/doc/$whichdocformat/$package"); &setup; chdir("$DEST/doc/$whichdocformat/$package"); &SYSTEM("$MV listings*pdf listings.pdf"); &donormal; } # Allow overrides. In particular, CTAN can change some hashes to make # packages with licenses that TL doesn't allow. # # Put the config file "ctan2tds-config.pl" in the dir from which you # run this script, or better, set the environment variable "CTAN2TDS_CONFIG". # sub readconfig { my ($base,$dir,$ext) = fileparse ($0,'\.pl'); my $configFileName = "$dir/$base-config.pl"; $configFileName = $ENV{"CTAN2TDS_CONFIG"} || $configFileName; my $result; if (-f $configFileName) { my $err = "Error: CTAN config file $configFileName"; $result = eval `cat $configFileName`; # like require, but no look in INC die "$err; evaluation in file failed: $@" if $@; die "$err; yielded result that is false" unless $result; } else { $result=1; } return $result; }