# $Header: /home/cvsd/magellan-cvs/magellan-src/mlivecdbuild/files/mage-src/mage-0.3.6-r17.smage2,v 1.1 2005-07-01 17:24:11 niro Exp $ PNAME="mage" PVER="0.3.6" PBUILD="r17" SRCFILE="${PNAME}-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" #avaible options are source/rsync/cvs METHOD=cvs src_prepare() { if [ "${METHOD}" == "source" ] then munpack ${SRCFILE} || die fi if [ "${METHOD}" == "rsync" ] then mkdir -p ${SRCDIR} || die rsync \ --recursive \ --links \ --perms \ --times \ --devices \ --timeout=600 \ --verbose \ --compress \ --progress \ --stats \ --delete \ --delete-after \ rsync://192.168.0.2/${PNAME}-${PVER}-${PBUILD} \ ${SRCDIR} || die fi if [ "${METHOD}" == "cvs" ] then local MY_CVS_OPTS local MY_CVS_MODULE MY_CVS_MODULE="magellan-src/mage" # $PVER must be eg 0_3_3 MY_CVS_OPTS="-r mage-$(echo ${PVER}| sed -e "s|\.|\_|g")-${PBUILD}" #cvs login export CVSROOT=:pserver:anonymous:@192.168.0.2:/magellan-cvs cvs login [ ! -d "${SRCDIR}" ] && install -d ${SRCDIR} #get all our modules or update them if [ ! -d ${SRCDIR}/magellan-initscripts/CVS ] then (cd ${SRCDIR}; cvs -z3 checkout ${MY_CVS_OPTS} ${MY_CVS_MODULE}) else (cd ${SRCDIR}; cvs -z3 update -d -P ${MY_CVS_OPTS} ${MY_CVS_MODULE}) fi #correct permissions find ${SRCDIR} -type f -exec chmod 0644 '{}' ';' find ${SRCDIR} -type d -exec chmod 0755 '{}' ';' #delete CVS directories for file in $(find ${SRCDIR} -type d -name CVS) do rm -rf ${file} done #set correct SRCDIR export SRCDIR="${SRCDIR}/${MY_CVS_MODULE}" fi cd ${SRCDIR} #clean up backup files (foo~) find ${SRCDIR} -name *~ -exec rm '{}' ';' || die } src_install() { cd ${SRCDIR} # needed directories install -d ${BINDIR}/sbin || die cp -aR ${SRCDIR}/* ${BINDIR} || die # added : # ldd-fix.sh # find_not_installed.sh #corrects file attributes for i in env-rebuild.sh \ mage3.sh \ pkgbuild_dir.sh \ depwanderer.sh \ smage2.sh \ pkgsearch.sh \ compressdoc \ create_desktop_app.sh \ sourceinstall.sh \ mkinfodir \ etc-update \ writeprotected \ magequery.sh \ mageupgrade.sh \ mgroupadd \ mgroupdel \ museradd \ muserdel \ ldd-fix.sh \ find_not_installed.sh do chown root:root ${BINDIR}/usr/lib/mage/${i} || die chmod 0755 ${BINDIR}/usr/lib/mage/${i} || die done #some needed symlinks ln -snf /usr/lib/mage/mage3.sh ${BINDIR}/sbin/mage || die ln -snf /usr/lib/mage/smage2.sh ${BINDIR}/sbin/smage2 || die ln -snf /usr/lib/mage/env-rebuild.sh ${BINDIR}/sbin/env-rebuild || die ln -snf /usr/lib/mage/compressdoc ${BINDIR}/sbin/compressdoc || die ln -snf /usr/lib/mage/etc-update ${BINDIR}/sbin/etc-update || die ln -snf /usr/lib/mage/magequery.sh ${BINDIR}/sbin/magequery || die ln -snf /usr/lib/mage/mageupgrade.sh ${BINDIR}/sbin/mageupgrade || die }