#!/bin/sh # $Id$ # # Create the .iso file system images for TeX Live: # a) live: the complete uncompressed system (for DVD) # b) inst: compressed zip files and installer only (CD) # # In 2003, we also produced: # c) demo: live subset which can be run as is (CD) # but this was dropped in 2004. # # Copyright 2003, 2004, 2005 Sebastian Rahtz. # Copyright 2006 TeX Users Group. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Send bug reports or suggestions to tex-live@tug.org. unset CDPATH # avoid output from cd umask 0 HERE=`cd \`dirname $0\` && /bin/pwd` cd $HERE || exit 1 # the Tools directory master=`cd ../../Master && /bin/pwd` NAME=texlivetest V=2006 D=`date +%Y%m%d` debug=${OVERRIDE_DEBUG-false} target=/home/ftp/texlive/Images/test work=/home/texlive/tmp/TL_$$ zippath=/usr/local/bin quiet= # for passing to mkisofs makelive=true makeinst=true mkisofs=mkisofs while test $# -gt 0; do case $1 in --debug) debug=true; quiet=;; --mkisofs=*) mkisofs=`echo $1 | sed 's/.*=//'`;; --noinst) makeinst=false;; --nolive) makelive=false;; --quiet) quiet=-quiet;; --source=*) master=`echo $1 | sed 's/.*=//'`;; --work=*) work=`echo $1 | sed 's/.*=//'`;; --target=*) target=`echo $1 | sed 's/.*=//'`;; --zippath=*) zippath=`echo $1 | sed 's/.*=//'`;; *) break;; esac shift done if $debug; then echo "master = $master" echo "target = $target" echo "work = $work" fi mkdir -p $target common_mkisofs_options=" $quiet -pad -J -dir-mode 0755 -r \ -copyright LICENSE.TL \ -x install-live.sh -x install-compr.sh \ -x install-pkg-compr.sh -x install-pkg-live.sh \ -x ./support/tests \ -x .svn \ " # MAKELIVE () { live_iso=$target/$NAME$V-live-$D.iso echo "--- `date` Writing complete live image to $live_iso." # Basically copy the master directory. (cd $master || exit 1 # Complication: get the right install-tl.sh. rm -f install-tl.sh install-pkg.sh cp -p install-live.sh install-tl.sh cp -p install-pkg-live.sh install-pkg.sh # Another complication: getting the release date into 00LIVE.TL. svn revert 00LIVE.TL echo "Release date: $D.`date +%H`" >>00LIVE.TL # remove old images. rm -f $target/$NAME$V-live-*.iso $target/$NAME$V-live-*.iso.md5 rm -f $target/$NAME$V-live-*.iso.bz2 $target/$NAME$V-live-*.iso.bz2.md5 # make new image, excluding the compressed stuff and more, # and moving everything to a texlive/ subdirectory, # since that's how we release it on the DVD. mkisofs $common_mkisofs_options -root texlive -x 00INST.TL \ -o $live_iso . md5sum $live_iso >$live_iso.md5 # compress the live image, helps people downloading test images. # (the inst image doesn't compress enough to be worthwhile.) bzip2 -v <$live_iso >$live_iso.bz2 md5sum $live_iso.bz2 >$live_iso.bz2.md5 rm -f install-tl.sh install-pkg.sh svn revert 00LIVE.TL ) # make symlink with short name (used in /etc/fstab). for ext in "" .bz2; do rm -f $target/$NAME-live.iso$ext $target/$NAME-live.iso$ext.md5 ln -s `basename $live_iso$ext` $target/$NAME-live.iso$ext ln -s `basename $live_iso`$ext.md5 $target/$NAME-live.iso$ext.md5 ls -l $live_iso$ext done } # MAKEINST () { inst_iso=$target/$NAME$V-inst-$D.iso echo "--- `date` Writing compressed/installable Unix image to $inst_iso." WORK=$work/TL test -d $WORK && rm -rf $WORK mkdir -p $WORK $debug && echo " makeinst: copy top-level files..." cd $master || exit 1 tar cf - \ support \ .mkisofsrc config.* autorun.inf \ install-compr.sh install-pkg-compr.sh common.sh utils.sh \ COPYING \ LICENSE.TL \ README.* \ setuptl/* \ source \ texmf-doc/doc/*/texlive-* \ 00INST.TL *html \ | (cd $WORK && tar xf - ) $debug && echo " makeinst: set up texmf-var..." mkdir $WORK/texmf-var cd $master/texmf-dist || exit 1 tar cf - \ tex/plain/config/language.def \ tex/context/config/cont-usr.tex \ | (cd $WORK/texmf-var; tar xf - ) cd $master/texmf || exit 1 # updmap.cfg gets generated at install time, we don't want to copy the # one from the distribution. tar cf - \ web2c/mktex.cnf \ dvips/config/config.ps \ dvipdfm/config/config \ tex/generic/config/pdftexconfig.tex \ xdvi/XDvi \ | (cd $WORK/texmf-var; tar xf - ) chmod -R u+rw $WORK/texmf-var # the originals are mostly 444 # make zip file out of texmf-var, so we don't have an ersatz tree # hanging around in the image to confuse users. mkdir -p $WORK/archive cd $WORK/texmf-var || exit 1 zip -qr $WORK/archive/texmf-var.zip . cd $WORK && rm -rf texmf-var $debug && echo " makeinst: prepare zip files..." PATH=$PATH:$zippath; export PATH cd $master || exit 1 # people want to get the windows binaries, so don't exclude everything. # bzip2, perl, windvi, lib-* -- basically required. for i in texmf/lists/*; do # exclude binaries for all architectures except i386-linux, MacOSX, and # Windows. No room any more. (echo "$i" | grep '/bin-.*\.' \ | egrep -v '\.(i386-linux|powerpc-darwin|win32)') \ >/dev/null \ && continue # && ($debug && echo " excluding $i"; true) \ I=`basename $i` cat $i | zip -y -q -r $WORK/archive/$I.zip -@ done # copy tpm directories cd $master || exit 1 tar cf - texmf/lists texmf/tpm texmf-dist/tpm texmf-doc/tpm \ | (cd $WORK; tar xf - ) cd $WORK || exit 1 # fix up top level. rm -f install-tl.sh install-pkg.sh mv install-compr.sh install-tl.sh mv install-pkg-compr.sh install-pkg.sh chmod a+w 00INST.TL echo "Release date: $D.`date +%H`" >>00INST.TL rm -f $target/$NAME$V-inst-*.iso $target/$NAME$V-inst-*.iso.md5 mkisofs $common_mkisofs_options -x 00LIVE.TL \ -o $inst_iso . md5sum $inst_iso >$inst_iso.md5 # symlink with short name. rm -f $target/$NAME-inst.iso $target/$NAME-inst.iso.md5 ln -s `basename $inst_iso` $target/$NAME-inst.iso ln -s `basename $inst_iso`.md5 $target/$NAME-inst.iso.md5 } $makelive && MAKELIVE $makeinst && MAKEINST rm -rf $work $WORK