summaryrefslogtreecommitdiff
path: root/mkrelease.sh
blob: 5e08c1a585db8e151b952f67b6ba9408b4d7c781 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

if ! test -d .git
then
	echo This script must be run in a Git repository
	exit 1
fi

RELEASENAME=`git describe --tags`

if test -e $RELEASENAME
then
	echo $RELEASENAME already exists, not overwriting
	exit 1
fi

echo "Exporting HEAD to $RELEASENAME ..."
git archive --format=tar --prefix=$RELEASENAME/ HEAD | tar x || exit 1

echo "Running autoreconf ..."
cd $RELEASENAME || exit 1
autoreconf || exit 1
rm -rf .gitignore .hgignore aclocal.m4 autom4te.cache

echo "Building $RELEASENAME.tar.bz2 ..."
cd .. || exit 1
tar cfj $RELEASENAME.tar.bz2 $RELEASENAME || exit 1