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