version 1.2, 2001/06/23 21:33:42
|
version 1.6, 2002/02/26 12:45:17
|
|
|
#!/bin/sh | #!/bin/sh |
if test "$PEGASUS_PLATFORM" != LINUX_IX86_GNU; then |
if test 'whoami' != 'root'; then |
echo "Please set PEGASUS_PLATFORM to LINUX_IX86_GNU" |
echo "You have to be root to build the pegasus rpm" |
echo "either using export PEGASUS_PLATFORM=LINUX_IX86_GNU for ksh and bash" |
#exit |
echo "or set PEGASUS_PLATFORM=LINUX_IX86_GNU csh and tcsh" |
|
exit; |
|
fi | fi |
# | # |
# assume that we have been started in PEGASUS_ROOT |
echo "This script executes <make clean> first" |
# and that the basename is pegasus |
read -n 1 -p "Do you want to continue ? (y/n)" retcode |
# |
|
if test -z $PEGASUS_ROOT; then |
if test $retcode != "y"; then |
|
echo "Okay, you don\'t want to execute make clean now" |
|
exit |
|
fi |
|
echo; |
|
|
|
export PEGASUS_PLATFORM=LINUX_IX86_GNU |
|
if test -z $PEGASUS_HOME; then |
echo "Please make sure that PEGASUS_ROOT points to the current" | echo "Please make sure that PEGASUS_ROOT points to the current" |
echo "location of the Pegasus sources" | echo "location of the Pegasus sources" |
|
read -n 1 -p "Is current directory the location of Pegasus? (y/n)" retcode |
|
if test $retcode != "y"; then |
|
echo "Okay, please set the variable first" |
exit | exit |
fi | fi |
# |
export PEGASUS_HOME=`pwd` |
PEGASUS_BASE=`basename $PEGASUS_ROOT` |
echo; |
if test "$PEGASUS_BASE" != "pegasus-1.0"; then |
|
echo "I'm going to make sure that pegasus is found in */pegasus-1.0/ " |
|
cp -a $PEGASUS_ROOT $PEGASUS_ROOT/../pegasus-1.0 |
|
export PEGASUS_ROOT=$PEGASUS_ROOT/../pegasus-1.0 |
|
fi | fi |
# pack the entire source, but first clean it up |
|
# | # |
export PEGASUS_HOME=$PEGASUS_ROOT |
# |
|
export PEGASUS_ROOT=$PEGASUS_HOME |
|
|
cd $PEGASUS_HOME | cd $PEGASUS_HOME |
if make clean;then | if make clean;then |
# Clean up the stuff make clean forgets |
echo "Sources are cleaned up" |
rm -rf repository |
|
rm -rf obj |
|
rm -f cgi/cgi-bin/*.so |
|
echo "Sources are now cleaned up" |
|
else | else |
echo "Cleaning up the sources (make clean) hasn't been successful" |
echo "Cleanup hasn't been successful" |
exit | exit |
fi | fi |
# | # |
|
PEGASUS_BASE=`basename $PEGASUS_ROOT` |
|
PEGASUS_DIR=`dirname $PEGASUS_ROOT` |
|
if test "$PEGASUS_BASE" != "pegasus-1.0"; then |
|
echo "I'm going to make sure that pegasus is found in */pegasus-1.0/ " |
|
#cp -a $PEGASUS_ROOT $PEGASUS_ROOT/../pegasus-1.0 |
|
mv $PEGASUS_ROOT $PEGASUS_DIR/pegasus-1.0 |
|
export PEGASUS_ROOT=$PEGASUS_DIR/pegasus-1.0 |
|
fi |
|
# pack the entire source, but first clean it up |
# | # |
# tar it and copy it into /usr/src/packages/SOURCES |
# and copy it into /usr/src/packages/SOURCES |
# | # |
pushd .. |
#pushd .. |
|
cd $PEGASUS_DIR |
if tar cfz /usr/src/packages/SOURCES/pegasus-1.0.tar.gz pegasus-1.0 ;then | if tar cfz /usr/src/packages/SOURCES/pegasus-1.0.tar.gz pegasus-1.0 ;then |
echo "/usr/src/packages/SOURCES/pegasus-1.0.tar.gz created" | echo "/usr/src/packages/SOURCES/pegasus-1.0.tar.gz created" |
else | else |
echo "Didn't succeed in tarring" | echo "Didn't succeed in tarring" |
|
mv $PEGASUS_ROOT $PEGASUS_DIR/$PEGASUS_BASE |
exit | exit |
fi | fi |
popd |
|
|
mv $PEGASUS_ROOT $PEGASUS_DIR/$PEGASUS_BASE |
|
cd $PEGASUS_BASE |
|
#popd |
|
export PEGASUS_ROOT=$PEGASUS_DIR/$PEGASUS_BASE |
# | # |
# | # |
# | # |
chmod +x rpm/pegasus | chmod +x rpm/pegasus |
if cp rpm/pegasus-1.0.spec /usr/src/packages/SPECS/; then |
if cp $PEGASUS_ROOT/rpm/pegasus-1.0.spec /usr/src/packages/SPECS/; then |
echo "Copied spec file" | echo "Copied spec file" |
else | else |
echo "Spec file missing ???" | echo "Spec file missing ???" |
|
|
fi | fi |
# | # |
# | # |
|
#chmod +x rpm/buildincludes |
|
#if cp $PEGASUS_ROOT/rpm/buildincludes /var/tmp; then |
|
# echo "Copied buildincludes script" |
|
#else |
|
# echo "buildincludes script missing ???" |
|
# exit |
|
#fi |
|
# |
# | # |
echo "Start building ...." | echo "Start building ...." |
|
|
if rpm -ba /usr/src/packages/SPECS/pegasus-1.0.spec; then | if rpm -ba /usr/src/packages/SPECS/pegasus-1.0.spec; then |
echo "Package built as /usr/src/packages/RPMS/pegasus-1.0.rpm" | echo "Package built as /usr/src/packages/RPMS/pegasus-1.0.rpm" |
else | else |
echo "Build error" |
echo "Build error !" |
exit |
|
fi | fi |
echo "Finished" | echo "Finished" |
|
|
|
|