#!/usr/bin/env bash # Checked and updated to be more streamlined by # Jerry Benton # 24 FEB 2015 # this Build.tarball script should be located in the base # directory when run. Example: /msdev/v4/Build.tarball # make sure this is run from the base directory if [ ! -d 'config.index' ]; then echo 'This script must be executed from the base directory.'; echo './config.index was not found. Exiting ...'; echo; exit 192 fi # if not set from the "Build.all" script if [ -z "$MSVERSION" ]; then echo "Please tell me the version number (x.xx.x):" read MSVERSION export MSVERSION fi # if not set from the "Build.all" script if [ -z "$MSBUILD" ]; then echo "And the build number (-x):" read MSBUILD export MSBUILD fi # if not set from the "Build.all" script if [ -z "$FULLMSVER" ]; then FULLMSVER="$MSVERSION-$MSBUILD"; export FULLMSVER fi # if not set from the "Build.all" script if [ -z "$DEVBASEDIR" ]; then DEVBASEDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) export DEVBASEDIR fi # create this if missing if [ ! -a '/tmp/MailScanner.conf.index.html' ]; then sh $DEVBASEDIR/config.index/make.sh cd $DEVBASEDIR fi # set stuff # export NUMBER=$MSVERSION export VERSION=MailScanner-$MSVERSION export INSTALL=MailScanner-install-$MSVERSION export RELEASE=$MSBUILD export BUILDROOT=$HOME/msbuilds/tar # make some dirs mkdir -p $BUILDROOT rm -rf $BUILDROOT/$VERSION-$RELEASE mkdir -p $BUILDROOT/$VERSION-$RELEASE # Put the docs in place #tar cf - www/README README | ( cd $BUILDROOT/$VERSION-$RELEASE && tar xvBpf - ) cd $DEVBASEDIR cp /tmp/MailScanner.conf.index.html $BUILDROOT/$VERSION-$RELEASE # module check script cp $DEVBASEDIR/check_modules.sh $BUILDROOT/$VERSION-$RELEASE chmod 0755 $BUILDROOT/$VERSION-$RELEASE/check_modules.sh # Put all the subdirs (including the code) in place ( cd mailscanner && tar cf - . ) | ( cd $BUILDROOT/$VERSION-$RELEASE && tar xvBpf - ) ln -s ms-upgrade-conf $BUILDROOT/$VERSION-$RELEASE/bin/upgrade_languages_conf # Copy all the cron jobs into the cron dir mkdir -p $BUILDROOT/$VERSION-$RELEASE/bin/cron cp RPM.files/common/*cron $BUILDROOT/$VERSION-$RELEASE/bin/cron perl -pi -e 's/\/usr\/sbin/\/opt\/MailScanner\/bin/g;' $BUILDROOT/$VERSION-$RELEASE/bin/cron/* cd $BUILDROOT/$VERSION-$RELEASE ## Copy in the old (working) ms-check script # And fix the paths in it and the scanners updater script perl -pi - bin/ms-check <