#!/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 FILENAME="dspace-$3-source" 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 tarball..." mv release $FILENAME tar czf $FILENAME.tgz $FILENAME tar cjf $FILENAME.tbz2 $FILENAME zip -r $FILENAME.zip $FILENAME echo "Cleaning up..." cd .. mv tmp/$FILENAME.* . rm -r tmp echo "Packages created: * $FILENAME.tgz * $FILENAME.tbz2 * $FILENAME.zip"