Skip to content

Instantly share code, notes, and snippets.

@freemed
Created July 5, 2011 05:25
Show Gist options
  • Save freemed/1064292 to your computer and use it in GitHub Desktop.
Save freemed/1064292 to your computer and use it in GitHub Desktop.
Ganglia svn packaging script
#!/bin/bash
#
# package-ganglia-release
# jeff@freemedsoftware.org
#
TAG=$1
CURDIR="$( cd "$(dirname "$0")"; pwd )"
if [ "$TAG" == "" ]; then
echo "syntax: $0 TAG"
exit
fi
TMP="/tmp/ganglia-export-$TAG"
echo "Exporting tag $TAG"
svn export "https://ganglia.svn.sourceforge.net/svnroot/ganglia/tags/${TAG}" "$TMP"
#svn export "https://ganglia.svn.sourceforge.net/svnroot/ganglia/branches/3.2" "$TMP"
#svn export "https://ganglia.svn.sourceforge.net/svnroot/ganglia/trunk" "$TMP"
(
cd "$TMP"
(
cd monitor-core
# Create all configure scripts, etc
./bootstrap
# Create initial ganglia.spec file with RHEL5 defaults
cp ganglia.spec.in ganglia.spec -f
perl -pi -e 's/\@PACKAGE\@/ganglia/g;' ganglia.spec
perl -pi -e "s/\@VERSION\@/${TAG}/g;" ganglia.spec
perl -pi -e 's/\@REL\@/1/g;' ganglia.spec
perl -pi -e 's/\@varstatedir\@/\/var\/lib/g;' ganglia.spec
# Clean extra stuff
rm -rf autom4te.cache
)
mv -v "monitor-core" "ganglia-$TAG"
tar czvf "$CURDIR/ganglia-$TAG.tar.gz" "ganglia-$TAG"
)
echo "Built tarball in $CURDIR/ganglia-$TAG.tar.gz"
rm -Rf "$TMP"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment