2008-04-25 12:17:32 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# mkrelease.sh: Creates a release suitable for distfiles.atheme.org.
|
|
|
|
#
|
2011-05-22 18:35:55 +00:00
|
|
|
# Copyright (c) 2007, 2011 atheme.org
|
2008-04-25 12:17:32 +00:00
|
|
|
#
|
|
|
|
# Permission to use, copy, modify, and/or distribute this software for
|
|
|
|
# any purpose with or without fee is hereby granted, provided that the above
|
|
|
|
# copyright notice and this permission notice appear in all copies.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
|
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
|
|
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
|
|
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
|
|
|
|
|
|
|
if [ "x$1" = "x" ]; then
|
2016-03-21 13:32:21 +00:00
|
|
|
echo "usage: $0 releasename"
|
2008-04-25 12:17:32 +00:00
|
|
|
exit
|
|
|
|
else
|
|
|
|
RELEASENAME="$1"
|
|
|
|
fi
|
|
|
|
|
2011-05-22 18:35:55 +00:00
|
|
|
TIP=`git log -1 --pretty=oneline | cut -d" " -f1`
|
2008-04-25 12:17:32 +00:00
|
|
|
|
|
|
|
WRKDIR=`pwd`
|
|
|
|
|
|
|
|
if [ -d $RELEASENAME ]; then
|
|
|
|
echo "Deleting previous release named $RELEASENAME."
|
|
|
|
rm -rf $WRKDIR/$RELEASENAME/
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Making release named $RELEASENAME (tip $TIP)"
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Building root: $RELEASENAME/"
|
2011-06-03 17:34:44 +00:00
|
|
|
cd ..
|
|
|
|
git archive --format=tar --prefix=$RELEASENAME/ HEAD | gzip >scripts/$RELEASENAME-working.tar.gz
|
|
|
|
cd $WRKDIR
|
|
|
|
tar -xzvf $RELEASENAME-working.tar.gz
|
2008-04-25 12:17:32 +00:00
|
|
|
cd $RELEASENAME
|
|
|
|
sh autogen.sh
|
|
|
|
rm -rf autogen.sh autom4te.cache
|
2011-05-22 18:35:55 +00:00
|
|
|
rm -rf .gitignore
|
2008-04-25 12:17:32 +00:00
|
|
|
|
|
|
|
# Run application specific instructions here.
|
|
|
|
if [ -x "$WRKDIR/application.sh" ]; then
|
|
|
|
. $WRKDIR/application.sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
echo "Building $RELEASENAME.tgz from $RELEASENAME/"
|
2011-06-03 17:34:44 +00:00
|
|
|
tar zcf $RELEASENAME.tar.gz $RELEASENAME/
|
2008-04-25 12:17:32 +00:00
|
|
|
|
|
|
|
echo "Building $RELEASENAME.tbz2 from $RELEASENAME/"
|
2011-06-03 17:34:44 +00:00
|
|
|
tar jcf $RELEASENAME.tar.bz2 $RELEASENAME/
|
|
|
|
|
|
|
|
rm $RELEASENAME-working.tar.gz
|
2016-03-21 13:32:21 +00:00
|
|
|
rm -rf $RELEASENAME
|
2008-04-25 12:17:32 +00:00
|
|
|
|
2016-03-21 13:32:21 +00:00
|
|
|
echo "Done. $RELEASENAME.tar.gz and $RELEASENAME.tar.bz2 built."
|