This describes what to do for an release!

= TODO =

- make sure no TODO is in this file (resolve them first!)

= Cleanup =


For the first few steps you have to work on branch master:
 git-checkout master

If any feature branch is left over merge it:
 git-merge --no-ff feature

And now commit everything:
 git-commit -a

Clean up the mess left over:
 git-clean -df


== Check ==

Try to move as much as possible from this manual checks to build-server!

Before release is done, following must be checked:
- Everything blue on http://community.markus-raab.org:8080/

If version numbers are correct in
- CMakeLists.txt

Memleaks:
- ctest -T memcheck


= Preperation =

Set environment variable VERSION to current version to make the
commands below work for copy&paste:

 export VERSION=0.x.y

Now lets merge that to the release branch:
 git-checkout release
 git-merge --no-ff master -m "Merge for release $VERSION"


== Prepare Source Package ==

Build tar.gz and tag version and make hashsum:
 cd ~build && make source-package

Unpack + compile (with all available plugins) + test those sources (using valgrind!):
tar xvzf elektra-$VERSION.tar.gz && mkdir build && cd build && cmake -DPLUGINS=ALL ../elektra-$VERSION && make -j 5 && ctest -T memcheck

Now copy the packages to ftp (stay in same folder):
 cp ~build/elektra-$VERSION.tar.gz ~elektra-ftp/releases
 cp ~build/elektra-$VERSION.tar.gz.hashsum ~elektra-ftp/releases


== Debian Package ==

export DVERSION=$VERSION-1

Build deb:
 git-checkout debian
 git-merge --no-ff release -m "Merge for debian release $DVERSION"

 dch --newversion $DVERSION "New upstream version."
 git-add debian/changelog
 git-commit -m "Debian Package $DVERSION"
 cp ~elektra-ftp/releases/elektra-$VERSION.tar.gz ~elektra/elektra_$VERSION.orig.tar.gz

Fix debian/ + document in NEWS what maintainer need to consider, then build the package:
 git-buildpackage -rfakeroot -k0B2F0DDC -sa

Now move and install:
 cd ~elektra && mkdir deb/$DVERSION && mv elektra_$DVERSION* deb/$DVERSION && mv *.deb deb/$DVERSION && sudo dpkg -i deb/$DVERSION/*.deb
 mv elektra_$VERSION.orig.tar.gz deb/$DVERSION/


Run some basic commands, at least:
 kdb --version && kdb test_key && man kdb

Run local tests:
 kdb run_all

Now run lintian:
 lintian -EI --color=auto --pedantic deb/$DVERSION/elektra_$VERSION_*.changes

And run piuparts:
 sudo piuparts deb/$DVERSION/elektra_$DVERSION_*.changes

And run adequate (combined with piuparts and after installation)
 adequate '*elektra*'

Install libelektra-test of the previous version and run:
 for i in `dpkg -L libelektra-test | grep tool_exec`; do $i; done
or, if available:
 kdb run_all



== Test external tools ==


Check if tools based on elektra still do:
 dq


== Documentation ==

And the API docu (stay in same folder):
 mkdir ~elektra-doc/api/$VERSION/
 cd ~build && make html man && cp -ra doc/html doc/latex doc/man ~elektra-doc/api/$VERSION/

Symlink current to latest version and add everything:
 cd ~elektra-doc/api/ && rm current && ln -s $VERSION current && git-add current $VERSION




= Publish =

== Debian Package ==

 cd ~elektra/deb/$DVERSION && reprepro --ignore=wrongdistribution include wheezy elektra_$VERSION-1_amd64.changes && update-reprepro

== Commit source package ==

Commit elektra-ftp to gitorious:
 cd ~elektra-ftp && git-add releases/elektra-$VERSION.tar.gz && git-add releases/elektra-$VERSION.tar.gz.hashsum && git-commit -a -m "Release $VERSION"


== push ==

Now we know that everything worked well:

Now push release branch with tags to gitorious:
 cd ~e && git-pull && git-push && git-push --tags

Push elektra-ftp to gitorious:
 cd ~elektra-ftp && git-push && git-push gitorious

Push elektra-doc to gitorious:
 cd ~elektra-doc && git-commit -a -m "$VERSION Release" && git-push


== Announce ==

git checkout master

Finish NEWS for new release (do not forget to add links where to download release):
 editor doc/NEWS

Finally check links and send out mail to list
(Personal notice: see also NOTIFY)
