#! /bin/bash # Author: Chris Karakas # # Copyright (c) 2002, Chris Karakas # # 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, 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; see the file COPYING. If not, write to # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # # Program locations # Adapt to your situation. RUNSED="/usr/local/bin/runsed" GZIP="/usr/bin/gzip" TAR="/bin/tar" filelist="$1/index.html $1/$1.lyx $1/ck-style.css" tarfilelist="" for file in $filelist $tarfilelist; do name=`basename $file` cp $name $1/ done # Do some specific changes for my site. # # For example, delete the target="_top" attribute in the links of the Formats section. # I use frames, so that target=_top is not aproppriate there. $RUNSED sedscr_top $1/*.html rm $1/*.bak # Do some changes that are necessary for the HTML file to be validated # as a conforming one, according to the standards # of the W3C (see http://validator.w3c.org). $RUNSED sedscr_val $1/*.html rm $1/*.bak rm $1/*.tar.gz cp sedscr_top $1/ # TAR, all files. $TAR --exclude=$1/index.html -czvf $1.tar.gz $1/ cp $1.tar.gz $1/ rm $1.tar.gz # TAR, one big HTML file with images. $TAR -czvf $1-onehtml.tar.gz $1/$1.html $1/images/*.png $1/images/*.gif $1/images/*/*.png $1/ck-style.css $tarfilelist cp $1-onehtml.tar.gz $1/ rm $1-onehtml.tar.gz # TAR, many HTML files with images. $TAR --exclude=$1/$1.html --exclude=$1/index.html -czvf $1-html.tar.gz $1/*.html $1/images/*.png $1/images/*.gif $1/images/*/*.png $1/ck-style.css $tarfilelist cp $1-html.tar.gz $1/ rm $1-html.tar.gz # TAR, RTF file with images. $TAR -czvf $1-rtf.tar.gz $1/$1.rtf $1/images/*.bmp $1/images/*/*.bmp $tarfilelist cp $1-rtf.tar.gz $1/ rm $1-rtf.tar.gz # TAR, SGML file with images. $TAR -czvf $1-sgml.tar.gz $1/$1.sgml $1/images/* $1/images/*/* $1/appendix.sgml $tarfilelist cp $1-sgml.tar.gz $1/ rm $1-sgml.tar.gz # TAR, only the filelist. $TAR -czvf $1-scripts.tar.gz $tarfilelist cp $1-scripts.tar.gz $1/ rm $1-scripts.tar.gz