Ignore:
Timestamp:
Jan 26, 2009, 4:33:42 PM (16 years ago)
Author:
joergs
Message:

users /usr/local/bin/buildscript for sudo instead of sudo su -

Location:
trunk/technical/common/build
Files:
1 deleted
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/technical/common/build/build.sh

    r719 r733  
    2121# the rest is controlled by environment variables
    2222#
    23 # build.sh uses sudo su. /etc/sudoers needs a line like:
    24 # %users  ALL=(ALL)       NOPASSWD: /bin/su
    25 # for automatic building
     23# build.sh uses sudo. /etc/sudoers needs a line like:
     24# %users  ALL=(ALL)       NOPASSWD: /usr/local/bin/buildscript
     25# for automatic building (create a symlink or copy the file,
     26# see also the Variable BUILDSCRIPT and content of this script)
    2627#
    2728# return codes:
     
    3738
    3839
    39 
     40# set LANG to default (english)
     41# required for SVN
     42export LC_ALL=C
    4043
    4144CONFIG_FILE=/usr/local/etc/build
     45BUILDSCRIPT=buildscript
    4246BUILD_CMD=build
    4347BUILDUSER=$USER
     
    5054[ -z $DEST_DIR ] && DEST_DIR="/tmp/build.$BUILDUSER"
    5155BUILDTEMP=$DEST_DIR/buildsrc/
    52 BUILDSCRIPT=$BUILDTEMP/buildscript.$$
     56#BUILDSCRIPT=$BUILDTEMP/buildscript.$$
     57BUILDVARS=$BUILDTEMP/build.vars
    5358
    5459[ -z "$BUILD_USES_SVN" ] && BUILD_USES_SVN="yes"
     
    216221fi
    217222
    218 # create buildscript
    219 cat > $BUILDSCRIPT <<EOF
    220 #!/bin/bash
    221 # local buildscript
    222 export BUILD_ROOT=$BUILD_ROOT
    223 export BUILD_DIST=$BUILD_DIST
    224 export BUILD_RPMS=${DEST_DIR}/${BUILD_DIST}:$BUILD_RPMS
    225 export BUILD_PREPARE_SPEC=$BUILD_PREPARE_SPEC
    226 
    227 cd ${BUILDTEMP}/src/${PACKAGE}
    228 $BUILD_CMD $BUILD_MODE
     223# # create buildscript
     224# cat > $BUILDSCRIPT <<EOF
     225# #!/bin/bash
     226# # local buildscript
     227# export BUILD_ROOT=$BUILD_ROOT
     228# export BUILD_DIST=$BUILD_DIST
     229# export BUILD_RPMS=${DEST_DIR}/${BUILD_DIST}:$BUILD_RPMS
     230# export BUILD_PREPARE_SPEC=$BUILD_PREPARE_SPEC
     231#
     232# cd ${BUILDTEMP}/src/${PACKAGE}
     233# $BUILD_CMD $BUILD_MODE
     234# EOF
     235#
     236# chmod a+x $BUILDSCRIPT
     237# sudo /bin/su -c $BUILDSCRIPT
     238# rm -f $BUILDSCRIPT
     239
     240# create file for buildvars (see $BUILDSCRIPT)
     241cat > $BUILDVARS <<EOF
     242# Variables for build-Prozess (export is needed in buildscript)
     243BUILD_ROOT=$BUILD_ROOT
     244BUILD_DIST=$BUILD_DIST
     245BUILD_RPMS=${DEST_DIR}/${BUILD_DIST}:$BUILD_RPMS
     246
     247# Variables for execute the build-proggy
     248BUILD_MODE="$BUILD_MODE"
     249BUILD_PLACE=${BUILDTEMP}/src/${PACKAGE}
     250EXTRA_RPMS="$EXTRA_RPMS"
    229251EOF
    230252
    231 chmod a+x $BUILDSCRIPT
    232 sudo su -c $BUILDSCRIPT
    233 rm -f $BUILDSCRIPT
     253sudo $BUILDSCRIPT $BUILDVARS
     254#rm -f $BUILDVARS
     255
     256
    234257
    235258mkdir -p ${DEST_DIR}/src
Note: See TracChangeset for help on using the changeset viewer.