Changeset 682 for trunk/technical/common
- Timestamp:
- Aug 13, 2004, 5:16:46 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/technical/common/build/build.sh
r681 r682 11 11 # - mit Parameter geht das Skript davon aus, 12 12 # dass der Parameter ein SRPM Paket ist. 13 # Dieses wird nach oldwotan kopiert, dort entpackt und dann gebaut. 14 # - Dazu muss ein ssh-pubkey in oldwotans /root/.ssh/authorized_keys gelegt 15 # werden (build.sh verwendet ssh) 13 # Dieses wird entpackt und dann gebaut. 16 14 # Wichtige Einstellungen: 17 15 # - Standardm�ig baut build.sh mit --clean, wenns schnell gehen soll, die … … 19 17 # - BUILD_DIST ist standard sles7-i386, kann auch durch entsprechenden Export 20 18 # berschrieben werden. 21 # - die fertigen Pakete werden nach DEST_DIR (kann durch env gesetzt werden) 22 # in die vorgegebene Hierarchie (src, i386/sles/7) auf den lokalen Rechner23 # kopiert. Vorgabe ist /tmp/smartclient_build19 # - die fertigen Pakete werden nach DEST_DIR (kann durch env gesetzt werden) # in die vorgegebene Hierarchie (src, i386/sles/7) auf den lokalen Rechner # kopiert. 20 # 21 # nutzt sudo 24 22 25 23 CONFIG_FILE=/usr/local/etc/build … … 40 38 41 39 [ -z $DEST_DIR ] && DEST_DIR="/tmp/build.$BUILDUSER" 40 41 [ -z "$BUILD_USES_SVN" ] && BUILD_USES_SVN="yes" 42 43 42 44 43 45 if [ -r $CONFIG_FILE ]; then … … 84 86 PACKAGE=$(awk '/^Name:/ {print $2}' <$SPECFILE) 85 87 VERSION=$(awk '/^Version:/ {print $2}' <$SPECFILE) 88 else 89 # parameter is src.rpm file 90 PACKAGE=`echo $1 | sed 's/-[0-9]*\..*.src.rpm//'` 91 VERSION=`echo $1 | sed 's/.*-\([0-9]*\..*\)-.*.src.rpm/\1/'` 92 fi 93 94 echo $PACKAGE $VERSION $BUILD_DIST $BUILD_MODE 95 96 rm -rf ${BUILDTEMP}/src/${PACKAGE}; 97 mkdir -p ${BUILDTEMP}/src/${PACKAGE} ${BUILDTEMP}/${BUILD_DIST}; 98 99 if [ "$1" ]; then 100 cp -a "$1" ${BUILDTEMP}/src/${PACKAGE} 101 cd ${BUILDTEMP}/src/${PACKAGE}; rpm2cpio $1 | cpio -i 102 else 103 cp -a $SPECFILE ${BUILDTEMP}/src/${PACKAGE} 86 104 87 # if config file exist, source it. 88 # after this, the variable SOURCES should be set 89 if [ -r SOURCES ]; then 90 . SOURCES 105 # uses Subversion (svn) to generate more information for the RPM 106 if [ "$BUILD_USES_SVN" = "yes" ]; then 107 echo "receiving subversion information ..." 108 # set RELEASE number (last modification in this directory) 109 # requires subversion (but connection to server isn't neccessary) 110 SVN_BUILD_RELEASE=$(svn info . | sed -n 's/^Last Changed Rev: \([0-9]*\)/\1/p') 111 if [ "$SVN_BUILD_RELEASE" ]; then 112 sed "s/^Release:.*/Release: $SVN_BUILD_RELEASE/g" $SPECFILE > ${BUILDTEMP}/src/${PACKAGE}/$SPECFILE 113 fi 114 echo "Subversion status:" > Changes 115 # additional infos for the Changes file (see if everything is checked in) 116 svn status -v | grep -v '^? ' >> Changes 117 echo >> Changes 118 echo "ChangeLog:" >> Changes 119 # requires connection to the subversion server 120 svn log -v . > ChangeLog.new && mv ChangeLog.new ChangeLog 121 cat ChangeLog >> Changes 122 cat Changes >> ${BUILDTEMP}/src/${PACKAGE}/$SPECFILE 123 fi 124 # just make sure, that the Changes file exist 125 touch Changes 126 127 # if "SOURCES" file exist, create tar file on the fly 128 if [ -r "SOURCES" ]; then 91 129 # create a tar file from the sources 92 CREATE_TAR="yes"130 tar cvjf ${BUILDTEMP}/src/${PACKAGE}/$PACKAGE-$VERSION.tar.bz2 --files-from SOURCES 93 131 else 94 132 # legacy method: … … 96 134 test -e Makefile && make 97 135 TARFILE=$(ls *.tar.[gb]z*| awk '{print $1}') 136 cp -a $TARFILE ${BUILDTEMP}/src/${PACKAGE} 98 137 fi 99 SRC_FILES="$SPECFILE $TARFILE"100 else101 # parameter is src.rpm file102 PACKAGE=`echo $1 | sed 's/-[0-9]*\..*.src.rpm//'`103 VERSION=`echo $1 | sed 's/.*-\([0-9]*\..*\)-.*.src.rpm/\1/'`104 SRC_FILES="$1"105 fi106 107 echo $PACKAGE $VERSION $BUILD_DIST $BUILD_MODE108 109 # Cleaning up and install tempdir110 #ssh -${SSH_VERSION} ${FQBUILDHOST} "\111 rm -rf ${BUILDTEMP}/src/${PACKAGE}; \112 mkdir -p ${BUILDTEMP}/src/${PACKAGE} ${BUILDTEMP}/${BUILD_DIST};113 114 #scp -oProtocol=$SSH_VERSION $SRC_FILES ${FQBUILDHOST}:${BUILDTEMP}/src/${PACKAGE}115 cp -a $SRC_FILES ${BUILDTEMP}/src/${PACKAGE}116 117 if [ "$CREATE_TAR" = "yes" ]; then118 tar cvjf ${BUILDTEMP}/src/${PACKAGE}/$PACKAGE-$VERSION.tar.bz2 --files-from SOURCES119 fi120 121 if [ "$1" ]; then122 # extract RPM in a tempoary directory123 #ssh -${SSH_VERSION} ${FQBUILDHOST} "\124 cd ${BUILDTEMP}/src/${PACKAGE}; rpm2cpio $1 | cpio -i125 138 fi 126 139 … … 142 155 143 156 chmod a+x $BUILDSCRIPT 144 145 #cat /tmp/tmpscript.$$146 147 #scp -oProtocol=$SSH_VERSION /tmp/tmpscript.$$ ${FQBUILDHOST}:${BUILDTEMP}/src/${PACKAGE}/buildscript148 #rm /tmp/tmpscript.$$149 150 # build and file rpms151 #ssh -oProtocol=$SSH_VERSION root@${FQBUILDHOST} \152 # . ~$BUILDUSER/${BUILDTEMP}/src/${PACKAGE}/buildscript153 154 157 sudo su -c $BUILDSCRIPT 155 158 rm -f $BUILDSCRIPT 156 159 157 #ssh -oProtocol=$SSH_VERSION ${FQBUILDHOST} \ 158 rm -f ${BUILDTEMP}/${BUILD_DIST}/${PACKAGE}-*.*.rpm 159 cp -a ${BUILD_ROOT}/usr/src/packages/RPMS/*/${PACKAGE}-${VERSION}-*.*.rpm ${BUILDTEMP}/${BUILD_DIST} 160 rm -f ${BUILDTEMP}/${BUILD_DIST}/${PACKAGE}-*.*.rpm 161 cp -a ${BUILD_ROOT}/usr/src/packages/RPMS/*/${PACKAGE}-${VERSION}-*.*.rpm ${BUILDTEMP}/${BUILD_DIST} 160 162 161 163 mkdir -p ${DEST_DIR}/src 162 164 # delete all old versions of this package 163 165 rm -f ${DEST_DIR}/src/${PACKAGE}-*.src.rpm 164 #if !(scp -oProtocol=$SSH_VERSION root@${FQBUILDHOST}:${BUILD_ROOT}/usr/src/packages/SRPMS/${PACKAGE}-${VERSION}-*.src.rpm ${DEST_DIR}/src ); then 165 #ERROR=1 166 #fi 166 167 167 if !(cp -a ${BUILD_ROOT}/usr/src/packages/SRPMS/${PACKAGE}-${VERSION}-*.src.rpm ${DEST_DIR}/src 2> /dev/null); then 168 168 ERROR=1 … … 172 172 # delete all old versions of this package 173 173 rm -f ${DEST_DIR}/${BUILD_DIST}/${PACKAGE}-*.rpm 174 #if !(scp -oProtocol=$SSH_VERSION #root@${FQBUILDHOST}:${BUILD_ROOT}/usr/src/packages/RPMS/*/${PACKAGE}-${VERSION}-*.*.rpm ${DEST_DIR}/${BUILD_DIST} ); then 175 # ERROR=2 176 #fi 174 177 175 if !(cp -a ${BUILD_ROOT}/usr/src/packages/RPMS/*/${PACKAGE}-${VERSION}-*.*.rpm ${DEST_DIR}/${BUILD_DIST} ); then 178 176 ERROR=2
Note:
See TracChangeset
for help on using the changeset viewer.