#!/bin/sh #------------------------------------------------------------------------------ # /_ADMIN/_do_ - make script - will be processed before # package generation. # # Copyright (c) 2001-2009 The Eisfair Team, c/o Frank Meyer, frank(at)eisfair(dot)org # # Creation: 2006-09-24 jed # Last Update: $Id$ # # 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 of the License, or # (at your option) any later version. #------------------------------------------------------------------------------ # set -x pgmname=$0 packname=webmail currdir=`pwd` packdir=`dirname ${pgmname}` myecho () { if [ "`hostname`" = "farragut" ] then echo $@ fi } myecho "${packname} custom build script" if [ `echo "${currdir}" | grep -q "_ADMIN$"; echo $?` -eq 0 ] then # directory ends on '_ADMIN' cd ${packdir}/.. else cd ${packdir} fi # copy jedlib file to include directory jedlib_file=../../../contrib/jed-eislib/var/install/include/jedlib dest_file1=../common/var/install/include/jedlib dest_file2=/var/install/include/jedlib if [ -f ${jedlib_file} ] then # source file exists if [ -f ${dest_file1}.${packname} ] then # distination file exists - check versions srcver=`/bin/bash ${jedlib_file} version` destver=`/bin/bash ${dest_file1}.${packname} version` if [ "${destver}" != "" ] then # version number exists - compare version numbers if [ `echo "${srcver} > ${destver}" | bc` -eq 1 ] then # update file myecho "${jedlib_file} -> ${dest_file1}.${packname}" cp ${jedlib_file} ${dest_file1}.${packname} fi else # no version number exists - update file myecho "${jedlib_file} -> ${dest_file1}.${packname}" cp ${jedlib_file} ${dest_file1}.${packname} fi else # file doesn't exist - update file myecho "${jedlib_file} -> ${dest_file1}.${packname}" cp ${jedlib_file} ${dest_file1}.${packname} fi if [ -d `dirname ${dest_file2}` ] then if [ -f ${dest_file2} ] then # distination file exists - check versions srcver=`/bin/bash ${jedlib_file} version` destver=`/bin/bash ${dest_file2} version` if [ "${destver}" != "" ] then # version number exists - compare version numbers if [ `echo "${srcver} > ${destver}" | bc` -eq 1 ] then # update file myecho "${jedlib_file} -> ${dest_file2}" cp ${jedlib_file} ${dest_file2} fi else # no version number exists - update file myecho "${jedlib_file} -> ${dest_file2}" cp ${jedlib_file} ${dest_file2} fi else # file doesn't exist - update file myecho "${jedlib_file} -> ${dest_file2}" cp ${jedlib_file} ${dest_file2} fi fi fi # package content of /var/webmail due to eisfair-2 specific data directory # common/var/webmail pcurrdir="`pwd`" if [ ../common/tmp/wm_common_var.tgz ] then rm -f ../common/tmp/wm_common_var.tgz fi cd ../common/var/webmail tar czf ../../tmp/wm_common_var.tgz bin --exclude .svn # bin_squirrelmail_../var/webmail cd ${pcurrdir} binname="`grep "^bin_squirrelmail_" ./eis2+webmail`" if [ ../common/tmp/wm_bin_var.tgz ] then rm -f ../common/tmp/wm_bin_var.tgz fi cd ../${binname}/var/webmail tar czf ${pcurrdir}/../common/tmp/wm_bin_var.tgz *.txt .install/*tgz --exclude .svn --exclude sm_de-iso-8859-1.tgz cd ${currdir} # set +x