Files
DSpace/make-release-package
James Rutherford 2f07826c94 Fixed a minor typo.
git-svn-id: http://scm.dspace.org/svn/repo/trunk@1986 9c30dcfa-912a-0410-8fc2-9e0234be79fd
2007-05-31 10:33:27 +00:00

71 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
USAGE="Usage: $0 <path> <svn_revision> <version>
* <path> is relative to the SVN root (eg: branches/dspace-1_4_x)
* <svn_revision> is the revision you want to build the release from
* <version> 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"