#!/bin/sh USAGE="Usage: $0 * is relative to the SVN root (eg: branches/dspace-1_4_x) * is the revision you want to build the release from * is the version number to release as (eg: 1.4.2) * IMPORTANT, no longer add the \"dspace\" directory onto the end of the path Examples: ./make-release-package trunk 1984 1.5" SVN="svn" SVN_BASE_URL="https://dspace.svn.sourceforge.net/svnroot/dspace" # Check we have required command-line arguments if [ "$#" != "3" ]; then echo "${USAGE}" exit 1 fi mkdir tmp if [ $? -eq 1 ]; then # If mkdir failed, then tmp/ already exists, and we don't want to overwrite # anything in there. exit 1 fi cd tmp S_FILENAME="dspace-$3-source" B_FILENAME="dspace-$3-binary" echo "Checking out core code..." $SVN export -r $2 "$SVN_BASE_URL/$1" release if [ $? -eq 1 ] || [ ! -d "release" ]; then # SVN export failed echo "SVN export failed. Check your path & revision number and try again." cd .. rmdir tmp exit 1 fi if [ ! -f "release/make-release-package" ]; then cat <<-EOF ERROR: The file release/make-release-package doesn't exist. There must have been a problem with the export. Check the contents of tmp/ to find out what the problem was. EOF exit 1 else # Don't need to include this script! rm -f release/make-release-package fi echo "Creating source distribution..." mv release $S_FILENAME tar czf $S_FILENAME.tgz $S_FILENAME tar cjf $S_FILENAME.tbz2 $S_FILENAME zip -r $S_FILENAME.zip $S_FILENAME echo "Creating binary distribution..." cd $S_FILENAME mvn package cd dspace mvn package cd target mv dspace-*-build.dir $B_FILENAME tar czf ../../../$B_FILENAME.tgz $B_FILENAME tar cjf ../../../$B_FILENAME.tbz2 $B_FILENAME zip -r ../../../$B_FILENAME.zip $B_FILENAME echo "Cleaning up..." cd ../../../.. mv tmp/$S_FILENAME.* . mv tmp/$B_FILENAME.* . #rm -r tmp echo "Packages created: * $S_FILENAME.tgz * $S_FILENAME.tbz2 * $S_FILENAME.zip * $B_FILENAME.tgz * $B_FILENAME.tbz2 * $B_FILENAME.zip"