source: trunk/technical/common/build/svn_osc_build.sh@ 722

Last change on this file since 722 was 722, checked in by joergs, on Oct 2, 2008 at 5:22:18 PM

optimized, using modified Version instead of Release

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1#!/bin/bash
2
3#
4# svn_build_prepare.sh:
5# erzeugen des SPEC und der tar.gz. Ablegen in $DEST/buildsrc/src/PACKETNAME
6# überprüfen ob projekt exisitert
7# osc commit
8# osc build
9#
10#
11
12[ -z "$BUILD_USES_SVN" ] && BUILD_USES_SVN="yes"
13
14BUILDUSER=$USER
15[ -z $DEST_DIR ] && DEST_DIR="/tmp/build.$BUILDUSER"
16BUILDTEMP=$DEST_DIR/buildsrc/
17
18if [ ! -r OSC_PACKAGE ]; then
19 echo "failed to read config file OSC_PACKAGE"
20 exit 1
21fi
22
23OSC_PACKAGE=`cat OSC_PACKAGE`
24
25svn_build_prepare.sh $* || {
26 echo "failed to prepare sources"
27 exit 1
28}
29
30# TODO: get this info from svn_build_prepare.sh? seperate script?
31if [ -z "$1" ]; then
32 # without parameter, we are in source directory
33 SPECFILE=$(ls *.spec | awk '{print $1}')
34 PACKAGE=$(sed -n -e 's/^Name:\W*//pi' <$SPECFILE)
35 # use Version from BUILDSRC,
36 # because it has been modified by svn_build_prepare
37 #VERSION=$(sed -n -e 's/^Version:\W*//pi' <$SPECFILE)
38 BUILDSRC_DIR=${BUILDTEMP}/src/${PACKAGE}
39 VERSION=$(sed -n -e 's/^Version:\W*//pi' <$BUILDSRC_DIR/$SPECFILE)
40fi
41
42# RPMs can be handeld directly by osc
43# elif [ -r "$1" ]; then
44# # parameter is src.rpm file
45# PACKAGE=`rpm -qp --qf "%{NAME}" $1`
46# VERSION=`rpm -qp --qf "%{VERSION}" $1`
47
48if [ -z "$PACKAGE" ]; then
49 echo "nothing to build found!"
50 exit 1
51fi
52
53echo "Version: $VERSION"
54
55osc co $OSC_PACKAGE || {
56 # error message already from osc
57 exit 1
58}
59# rsync is not usable, because ":" is interpretaded as remote host
60#rsync -av "$BUILDSRC_DIR/*" "$OSC_PACKAGE/."
61#cp -av $BUILDSRC_DIR/* $OSC_PACKAGE/.
62
63cd $OSC_PACKAGE
64rsync -a --delete $BUILDSRC_DIR/. . --exclude .osc
65
66# osc build DIST ARCH
67#osc add $FILELIST
68osc addremove
69osc commit -m "release $VERSION"
Note: See TracBrowser for help on using the repository browser.