2 if test 'whoami' != 'root'; then
3 echo "You have to be root to build the pegasus rpm"
7 echo "This script executes <make clean> first"
8 read -n 1 -p "Do you want to continue ? (y/n)" retcode
10 if test $retcode != "y"; then
11 echo "Okay, you don\'t want to execute make clean now"
16 export PEGASUS_PLATFORM=LINUX_IX86_GNU
17 if test -z $PEGASUS_HOME; then
18 echo "Please make sure that PEGASUS_ROOT points to the current"
19 echo "location of the Pegasus sources"
20 read -n 1 -p "Is current directory the location of Pegasus? (y/n)" retcode
21 if test $retcode != "y"; then
22 echo "Okay, please set the variable first"
25 export PEGASUS_HOME=`pwd`
30 export PEGASUS_ROOT=$PEGASUS_HOME
34 echo "Sources are cleaned up"
36 echo "Cleanup hasn't been successful"
40 PEGASUS_BASE=`basename $PEGASUS_ROOT`
41 PEGASUS_DIR=`dirname $PEGASUS_ROOT`
42 if test "$PEGASUS_BASE" != "pegasus-1.0"; then
43 echo "I'm going to make sure that pegasus is found in */pegasus-1.0/ "
44 #cp -a $PEGASUS_ROOT $PEGASUS_ROOT/../pegasus-1.0
45 mv $PEGASUS_ROOT $PEGASUS_DIR/pegasus-1.0
46 export PEGASUS_ROOT=$PEGASUS_DIR/pegasus-1.0
48 # pack the entire source, but first clean it up
50 # and copy it into /usr/src/packages/SOURCES
54 if tar cfz /usr/src/packages/SOURCES/pegasus-1.0.tar.gz pegasus-1.0 ;then
55 echo "/usr/src/packages/SOURCES/pegasus-1.0.tar.gz created"
57 echo "Didn't succeed in tarring"
58 mv $PEGASUS_ROOT $PEGASUS_DIR/$PEGASUS_BASE
62 mv $PEGASUS_ROOT $PEGASUS_DIR/$PEGASUS_BASE
65 export PEGASUS_ROOT=$PEGASUS_DIR/$PEGASUS_BASE
70 if cp $PEGASUS_ROOT/rpm/pegasus-1.0.spec /usr/src/packages/SPECS/; then
71 echo "Copied spec file"
73 echo "Spec file missing ???"
78 #chmod +x rpm/buildincludes
79 #if cp $PEGASUS_ROOT/rpm/buildincludes /var/tmp; then
80 # echo "Copied buildincludes script"
82 # echo "buildincludes script missing ???"
87 echo "Start building ...."
89 if rpm -ba /usr/src/packages/SPECS/pegasus-1.0.spec; then
90 echo "Package built as /usr/src/packages/RPMS/pegasus-1.0.rpm"