1 sage 1.1 #!/bin/sh
|
2 sage 1.6 if test 'whoami' != 'root'; then
|
3 sage 1.3 echo "You have to be root to build the pegasus rpm"
|
4 sage 1.6 #exit
|
5 sage 1.3 fi
6 #
|
7 sage 1.6 echo "This script executes <make clean> first"
8 read -n 1 -p "Do you want to continue ? (y/n)" retcode
9
10 if test $retcode != "y"; then
11 echo "Okay, you don\'t want to execute make clean now"
12 exit
|
13 sage 1.1 fi
|
14 sage 1.6 echo;
15
16 export PEGASUS_PLATFORM=LINUX_IX86_GNU
17 if test -z $PEGASUS_HOME; then
|
18 sage 1.1 echo "Please make sure that PEGASUS_ROOT points to the current"
19 echo "location of the Pegasus sources"
|
20 sage 1.6 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"
23 exit
24 fi
25 export PEGASUS_HOME=`pwd`
26 echo;
|
27 sage 1.1 fi
28 #
|
29 mike 1.4 #
|
30 sage 1.6 export PEGASUS_ROOT=$PEGASUS_HOME
31
32 cd $PEGASUS_HOME
33 if make clean; then
34 echo "Sources are cleaned up"
35 else
36 echo "Cleanup hasn't been successful"
37 exit
38 fi
39 #
|
40 sage 1.1 PEGASUS_BASE=`basename $PEGASUS_ROOT`
|
41 sage 1.6 PEGASUS_DIR=`dirname $PEGASUS_ROOT`
|
42 sage 1.1 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 sage 1.6 #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
|
47 sage 1.1 fi
48 # pack the entire source, but first clean it up
49 #
|
50 sage 1.6 # and copy it into /usr/src/packages/SOURCES
|
51 sage 1.1 #
|
52 sage 1.6 #pushd ..
53 cd $PEGASUS_DIR
|
54 sage 1.1 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"
56 else
57 echo "Didn't succeed in tarring"
|
58 sage 1.6 mv $PEGASUS_ROOT $PEGASUS_DIR/$PEGASUS_BASE
|
59 sage 1.1 exit
60 fi
|
61 sage 1.6
62 mv $PEGASUS_ROOT $PEGASUS_DIR/$PEGASUS_BASE
63 cd $PEGASUS_BASE
64 #popd
65 export PEGASUS_ROOT=$PEGASUS_DIR/$PEGASUS_BASE
66 #
|
67 sage 1.1 #
68 #
69 chmod +x rpm/pegasus
|
70 sage 1.6 if cp $PEGASUS_ROOT/rpm/pegasus-1.0.spec /usr/src/packages/SPECS/; then
|
71 sage 1.1 echo "Copied spec file"
72 else
73 echo "Spec file missing ???"
74 exit
75 fi
76 #
|
77 sage 1.5 #
|
78 sage 1.6 #chmod +x rpm/buildincludes
79 #if cp $PEGASUS_ROOT/rpm/buildincludes /var/tmp; then
80 # echo "Copied buildincludes script"
81 #else
82 # echo "buildincludes script missing ???"
83 # exit
84 #fi
|
85 sage 1.1 #
86 #
87 echo "Start building ...."
|
88 sage 1.6
|
89 sage 1.1 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"
91 else
|
92 sage 1.6 echo "Build error !"
|
93 sage 1.1 fi
94 echo "Finished"
|
95 sage 1.6
96
|