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 ;;
25 echo "# See also https://twiki.indexdata.com/twiki/bin/view/ID/AdamsReleaseProcedure"
28 echo "# Did you updated the news log file?"
29 for file in Changes News NEWS
32 echo "# $(ls -l $file)"
37 if [ -e "pom.xml" ]; then
43 if [ `find . -name '*.pm' | wc -l` -gt 0 ]; then
49 if [ `ls | egrep '\.spec$' | wc -l` -eq 0 ]; then
50 usage "No *.spec file found"
52 spec=`ls |egrep '\.spec$' | head -1`
53 package=`perl -ne 's/\s*$//; print if s/^NAME=//' IDMETA`
54 if [ -z "$package" ]; then
55 package=`basename $spec .spec`
59 # configure new version
60 perl -i.bak -npe "s,VERSION=.*,VERSION=$version," IDMETA
63 echo "# set maven version to $version"
64 mvn versions:set -DnewVersion=$version > mvn-versions.log
68 echo "# check perl version numbers"
69 find . -name '*.pm' -print0 | xargs -0 egrep -H '\$VERSION.*=.*[0-9]' | egrep -v '^\./deb-src/'
72 # update debian version file
73 perl -i.bak -npe "\$. == 1 && s,\(.*?\),($version)," debian/changelog
75 # update redhat version file
76 perl -i.bak -npe "s,^Version: \d+.*,Version: $version," $spec
79 ######################################################################
80 echo "# Please commit the version updates now"
81 echo "git commit -a -m'new release v$version'"
83 echo "# Please tag now (we will push later to origin)"
84 echo "git tag v$version"
87 echo "mvn versions:set -DnewVersion=$version-SNAPSHOT"
90 ######################################################################
92 echo "# On mochi, please run the commands"
93 echo "\$HOME/proj/git-tools/id-deb-build/mkdist.sh"
94 echo "\$HOME/proj/git-tools/id-deb-build/id-pbuild.sh"
95 echo "\$HOME/proj/git-tools/id-deb-build/id-pbuild.sh --upload"
98 echo "# if successfully, don't forget to push to origin"
99 echo "git push origin master"
100 echo "git push origin tag v$version"