#!/bin/sh -x function usage { cat << "EOF" Usage: prepare-zips.sh Prerequisites: - tarballs (schoolbell-x.y.z.tar.gz and schooltool-x.y.z.tar.gz) - Zope3 .pyd zips (Zope3-pyd.zip and Zope3-Py2.4-pyd.zip) - ReportLab zip (ReportLab_*.zip, make sure there is only one such file) Just run the script and it will produce zip files as described in win32-installer.txt "Preparation" section. EOF exit 1 } ls schoolbell-*.tar.gz > /dev/null && ls schooltool-*.tar.gz > /dev/null && ls Zope3-pyd.zip > /dev/null && ls Zope3-Py2.4-pyd.zip > /dev/null && ls ReportLab_*.zip > /dev/null || usage test -f /usr/bin/flip || (echo 'You need to install flip' && exit 1) function zipit { TARBALL=`ls $1-*.tar.gz` DIR="${TARBALL%%.tar.gz}" rm -rf $DIR # step 1 of "Preparation" tar -xzf $TARBALL # step 3 REPORTLAB_DIR=reportlab_* cp -R $REPORTLAB_DIR/reportlab $DIR/ # step 4 of "Preparation" perl -pi \ -e 's/\/usr\/share\/fonts\/truetype\/msttcorefonts/C:\\Windows\\Fonts/' \ $DIR/school*.conf.in # step 5 find $DIR -type f | xargs flip -m 2>&1 | grep -v binary # pack it up (step 1 of "Creating the installer") cd $DIR/Zope3 && unzip -q ../../Zope3-pyd.zip && cd ../.. zip -qr $DIR-py23.zip $DIR cd $DIR/Zope3 && unzip -q -o ../../Zope3-Py2.4-pyd.zip && cd ../.. zip -qr $DIR-py24.zip $DIR rm -rf $DIR } unzip -q -o ReportLab_*.zip zipit schoolbell zipit schooltool