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
11 echo "usage $0 version"
15 ######################################################################
16 if [ -e "pom.xml" ]; then
22 if [ `find . -name '*.pm' | wc -l` -gt 0 ]; then
28 if [ `ls |egrep '\.spec$' | wc -l` -eq 0 ]; then
29 echo "No *.spec file found"
32 spec=`ls |egrep '\.spec$' | head -1`
33 package=`basename $spec .spec`
37 [0-9]* ) version=$1 ;;
41 # configure new version
42 perl -i.bak -npe "s,VERSION=.*,VERSION=$version," IDMETA
45 echo "set maven version to $version"
46 mvn versions:set -DnewVersion=$version > mvn-versions.log
50 echo "check perl version numbers"
51 find . -name '*.pm' -print0 | xargs -0 egrep -H '\$VERSION.*=.*[0-9]'
54 # update debian version file
55 perl -i.bak -npe "\$. == 1 && s,\(.*?\),($version)," debian/changelog
57 ######################################################################
59 echo "# Please run now"
62 echo "git tag v$version"
63 echo "git push origin tag v$version"
66 echo "mvn versions:set -DnewVersion=$version-SNAPSHOT"
69 ######################################################################
71 echo "# On RedHat or centos, please run the commands"
72 echo "$HOME/proj/git-tools/id-deb-build/mkdist.sh"
73 echo "sudo cp $package-$version.tar.gz /usr/src/redhat/SOURCES/"
74 echo "sudo rpmbuild -ba $spec"
75 echo "$HOME/proj/git-tools/id-rpm-build/upload-rpms.sh $spec"
76 echo "# on kebab run update-yum-archive.sh"