2 # Copyright (c) 2011-2015 IndexData ApS. http://indexdata.com
3 # Author: Wolfram Schneider
5 # id-release - a helper script to build a release & packaging for debian + redhat
7 # see http://twiki.indexdata.dk/cgi-bin/twiki/view/ID/IDSoftwareRelease
8 # https://twiki.indexdata.com/twiki/bin/view/ID/AdamsReleaseProcedure
14 echo >&2 "usage $0 version"
19 ######################################################################
21 [0-9]* ) version=$1 ;;
26 echo "# See also https://twiki.indexdata.com/twiki/bin/view/ID/AdamsReleaseProcedure"
30 echo "# Did you updated the news log file?"
31 for file in Changes News NEWS
34 echo "# $(ls -l $file)"
39 if [ -e "pom.xml" ]; then
45 if [ `find . -name '*.pm' | wc -l` -gt 0 ]; then
51 if [ `ls | egrep '\.spec$' | wc -l` -eq 0 ]; then
52 usage "No *.spec file found"
54 spec=`ls |egrep '\.spec$' | head -1`
55 package=`perl -ne 's/\s*$//; print if s/^NAME=//' IDMETA`
56 if [ -z "$package" ]; then
57 package=`basename $spec .spec`
61 # configure new version
62 perl -i.bak -npe "s,VERSION=.*,VERSION=$version," IDMETA
65 echo "# set maven version to $version"
66 mvn versions:set -DnewVersion=$version > mvn-versions.log
70 echo "# check perl version numbers"
71 find . -name '*.pm' -print0 | xargs -0 egrep -H '\$VERSION.*=.*[0-9]' | egrep -v '^\./deb-src/'
74 # update debian version file
75 perl -i.bak -npe "\$. == 1 && s,\(.*?\),($version)," debian/changelog
77 # update redhat version file
78 perl -i.bak -npe "s,^Version: \d+.*,Version: $version," $spec
81 ######################################################################
82 echo "# Please commit the version updates now"
83 echo "git commit -a -m'new release v$version'"
85 echo "# Please tag now (we will push later to origin)"
86 echo "git tag v$version"
89 echo "mvn versions:set -DnewVersion=$version-SNAPSHOT"
92 ######################################################################
94 echo "# On mochi, please run the commands"
95 echo "\$HOME/proj/git-tools/id-deb-build/mkdist.sh"
96 echo "\$HOME/proj/git-tools/id-deb-build/id-pbuild.sh"
97 echo "\$HOME/proj/git-tools/id-deb-build/id-pbuild.sh --upload"
100 echo "# if successfully, don't forget to push to origin"
101 echo "git push origin master"
102 echo "git push origin tag v$version"