2 # Copyright (c) 2011 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
13 echo "usage $0 version"
17 ######################################################################
18 if [ -e "pom.xml" ]; then
24 if [ `find . -name '*.pm' | wc -l` -gt 0 ]; then
30 if [ `ls |egrep '\.spec$' | wc -l` -eq 0 ]; then
31 echo "No *.spec file found"
34 spec=`ls |egrep '\.spec$' | head -1`
35 package=`basename $spec .spec`
39 [0-9]* ) version=$1 ;;
43 # configure new version
44 perl -i.bak -npe "s,VERSION=.*,VERSION=$version," IDMETA
47 echo "set maven version to $version"
48 mvn versions:set -DnewVersion=$version > mvn-versions.log
52 echo "check perl version numbers"
53 find . -name '*.pm' -print0 | xargs -0 egrep -H '\$VERSION.*=.*[0-9]'
56 # update debian version file
57 perl -i.bak -npe "\$. == 1 && s,\(.*?\),($version)," debian/changelog
59 ######################################################################
61 echo "# Please run now"
64 echo "git tag v$version"
65 echo "git push origin tag v$version"
68 echo "mvn versions:set -DnewVersion=$version-SNAPSHOT"
71 ######################################################################
73 echo "# On RedHat or centos, please run the commands"
74 echo "\$HOME/proj/git-tools/id-deb-build/mkdist.sh"
75 echo "sudo cp $package-$version.tar.gz /usr/src/redhat/SOURCES/"
76 echo "sudo rpmbuild -ba $spec"
77 echo "\$HOME/proj/git-tools/id-rpm-build/upload-rpms.sh $spec"
79 echo "# on kebab run: sudo su; cd \$HOME/proj/git-tools/update-archive; update-yum-archive.sh"
82 ######################################################################
84 echo "# On debian or ubuntu, please run the commands"
85 echo "sudo rm -rf deb-src"
86 echo "\$HOME/proj/git-tools/id-deb-build/mkdist.sh"
87 echo "\$HOME/proj/git-tools/id-deb-build/id-mk-deb-src.sh"
88 echo "\$HOME/proj/git-tools/id-deb-build/id-pbuild.sh"
89 echo "\$HOME/proj/git-tools/id-deb-build/id-pbuild.sh --upload"
91 echo "# on kebab run: sudo su; cd \$HOME/proj/git-tools/update-archive; update-archive.sh"