1 sage 1.1 #!/bin/sh
2 if test "$PEGASUS_PLATFORM" != LINUX_IX86_GNU; then
3 echo "Please set PEGASUS_PLATFORM to LINUX_IX86_GNU"
4 echo "either using export PEGASUS_PLATFORM=LINUX_IX86_GNU for ksh and bash"
5 echo "or set PEGASUS_PLATFORM=LINUX_IX86_GNU csh and tcsh"
6 exit;
7 fi
8 #
9 # assume that we have been started in PEGASUS_ROOT
10 # and that the basename is pegasus
11 #
12 if test -z $PEGASUS_ROOT; then
13 echo "Please make sure that PEGASUS_ROOT points to the current"
14 echo "location of the Pegasus sources"
15 exit
16 fi
17 #
18 PEGASUS_BASE=`basename $PEGASUS_ROOT`
19 if test "$PEGASUS_BASE" != "pegasus-1.0"; then
20 echo "I'm going to make sure that pegasus is found in */pegasus-1.0/ "
21 cp -a $PEGASUS_ROOT $PEGASUS_ROOT/../pegasus-1.0
22 sage 1.1 export PEGASUS_ROOT=$PEGASUS_ROOT/../pegasus-1.0
23 fi
24 # pack the entire source, but first clean it up
25 #
26 export PEGASUS_HOME=$PEGASUS_ROOT
27 cd $PEGASUS_HOME
28 if make clean;then
29 # Clean up the stuff make clean forgets
30 rm -rf repository
31 rm -rf obj
32 rm -f cgi/cgi-bin/*.so
33 echo "Sources are now cleaned up"
34 else
35 echo "Cleaning up the sources (make clean) hasn't been successful"
36 exit
37 fi
38 #
39 #
40 # tar it and copy it into /usr/src/packages/SOURCES
41 #
42 pushd ..
43 sage 1.1 if tar cfz /usr/src/packages/SOURCES/pegasus-1.0.tar.gz pegasus-1.0 ;then
44 echo "/usr/src/packages/SOURCES/pegasus-1.0.tar.gz created"
45 else
46 echo "Didn't succeed in tarring"
47 exit
48 fi
49 popd
50 #
51 #
52 #
53 chmod +x rpm/pegasus
54 if cp rpm/pegasus-1.0.spec /usr/src/packages/SPECS/; then
55 echo "Copied spec file"
56 else
57 echo "Spec file missing ???"
58 exit
59 fi
60 #
61 #
62 #
63 echo "Start building ...."
64 sage 1.1 if rpm -ba /usr/src/packages/SPECS/pegasus-1.0.spec; then
65 echo "Package built as /usr/src/packages/RPMS/pegasus-1.0.rpm"
66 else
67 echo "Build error"
68 exit
69 fi
70 echo "Finished"
|