diff --git a/Build.nix b/Build.nix index 83bf432..2c4076f 100755 --- a/Build.nix +++ b/Build.nix @@ -2,15 +2,15 @@ # Checked and updated to be more streamlined by # Jerry Benton -# 24 FEB 2015 +# 3 MAY 2016 # this Build.tarball script should be located in the base -# directory when run. Example: /msdev/v4/Build.tarball +# directory when run. # make sure this is run from the base directory -if [ ! -d 'config.index' ]; then +if [ ! -d 'common' ]; then echo 'This script must be executed from the base directory.'; - echo './config.index was not found. Exiting ...'; + echo './common was not found. Exiting ...'; echo; exit 192 fi @@ -41,126 +41,53 @@ if [ -z "$DEVBASEDIR" ]; then 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 +# version info +BUILD=$MSBUILD +VERSION=$MSVERSION-$BUILD +export VERSION BUILD 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 +# the work directory +WORK="/tmp/MailScanner-$MSVERSION"; -# module check script -cp $DEVBASEDIR/check_modules.sh $BUILDROOT/$VERSION-$RELEASE -chmod 0755 $BUILDROOT/$VERSION-$RELEASE/check_modules.sh +# delete work tmp if already exists +if [ -d $WORK ]; then + rm -rf $WORK +fi -# 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 +# make working dir and subs +mkdir -p $WORK -# 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 <