#!/bin/sh # # # Modified: 04.10.2004 by Érica Gallindo (gallindo@dsc.ufcg.edu.br) # Modified: 14.12.2004 by Érica Gallindo (gallindo@dsc.ufcg.edu.br) # Modified: 21.12.2004 by Érica Gallindo (gallindo@dsc.ufcg.edu.br) # --> removed gateway distribution # --> change the source unpack dir # --> removed 'updatelicenses' and 'verifylicenses' from the source code # test command line arguments if [ $# -eq 1 ];then VERSION=$1 else if [ $# -eq 2 ];then VERSION=$1 RELEASE=$2 else echo "Usage: $0 []" exit 1 fi fi if [ -z ${RELEASE} ]; then SUFIX="$VERSION" else SUFIX="$VERSION-RC-$RELEASE" fi # set variables PROJECT_CVS_NAME=ourgrid PROJECT_CVS_REPOSITORY=":pserver:anonymous@dragao.lsd.ufcg.edu.br:/cvs/ourgrid" WORKINGDIR=$PWD LOGFILE=$WORKINGDIR/makepackages.log DIST_DIR=$WORKINGDIR/distributions OURGRID_VERSION=$1 LICENSE_FILE=$MYGRID_UNPACK_DIR/resources/CODELICENSE TMP_DIR=/tmp/ourgrid-dist OURGRID_UNPACK_DIR=ourgrid/ MYGRID_UNPACK_DIR=mygrid/ USERAGENT_UNPACK_DIR=useragent/ PEER_UNPACK_DIR=peer/ COREPEER_UNPACK_DIR=corepeer/ OURGRID_DIST_FILES="$TMP_DIR/$PROJECT_CVS_NAME/src $TMP_DIR/$PROJECT_CVS_NAME/build.xml $TMP_DIR/$PROJECT_CVS_NAME/build.properties $TMP_DIR/$PROJECT_CVS_NAME/srcAspects $TMP_DIR/$PROJECT_CVS_NAME/bin/ $TMP_DIR/$PROJECT_CVS_NAME/resources/ $TMP_DIR/$PROJECT_CVS_NAME/examples/ $TMP_DIR/$PROJECT_CVS_NAME/lib/ $TMP_DIR/$PROJECT_CVS_NAME/test/ $TMP_DIR/$PROJECT_CVS_NAME/dev/ $TMP_DIR/$PROJECT_CVS_NAME/LICENSE $TMP_DIR/$PROJECT_CVS_NAME/mygrid.log.properties $TMP_DIR/$PROJECT_CVS_NAME/peer.log.properties $TMP_DIR/$PROJECT_CVS_NAME/ua.log.properties" MYGRID_DIST_FILES="$TMP_DIR/$PROJECT_CVS_NAME/LICENSE $TMP_DIR/$PROJECT_CVS_NAME/RELEASE-NOTES $TMP_DIR/$PROJECT_CVS_NAME/examples $TMP_DIR/$PROJECT_CVS_NAME/mygrid.log.properties" MYGRID_DIST_RESOURCES_FILES="$TMP_DIR/$PROJECT_CVS_NAME/resources/ABOUT $TMP_DIR/$PROJECT_CVS_NAME/resources/images" MYGRID_DIST_BIN_FILES="$TMP_DIR/$PROJECT_CVS_NAME/bin/mygrid" MYGRID_DIST_LIB_FILES="$TMP_DIR/$PROJECT_CVS_NAME/lib/ourgrid.jar $TMP_DIR/$PROJECT_CVS_NAME/lib/threadpool.jar $TMP_DIR/$PROJECT_CVS_NAME/lib/xmlParserAPIs.jar $TMP_DIR/$PROJECT_CVS_NAME/lib/log4j.jar $TMP_DIR/$PROJECT_CVS_NAME/lib/xercesImpl.jar" USERAGENT_DIST_FILES="$TMP_DIR/$PROJECT_CVS_NAME/bin/useragent $TMP_DIR/$PROJECT_CVS_NAME/bin/useragent.bat $TMP_DIR/$PROJECT_CVS_NAME/RELEASE-NOTES $TMP_DIR/$PROJECT_CVS_NAME/LICENSE $TMP_DIR/$PROJECT_CVS_NAME/examples/properties/ua.properties $TMP_DIR/$PROJECT_CVS_NAME/lib/log4j.jar $TMP_DIR/$PROJECT_CVS_NAME/ua.log.properties $TMP_DIR/$PROJECT_CVS_NAME/lib/useragent.jar" PEER_DIST_FILES="$TMP_DIR/$PROJECT_CVS_NAME/LICENSE $TMP_DIR/$PROJECT_CVS_NAME/RELEASE-NOTES $TMP_DIR/$PROJECT_CVS_NAME/peer.log.properties $TMP_DIR/$PROJECT_CVS_NAME/examples/resources/example.sdf $TMP_DIR/$PROJECT_CVS_NAME/ua.log.properties $TMP_DIR/$PROJECT_CVS_NAME/examples/properties/peer.properties" PEER_DIST_RESOURCES_FILES="$TMP_DIR/$PROJECT_CVS_NAME/resources/ABOUT $TMP_DIR/$PROJECT_CVS_NAME/resources/xml $TMP_DIR/$PROJECT_CVS_NAME/resources/images" PEER_DIST_BIN_FILES="$TMP_DIR/$PROJECT_CVS_NAME/bin/peer $TMP_DIR/$PROJECT_CVS_NAME/bin/useragent $TMP_DIR/$PROJECT_CVS_NAME/bin/uaadmin" PEER_DIST_LIB_FILES="$TMP_DIR/$PROJECT_CVS_NAME/lib/ourgrid.jar $TMP_DIR/$PROJECT_CVS_NAME/lib/aspectjrt.jar $TMP_DIR/$PROJECT_CVS_NAME/lib/useragent.jar $TMP_DIR/$PROJECT_CVS_NAME/lib/threadpool.jar $TMP_DIR/$PROJECT_CVS_NAME/lib/log4j.jar $TMP_DIR/$PROJECT_CVS_NAME/lib/xmlParserAPIs.jar $TMP_DIR/$PROJECT_CVS_NAME/lib/xercesImpl.jar" COREPEER_DIST_FILES="$TMP_DIR/$PROJECT_CVS_NAME/LICENSE $TMP_DIR/$PROJECT_CVS_NAME/RELEASE-NOTES $TMP_DIR/$PROJECT_CVS_NAME/bin/corepeer $TMP_DIR/$PROJECT_CVS_NAME/examples/properties/peer.properties $TMP_DIR/$PROJECT_CVS_NAME/peer.log.properties" # ------ main # clear echo "--> Creating OurGrid-$OURGRID_VERSION Distributions" echo # Removing old temporary directory rm -rf $TMP_DIR >> $LOGFILE # Creating a temporary directory echo "--> [`date +%R`] Creating $TMP_DIR temporary dir..." mkdir -p $TMP_DIR >> $LOGFILE cd $TMP_DIR >> $LOGFILE echo "--> [`date +%R`] Doing checkout to $TMP_DIR dir [about 3 min]..." cvs -d $PROJECT_CVS_REPOSITORY login cvs -d $PROJECT_CVS_REPOSITORY co -P $PROJECT_CVS_NAME echo "--> [`date +%R`] Removing CVS files and directories..." find . -name CVS -depth -exec rm -rf {} \; > /dev/null echo "--> [`date +%R`] Generating ourgrid.jar and useragent.jar files ...." cd $PROJECT_CVS_NAME ant build >> $LOGFILE 2>&1 chmod -R +x bin/ # echo "--> [`date +%R`] Generating manual.ps file ...." # cd docs/manual # make >> $LOGFILE 2>&1 # echo "--> [`date +%R`] Generating manual.pdf file ...." # make pdf >> $LOGFILE 2>&1 # echo "--> [`date +%R`] Copying manual.ps manual.pdf to $TMP_DIR/$PROJECT_CVS_NAME/man/ dir ...." # cp manual.ps manual.pdf $TMP_DIR/$PROJECT_CVS_NAME/ # Backing to $WORKINGDIR cd $WORKINGDIR rm -rf $DIST_DIR >> $LOGFILE mkdir -p $DIST_DIR >> $LOGFILE mkdir -p $OURGRID_UNPACK_DIR >> $LOGFILE mkdir -p $MYGRID_UNPACK_DIR >> $LOGFILE mkdir -p $USERAGENT_UNPACK_DIR >> $LOGFILE mkdir -p $PEER_UNPACK_DIR >> $LOGFILE mkdir -p $COREPEER_UNPACK_DIR >> $LOGFILE #------ SRC DISTRIBUTION cp -R $OURGRID_DIST_FILES $OURGRID_UNPACK_DIR echo "--> [`date +%R`] Generating src distribution [$DIST_DIR/ourgrid-src-$OURGRID_VERSION.tar.gz] ..." tar zcvf $DIST_DIR/ourgrid-src-$SUFIX.tar.gz $OURGRID_UNPACK_DIR >> $LOGFILE 2>&1 #------ BINARY DISTRIBUTION echo "--> [`date +%R`] Generating mygrid broker distribution [$DIST_DIR/mygrid-$OURGRID_VERSION.tar.gz] ..." mkdir $MYGRID_UNPACK_DIR/bin cp -R $MYGRID_DIST_BIN_FILES $MYGRID_UNPACK_DIR/bin mkdir $MYGRID_UNPACK_DIR/lib cp -R $MYGRID_DIST_LIB_FILES $MYGRID_UNPACK_DIR/lib mkdir $MYGRID_UNPACK_DIR/resources cp -R $MYGRID_DIST_RESOURCES_FILES $MYGRID_UNPACK_DIR/resources cp -R $MYGRID_DIST_FILES $MYGRID_UNPACK_DIR >> $LOGFILE #---- excluding corepeer and peer from mygrid broker distribution rm -f $MYGRID_UNPACK_DIR/bin/corepeer $MYGRID_UNPACK_DIR/bin/peer $MYGRID_UNPACK_DIR/bin/gateway >> $LOGFILE rm -rf $MYGRID_UNPACK_DIR/test tar zcvf $DIST_DIR/mygrid-$SUFIX.tar.gz $MYGRID_UNPACK_DIR >> $LOGFILE 2>&1 #------ USER AGENT DISTRIBUTION echo "--> [`date +%R`] Generating ua distribution [$DIST_DIR/useragent-$OURGRID_VERSION.tar.gz]..." cp -R $USERAGENT_DIST_FILES $USERAGENT_UNPACK_DIR tar zcvf $DIST_DIR/useragent-$SUFIX.tar.gz $USERAGENT_UNPACK_DIR >> $LOGFILE 2>&1 #------ PEER DISTRIBUTION echo "--> [`date +%R`] Generating peer distribution [$DIST_DIR/peer-$OURGRID_VERSION.tar.gz]..." mkdir $PEER_UNPACK_DIR/bin cp -R $PEER_DIST_BIN_FILES $PEER_UNPACK_DIR/bin mkdir $PEER_UNPACK_DIR/lib cp -R $PEER_DIST_LIB_FILES $PEER_UNPACK_DIR/lib mkdir $PEER_UNPACK_DIR/log cp -R $PEER_DIST_FILES $PEER_UNPACK_DIR mkdir $PEER_UNPACK_DIR/resources cp -R $PEER_DIST_RESOURCES_FILES $PEER_UNPACK_DIR/resources tar zcvf $DIST_DIR/peer-$SUFIX.tar.gz $PEER_UNPACK_DIR >> $LOGFILE 2>&1 #------ COREPEER DISTRIBUTION echo "--> [`date +%R`] Generating corepeer distribution [$DIST_DIR/corepeer-$OURGRID_VERSION.tar.gz]..." mkdir $COREPEER_UNPACK_DIR/lib cp -R $PEER_DIST_LIB_FILES $COREPEER_UNPACK_DIR/lib cp -R $COREPEER_DIST_FILES $COREPEER_UNPACK_DIR tar zcvf $DIST_DIR/corepeer-$SUFIX.tar.gz $COREPEER_UNPACK_DIR >> $LOGFILE 2>&1 # Removing temp dirs rm -rf $OURGRID_UNPACK_DIR >> $LOGFILE rm -rf $MYGRID_UNPACK_DIR >> $LOGFILE rm -rf $USERAGENT_UNPACK_DIR >> $LOGFILE rm -rf $PEER_UNPACK_DIR >> $LOGFILE rm -rf $TMP_DIR >> $LOGFILE echo "--> [`date +%R`] Successful."