X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=id-release;h=fd71ce8f2862a0fc18d3a0b70ecf9833008016e8;hb=46340c8a878d4a45eb3296c9a47f8d43110d7d78;hp=874d503fc1708125c7095947053577c59cb1a2fa;hpb=4676cdf817148e60c1ba6e3b2e1299be3efafe8d;p=git-tools-moved-to-github.git diff --git a/id-release b/id-release index 874d503..fd71ce8 100755 --- a/id-release +++ b/id-release @@ -1,10 +1,35 @@ #!/bin/sh +# Copyright (c) 2011 IndexData ApS. http://indexdata.com +# Author: Wolfram Schneider +# +# id-release - a helper script to build a release & packaging for debian + redhat +# +# see http://twiki.indexdata.dk/cgi-bin/twiki/view/ID/IDSoftwareRelease + +# die early +set -e usage () { - echo "usage $0 version" + echo >&2 "usage $0 version" + echo >&2 "$@" exit 1 } +###################################################################### +case $1 in + [0-9]* ) version=$1 ;; + * ) usage ;; +esac + +echo "Did you updated the news log file?" +for file in Changes News NEWS +do + if [ -e $file ]; then + ls -l $file + fi +done +echo "" + if [ -e "pom.xml" ]; then java=true else @@ -18,17 +43,15 @@ else fi if [ `ls |egrep '\.spec$' | wc -l` -eq 0 ]; then - echo "No *.spec file found" - usage + usage "No *.spec file found" else - package=`ls |egrep '\.spec$' | head -1` + spec=`ls |egrep '\.spec$' | head -1` + package=`perl -ne 's/\s*$//; print if s/^NAME=//' IDMETA` + if [ -z "$package" ]; then + package=`basename $spec .spec` + fi fi -case $1 in - [0-9]* ) version=$1 ;; - * ) usage ;; -esac - # configure new version perl -i.bak -npe "s,VERSION=.*,VERSION=$version," IDMETA @@ -39,16 +62,23 @@ fi if $perl; then echo "check perl version numbers" - find . -name '*.pm' -print0 | xargs -0 egrep -H '\$VERSION.*=.*[0-9]' + find . -name '*.pm' -print0 | xargs -0 egrep -H '\$VERSION.*=.*[0-9]' | egrep -v '^\./deb-src/' fi # update debian version file perl -i.bak -npe "\$. == 1 && s,\(.*?\),($version)," debian/changelog +# update redhat version file +perl -i.bak -npe "s,^Version: \d+.*,Version: $version," $spec + + + ###################################################################### echo "" +echo "# Please commit the version updates now" +echo "git commit -a -m'new release v$version'" +echo "" echo "# Please run now" -echo "git commit -a" echo "git push" echo "git tag v$version" echo "git push origin tag v$version" @@ -57,3 +87,34 @@ if $java; then echo "mvn versions:set -DnewVersion=$version-SNAPSHOT" fi +###################################################################### +echo "" +echo "# On RedHat or centos, please run the commands" +echo "sudo date # ask for password early" +echo "git pull" +echo "\$HOME/proj/git-tools/id-deb-build/mkdist.sh" +echo "sudo cp $package-$version.tar.gz /usr/src/redhat/SOURCES/" +echo "sudo rpmbuild -ba $spec" +echo "# if successfully, scp the package to ftp.indexdata.dk (kebab)" +echo "\$HOME/proj/git-tools/id-rpm-build/upload-rpms.sh $spec" +echo "" +echo "# on kebab run: sudo su" +echo "# cd $HOME/proj/git-tools/update-archive && ./update-yum-archive.sh" + + +###################################################################### +echo "" +echo "# On debian or ubuntu, please run the commands" +echo "sudo rm -rf deb-src" +echo "git pull" +echo "\$HOME/proj/git-tools/id-deb-build/mkdist.sh" +echo "\$HOME/proj/git-tools/id-deb-build/id-mk-deb-src.sh" +echo "sudo \$HOME/proj/git-tools/id-deb-build/id-pbuild.sh" +echo "# if successfully, scp the package to ftp.indexdata.dk (kebab)" +echo "\$HOME/proj/git-tools/id-deb-build/id-pbuild.sh --upload" +echo "" +echo "# on kebab run: sudo su" +echo "# cd $HOME/proj/git-tools/update-archive && ./update-archive.sh" +echo "" + +