#!/bin/sh -e # $Id$ # # Create the .iso file system images for TeX Live: # a) live: the complete uncompressed system (for DVD) # # Copyright 2007, 2008, 2009 Karl Berry. # Copyright 2003, 2004, 2005 Sebastian Rahtz. # # This file is licensed under the GNU General Public License version 2 # or any later version. # # In 2003, we also produced: # c) demo: live subset which can be run as is (CD) # but this was dropped in 2004. # # From 2004-2007, we also produced: # b) inst: compressed zip files and installer only (CD) # but this was dropped in 2008. # # Send bug reports or suggestions to tex-live@tug.org. unset CDPATH # avoid output from cd umask 0 renice +19 -p $$ >/dev/null 2>&1 mydir=`cd \`dirname $0\` && /bin/pwd` cd $mydir || exit 1 # the Master/tlpkg/bin directory master=`cd ../.. && /bin/pwd` test -z "$master" && exit 1 NAME=texlive V=2009 D=`date +%Y%m%d` debug=${OVERRIDE_DEBUG-false} target=/home/ftp/texlive/Images/test quiet= # for passing to mkisofs makelive=true maketar=true mkisofs=mkisofs while test $# -gt 0; do case $1 in --debug) debug=true; quiet=;; --help) echo "$0: No help, use the source, sorry."; exit 0;; --master=*) master=`echo $1 | sed 's/.*=//'`;; --mkisofs=*) mkisofs=`echo $1 | sed 's/.*=//'`;; --nolive) makelive=false;; --notar) maketar=false;; --quiet) quiet=-quiet;; --target=*) target=`echo $1 | sed 's/.*=//'`;; --version) echo "$0 for $NAME-$V ($D)"; exit 0;; # who cares ... *) echo "$0: unknown option $1; try --help if you need it." >&2; exit 1;; esac shift done if $debug; then echo "master = $master" echo "target = $target" fi mkdir -p $target # From the days when we made multiple images. Keep it factored out in # case they come back. common_mkisofs_options=" $quiet -pad -J -dir-mode 0755 -r \ -copyright LICENSE.TL \ -x .svn \ " # MAKELIVE () { prefix=$target/$NAME$V # directory and prefix for our files within live_iso=$prefix-$D.iso echo "-- `date` Writing live image to $live_iso." # remove old images and checksums. rm -f $prefix-*.iso* $prefix-*.md5 $prefix-*.sha256 # The Master directory is the image. (cd $master && mkisofs $common_mkisofs_options -o $live_iso .) || return # also make compressed version, helps people downloading test images. # this takes two hours or so, so write to a temp file and then rename. xz -9 -v <$live_iso >$live_iso.xz.part mv $live_iso.xz.part $live_iso.xz # make checksums # and symlinks with short names (potentially used in /etc/fstab). for ext in "" .xz; do rm -f $prefix.iso$ext $prefix.iso$ext.md5 $prefix.iso$ext.sha256 (cd $target && md5sum `basename $live_iso$ext`) >$live_iso$ext.md5 (cd $target && sha256sum `basename $live_iso$ext`) >$live_iso$ext.sha256 ln -s `basename $live_iso$ext` $prefix.iso$ext ln -s `basename $live_iso`$ext.md5 $prefix.iso$ext.md5 ln -s `basename $live_iso`$ext.sha256 $prefix.iso$ext.sha256 ls -l $live_iso$ext done } # # Make the tar files: the sources, the texmf trees, the binaries, the # minor "extra" files. Each should unpack into its directory name. We # use the GNU tar --transform option to avoid copying the whole # hierarchy to temp directory. This auxiliary function takes that name # as its first argument, and the files to archive as the rest. # do_tar () { if $debug; then verbose="-v --show-transformed-names" else verbose= fi compress=--xz tar_common_opt="--exclude-vcs $compress $verbose" # name=$1 shift tarfile=$target/$name.tar.xz tar -cf "$tarfile" --owner=0 --group=0 \ --transform="s,^,$name/," $tar_common_opt \ "$@" (cd $target && sha256sum `basename $tarfile`) >$tarfile.sha256 ls -l "$tarfile" } MAKETAR () { # remove old tarballs and checksums. rm -f $target/$NAME-*.tar.* cd $master do_tar $NAME-$D-extra LICENSE* README* *.html install* re* \ tl-portable* tlpkg/TeXLive tlpkg/translations tlpkg/tlpostcode \ || return do_tar $NAME-$D-texmf texmf* || return cd $master/../Build/source do_tar $NAME-$D-source * || return cd $master/bin do_tar $NAME-$D-bin * } # main program. # Add our exact version to the release file. printf "\ntexlive-$D\n" >>$master/release-texlive.txt $maketar && MAKETAR $makelive && MAKELIVE # Undo the version. svn revert $master/release-texlive.txt exit 0