#!/bin/bash proj="baselayout-vserver" svnroot="http://dev.croup.de/repos/${proj}" ver=${1:-1.13.0} usage() { echo "Usage: mkrelease" } die() { echo $1 exit ${2:-1} } if [[ $1 != "-f" ]] ; then echo "Performing sanity checks (run with -f to skip) ..." # Check that we're updated svnfiles="$( svn status 2>&1 | egrep -v '^(U|P)' )" if [[ -n ${svnfiles} ]] ; then echo "Refusing to package tarball until svn is in sync:" echo "$svnfiles" exit 1 fi fi echo "Creating release tag... " svn copy ${svnroot}/trunk ${svnroot}/tags/release-${ver} \ -m "Tagging the ${ver} release of the ${proj} project" &>/dev/null || die "svn copy failed" echo "Make dist tarball..." dest=dist/${proj}-${ver} mkdir -p ${dest} &>/dev/null for x in bin etc init.d sbin src rc-lists man; do svn export $x ${dest}/${x} done mkdir -p ${dest}/lib/rcscripts svn export --force net-scripts/init.d ${dest}/init.d svn export net-scripts/net.modules.d ${dest}/lib/rcscripts/net.modules.d svn export --force net-scripts/conf.d ${dest}/etc/conf.d svn export ChangeLog ${dest}/ChangeLog svn export ChangeLog.vserver ${dest}/ChangeLog.vserver pushd dist/ &>/dev/null || die "pushd failed" tar cjf ${proj}-${ver}.tar.bz2 ${proj}-${ver} || die "tar failed" for i in *.tar*; do md5sum $i > $i.md5 done echo "Tarball ist at `pwd`" popd &>/dev/null || die "popd failed"