3 # maketarball.sh - create a tarball from the git branch HEAD
5 # Copyright (C) Michael Adam 2009
7 # This program is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by the Free
9 # Software Foundation; either version 3 of the License, or (at your option)
12 # This program is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 # You should have received a copy of the GNU General Public License along with
18 # this program; if not, see <http://www.gnu.org/licenses/>.
22 # Create CTDB source tarball of the current git branch HEAD.
23 # The version is extracted from the spec file...
24 # The first extra argument will be added as an additional version.
30 SPECFILE=${RPMDIR}/ctdb.spec
34 VERSION=$(grep ^Version ${SPECFILE} | sed -e 's/^Version:\ \+//')
36 if [ "x${EXTRA_SUFFIX}" != "x" ]; then
37 VERSION="${VERSION}-${EXTRA_SUFFIX}"
40 if echo | gzip -c --rsyncable - > /dev/null 2>&1 ; then
41 GZIP="gzip -9 --rsyncable"
47 echo -n "Creating ctdb-${VERSION}.tar.gz ... "
48 git archive --prefix=ctdb-${VERSION}/ HEAD | ${GZIP} \
49 > ${TOPDIR}/ctdb-${VERSION}.tar.gz
55 if [ $RC -ne 0 ]; then
56 echo "Creation of tarball failed."