#!/usr/bin/sh #------------------------------------------------------------------------------ # /_ADMIN/_do_ - make script - will be processed before # package generation. # # Copyright (c) 2001-2025 The Eisfair Team, team(at)eisfair(dot)org # # Creation: 2012-12-20 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 myecho () { if [ "`hostname`" = "farragut" ] then echo $@ fi } pgmname=$0 packname='roundcube' packdir=`dirname ${pgmname}` currdir=`pwd` basename ${pgmname} | grep -q 'eis64+' if [ $? -eq 0 ] then arch='eis64' else arch='eis1' fi myecho "ARCH:${arch}" 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 # get absolute path to package directory # e.g. /svn/eis-trunk/mail/antispam/_ADMIN abs_packdir=`pwd` # 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=`/usr/bin/bash ${jedlib_file} version` destver=`/usr/bin/bash ${dest_file1}.${packname} version` if [ -n "${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=`/usr/bin/bash ${jedlib_file} version` destver=`/usr/bin/bash ${dest_file2} version` if [ -n "${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 cd ${abs_packdir} # update base package requirement in preinstall.sh currdir="`pwd`" preinst_file=../common/tmp/preinstall.sh pack_file=../eis1/var/install/packages/${packname} old_version=`sed -n '/^base_version=/s/^base_version=.\([0-9.]*\).*$/\1/p' ${preinst_file}` new_version=`sed -n '/base/s/base *\([0-9.]*\).*/\1/p' ${pack_file}` if [ "${old_version}" != "${new_version}" ] then # replace version number sed -i "/^base_version=/s/^base_version=.*$/base_version='${new_version}'/" ${preinst_file} fi currdir="`pwd`" #binname=bin_roundcube_1_6_8 #binname=bin_roundcube_1_6_9 binname=bin_roundcube_1_6_10 myecho "${packname} - packaging '${binname}' ..." cd ../${binname} if [ -f ../common/tmp/rc_bin_prog.tgz ] then rm -f ../common/tmp/rc_bin_prog.tgz fi # don't include .svn (SVN files) and ./installer directory due to possible security issues # tar czf ${currdir}/../common/tmp/rc_bin_prog.tgz --exclude .svn --exclude ./installer . tar czf ${currdir}/../common/tmp/rc_bin_prog.tgz --exclude .svn . binname=bin_roundcube_plugins cd ../${binname} if [ -f ../common/tmp/rc_bin_plugins.tgz ] then rm -f ../common/tmp/rc_bin_plugins.tgz fi tar czf ${currdir}/../common/tmp/rc_bin_plugins.tgz --exclude .svn --exclude .\[a-z\]* \ --exclude config.inc.php --exclude ./jquery_mobile --exclude ./filters --exclude ./mobile . binname=bin_roundcube_skins cd ../${binname} if [ -f ../common/tmp/rc_bin_skins.tgz ] then rm -f ../common/tmp/rc_bin_skins.tgz fi #tar czf ${currdir}/../common/tmp/rc_bin_skins.tgz --exclude .svn --exclude .\[a-z\]* --exclude config.inc.php --exclude composer.* . { tar tvzf ${currdir}/../common/tmp/rc_bin_prog.tgz | cut -c 51- | cut -d' ' -f1 | grep -E -v "^ *$|^config" tar tvzf ${currdir}/../common/tmp/rc_bin_plugins.tgz | cut -c 51- | cut -d' ' -f1 | grep -v "^ *$" | sed 's#^#plugins/#g' # tar tvzf ${currdir}/../common/tmp/rc_bin_skins.tgz | cut -c 51- | cut -d' ' -f1 | grep -v "^ *$" | sed 's#^#skins/#g' } | sort -r > ${currdir}/../common/tmp/rc-filelist.txt cd ${currdir} # set +x