Ignore:
Timestamp:
May 14, 2004, 10:50:27 AM (21 years ago)
Author:
(none)
Message:

making it work for TU München. Automatic building doesn't work fully on
SLES8. SUSE build.rpm is needed to be patched.

File:
1 edited

Legend:

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

    r625 r668  
     1
    12#!/bin/bash
    23# Remote build script (iboernig@suse.de)
     
    2324#   kopiert. Vorgabe ist /tmp/smartclient_build
    2425
    25 SSH_VERSION="1"
    26 BUILDHOST="oldwotan"
    27 FQBUILDHOST="$BUILDHOST.suse.de"
    28 BUILDTEMP=abuildtmp
     26CONFIG_FILE=/usr/local/etc/build
     27#SSH_VERSION="1"
     28#BUILDHOST="oldwotan"
     29#FQBUILDHOST="$BUILDHOST.suse.de"
     30#BUILDTEMP=abuildtmp
    2931BUILDUSER=$USER
     32BUILDTEMP=/tmp/abuildtmp/$BUILDUSER
     33
     34BUILDSCRIPT=$BUILDTEMP/buildscript.$$
    3035
    3136[ -z "$BUILD_MODE" ] && BUILD_MODE="--verify"
    32 [ -z "$BUILD_DIST" ] && BUILD_DIST="sles7-i386+update"
    33 [ -z "$BUILD_ROOT" ] && BUILD_ROOT="/abuild/buildsystem.$BUILDHOST.$USER.$BUILD_DIST.smartclient"
     37[ -z "$BUILD_DIST" ] && BUILD_DIST="sles8-i386+update"
     38[ -z "$BUILD_ROOT" ] && BUILD_ROOT="/var/tmp/buildsystem.$USER.$BUILD_DIST"
    3439[ -z "$BUILD_PREPARE_SPEC" ] && BUILD_PREPARE_SPEC="no"
    3540
    36 [ -z $DEST_DIR ] && DEST_DIR="/tmp/smartclient_build/"
     41[ -z $DEST_DIR ] && DEST_DIR="/tmp/build.$BUILDUSER"
     42
     43if [ -r $CONFIG_FILE ]; then
     44        source $CONFIG_FILE
     45        MOD_BUILD_DIST=`echo $BUILD_DIST | sed "s/[-+.]/_/g"`
     46        #echo MOD_BUILD_DIST: $MOD_BUILD_DIST
     47        #RPMS_PATHS=$[BUILD_RPMS_$MOD_BUILD_DIST]
     48        #echo RPMS_PATHS: $RPM_PATHS
     49        #if [ -n "$[BUILD_RPMS_$MOD_BUILD_DIST]" ]; then
     50        #       BUILD_RPMS=$[BUILD_RPMS_$MOD_BUILD_DIST]
     51        #fi
     52        #echo OUTPUT: $[BUILD_RPMS_$MOD_BUILD_DIST]
     53        #:$BUILD_RPMS
     54        case "$BUILD_DIST" in
     55                "9.0-i386")     
     56                        BUILD_RPMS_TEST=$BUILD_RPMS_9_0_i386 ;;
     57                "sles8-i386")   
     58                        BUILD_RPMS_TEST=$BUILD_RPMS_sles8_i386 ;;
     59                "sles8-i386+update")   
     60                        BUILD_RPMS_TEST=$BUILD_RPMS_sles8_i386_update ;;
     61        esac
     62        if [ "$BUILD_RPMS_TEST" ]; then
     63                if [ "$BUILD_RPMS" ]; then
     64                        BUILD_RPMS=$BUILD_RPMS:$BUILD_RPMS_TEST
     65                else
     66                        BUILD_RPMS=$BUILD_RPMS_TEST
     67                fi
     68        fi
     69fi
     70
     71echo BUILD_RPMS: $BUILD_RPMS
    3772
    3873ERROR=0
     
    5893
    5994# Cleaning up and install tempdir
    60 ssh -${SSH_VERSION} ${FQBUILDHOST} "\
    61         rm -r ${BUILDTEMP}/src/${PACKAGE}; \
    62         mkdir -p ${BUILDTEMP}/src/${PACKAGE} ${BUILDTEMP}/${BUILD_DIST}";
     95#ssh -${SSH_VERSION} ${FQBUILDHOST} "\
     96        rm -rf ${BUILDTEMP}/src/${PACKAGE}; \
     97        mkdir -p ${BUILDTEMP}/src/${PACKAGE} ${BUILDTEMP}/${BUILD_DIST};
    6398
    64 scp -oProtocol=$SSH_VERSION $SRC_FILES ${FQBUILDHOST}:${BUILDTEMP}/src/${PACKAGE}
     99#scp -oProtocol=$SSH_VERSION $SRC_FILES ${FQBUILDHOST}:${BUILDTEMP}/src/${PACKAGE}
     100cp -a $SRC_FILES ${BUILDTEMP}/src/${PACKAGE}
    65101
    66102if [ "$1" ]; then
    67         ssh -${SSH_VERSION} ${FQBUILDHOST} "\
    68                 cd ${BUILDTEMP}/src/${PACKAGE}; rpm2cpio $1 | cpio -i";
     103        # extract RPM in a tempoary directory
     104        #ssh -${SSH_VERSION} ${FQBUILDHOST} "\
     105                cd ${BUILDTEMP}/src/${PACKAGE}; rpm2cpio $1 | cpio -i           
    69106fi
    70107
    71108# create buildscript
    72109
    73 cat > /tmp/tmpscript.$$ <<EOF
     110cat > $BUILDSCRIPT <<EOF
    74111#!/bin/bash
    75112# local buildscript
    76 . /work/src/bin/.profile
     113#. /work/src/bin/.profile
    77114export BUILD_ROOT=$BUILD_ROOT
    78115export BUILD_DIST=$BUILD_DIST
     116export BUILD_RPMS=${BUILDTEMP}/${BUILD_DIST}:$BUILD_RPMS
    79117export BUILD_PREPARE_SPEC=$BUILD_PREPARE_SPEC
    80118
    81 cd ~${BUILDUSER}/${BUILDTEMP}/src/${PACKAGE}
    82 build $BUILD_MODE --prefer-rpms ~${BUILDUSER}/${BUILDTEMP}/${BUILD_DIST}
     119cd ${BUILDTEMP}/src/${PACKAGE}
     120#build $BUILD_MODE --prefer-rpms ${BUILDTEMP}/${BUILD_DIST}
     121build $BUILD_MODE
    83122EOF
     123chmod a+x $BUILDSCRIPT
    84124
    85125#cat /tmp/tmpscript.$$
    86126
    87 scp -oProtocol=$SSH_VERSION /tmp/tmpscript.$$ ${FQBUILDHOST}:${BUILDTEMP}/src/${PACKAGE}/buildscript
    88 rm /tmp/tmpscript.$$
     127#scp -oProtocol=$SSH_VERSION /tmp/tmpscript.$$ ${FQBUILDHOST}:${BUILDTEMP}/src/${PACKAGE}/buildscript
     128#rm /tmp/tmpscript.$$
    89129
    90130# build and file rpms
    91 ssh -oProtocol=$SSH_VERSION root@${FQBUILDHOST} \
    92         . ~$BUILDUSER/${BUILDTEMP}/src/${PACKAGE}/buildscript
    93 ssh -oProtocol=$SSH_VERSION ${FQBUILDHOST} \
    94         "rm -f ${BUILDTEMP}/${BUILD_DIST}/${PACKAGE}-*.*.rpm;\
    95         cp ${BUILD_ROOT}/usr/src/packages/RPMS/*/${PACKAGE}-${VERSION}-*.*.rpm ${BUILDTEMP}/${BUILD_DIST}/"
     131#ssh -oProtocol=$SSH_VERSION root@${FQBUILDHOST} \
     132#       . ~$BUILDUSER/${BUILDTEMP}/src/${PACKAGE}/buildscript
     133
     134sudo su -c $BUILDSCRIPT
     135rm -f $BUILDSCRIPT
     136
     137#ssh -oProtocol=$SSH_VERSION ${FQBUILDHOST} \
     138        rm -f ${BUILDTEMP}/${BUILD_DIST}/${PACKAGE}-*.*.rpm
     139        cp -a ${BUILD_ROOT}/usr/src/packages/RPMS/*/${PACKAGE}-${VERSION}-*.*.rpm ${BUILDTEMP}/${BUILD_DIST}
    96140
    97141mkdir -p ${DEST_DIR}/src
    98142# delete all old versions of this package
    99143rm -f ${DEST_DIR}/src/${PACKAGE}-*.src.rpm
    100 if !(scp -oProtocol=$SSH_VERSION root@${FQBUILDHOST}:${BUILD_ROOT}/usr/src/packages/SRPMS/${PACKAGE}-${VERSION}-*.src.rpm ${DEST_DIR}/src ); then
     144#if !(scp -oProtocol=$SSH_VERSION root@${FQBUILDHOST}:${BUILD_ROOT}/usr/src/packages/SRPMS/${PACKAGE}-${VERSION}-*.src.rpm ${DEST_DIR}/src ); then
     145        #ERROR=1
     146#fi
     147if !(cp -a ${BUILD_ROOT}/usr/src/packages/SRPMS/${PACKAGE}-${VERSION}-*.src.rpm ${DEST_DIR}/src 2> /dev/null); then
    101148        ERROR=1
    102149fi
     
    105152# delete all old versions of this package
    106153rm -f ${DEST_DIR}/${BUILD_DIST}/${PACKAGE}-*.rpm
    107 if !(scp -oProtocol=$SSH_VERSION root@${FQBUILDHOST}:${BUILD_ROOT}/usr/src/packages/RPMS/*/${PACKAGE}-${VERSION}-*.*.rpm ${DEST_DIR}/${BUILD_DIST} ); then
     154#if !(scp -oProtocol=$SSH_VERSION #root@${FQBUILDHOST}:${BUILD_ROOT}/usr/src/packages/RPMS/*/${PACKAGE}-${VERSION}-*.*.rpm ${DEST_DIR}/${BUILD_DIST} ); then
     155#       ERROR=2
     156#fi
     157if !(cp -a ${BUILD_ROOT}/usr/src/packages/RPMS/*/${PACKAGE}-${VERSION}-*.*.rpm ${DEST_DIR}/${BUILD_DIST} ); then
    108158        ERROR=2
    109159fi
Note: See TracChangeset for help on using the changeset viewer.