#!/bin/bash # get configuration BUILDSERVER_CONFIG_DIR="/etc/mage-buildserver" BUILDSERVER_CACHE_DIR="/var/cache/mage-buildserver" source ${BUILDSERVER_CONFIG_DIR}/buildserver.conf source ${BUILDSERVER_LIB_DIR}/buildserver-functions.sh SMAGEFILE="$1" if [[ -z ${SMAGEFILE} ]] then die "no smage file given. call '$(basename $0) with/relative/path/from/buildroot/svn/smage/to/smagefile'" fi if [[ ! -f ${BUILDROOT}/svn/smage/${SMAGEFILE} ]] then die "given smage file does not exist" fi if [ ! -f ${BUILDROOT}/.stamps/mage_svn-checkout-ok ] then die "svn checkout of mage required. run buildserver-svn first." fi if [ ! -f ${BUILDROOT}/.stamps/smage_svn-checkout-ok ] then die "svn checkout of smage required. run buildserver-svn first." fi for arch in $(enum-playground-arch-types) do if [ ! -f ${BUILDROOT}/.stamps/${arch}_bootstrap-ok ] then die "bootstrap of buildsystem required for arch '${arch}'. run buildserver-prepare first." fi if [ ! -f ${BUILDROOT}/.stamps/${arch}_initial-mage-tree-ok ] then die "initial regen of mage-tree required for '${arch}'. run buildserver-setup-mage-tree first." fi done for arch in $(enum-playground-arch-types) do if [ ! -f ${BUILDROOT}/.stamps/${arch}_common-devutils-ok ] then die "common-devutils package for '${arch}' not installed. run buildserver-prepare first." fi done for arch in $(enum-playground-arch-types) do echo "SMAGEFILE=\"${SMAGEFILE}\"" > ${BUILDROOT}/${arch}/.runrc echo "BUILDSERVER_LIB_DIR=\"${BUILDSERVER_LIB_DIR}\"" >> ${BUILDROOT}/${arch}/.runrc cat >> ${BUILDROOT}/${arch}/.runrc << 'EOF' install_retval=0 ${BUILDSERVER_LIB_DIR}/buildserver-build-depends.sh ${SMAGEFILE} || exit 1 ${BUILDSERVER_LIB_DIR}/buildserver-build-install-prerequisites.sh ${SMAGEFILE} ${BUILDSERVER_LIB_DIR}/buildserver-install.sh ${SMAGEFILE} || install_retval=1 exit ${install_retval} EOF runarch-script ${arch} .runrc || die "${arch} package build failed" if [ -f ${BUILDROOT}/${arch}/.runrc ] then rm ${BUILDROOT}/${arch}/.runrc fi done echo echo "smage '${SMAGEFILE}' sucessfully installed on playground arches."