--- /dev/null
+#!/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
+