From 4676cdf817148e60c1ba6e3b2e1299be3efafe8d Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Mon, 31 Oct 2011 20:23:33 +0000 Subject: [PATCH] a helper script to build a release & packaging for debian + redhat --- id-release | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 id-release diff --git a/id-release b/id-release new file mode 100755 index 0000000..874d503 --- /dev/null +++ b/id-release @@ -0,0 +1,59 @@ +#!/bin/sh + +usage () { + echo "usage $0 version" + exit 1 +} + +if [ -e "pom.xml" ]; then + java=true +else + java=false +fi + +if [ `find . -name '*.pm' | wc -l` -gt 0 ]; then + perl=true +else + perl=false +fi + +if [ `ls |egrep '\.spec$' | wc -l` -eq 0 ]; then + echo "No *.spec file found" + usage +else + package=`ls |egrep '\.spec$' | head -1` +fi + +case $1 in + [0-9]* ) version=$1 ;; + * ) usage ;; +esac + +# configure new version +perl -i.bak -npe "s,VERSION=.*,VERSION=$version," IDMETA + +if $java; then + echo "set maven version to $version" + mvn versions:set -DnewVersion=$version > mvn-versions.log +fi + +if $perl; then + echo "check perl version numbers" + find . -name '*.pm' -print0 | xargs -0 egrep -H '\$VERSION.*=.*[0-9]' +fi + +# update debian version file +perl -i.bak -npe "\$. == 1 && s,\(.*?\),($version)," debian/changelog + +###################################################################### +echo "" +echo "# Please run now" +echo "git commit -a" +echo "git push" +echo "git tag v$version" +echo "git push origin tag v$version" + +if $java; then + echo "mvn versions:set -DnewVersion=$version-SNAPSHOT" +fi + -- 1.7.10.4