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 ;;
28 # See also https://twiki.indexdata.com/twiki/bin/view/ID/AdamsReleaseProcedure
35 echo "# Did you updated the news log file?"
36 for file in Changes News NEWS
39 echo "# $(ls -l $file)"
44 if [ -e "pom.xml" ]; then
50 if [ `find . -name '*.pm' | wc -l` -gt 0 ]; then
56 if [ `ls | egrep '\.spec$' | wc -l` -eq 0 ]; then
57 usage "No *.spec file found"
59 spec=`ls |egrep '\.spec$' | head -1`
60 package=`perl -ne 's/\s*$//; print if s/^NAME=//' IDMETA`
61 if [ -z "$package" ]; then
62 package=`basename $spec .spec`
66 # configure new version
67 perl -i.bak -npe "s,VERSION=.*,VERSION=$version," IDMETA
70 echo "# set maven version to $version"
71 mvn versions:set -DnewVersion=$version > mvn-versions.log
75 echo "# check perl version numbers"
76 find . -name '*.pm' -print0 | xargs -0 egrep -H '\$VERSION.*=.*[0-9]' |
77 egrep -v '^\./deb-src/' | perl -npe 's,^,# ,'
80 # update debian version file
81 perl -i.bak -npe "\$. == 1 && s,\(.*?\),($version)," debian/changelog
83 # update redhat version file
84 perl -i.bak -npe "s,^Version: \d+.*,Version: $version," $spec
87 ######################################################################
88 echo "# Please commit the version updates now"
89 echo "git commit -a -m'new release v$version'"
91 echo "# Please tag now (we will push later to origin)"
92 echo "git tag v$version"
95 echo "mvn versions:set -DnewVersion=$version-SNAPSHOT"
98 ######################################################################
100 echo "# On mochi, please run the commands"
101 echo "\$HOME/proj/git-tools/id-deb-build/mkdist.sh"
102 echo "\$HOME/proj/git-tools/id-deb-build/id-pbuild.sh"
103 echo "\$HOME/proj/git-tools/id-deb-build/id-pbuild.sh --upload"
106 echo "# if successfully, don't forget to push to origin"
107 echo "git push origin master"
108 echo "git push origin tag v$version"