This describes what to do for an release!

= Info =

Following shell expansions are used in this document:
 ~e           .. source of libelektra
 ~build       .. the build directory
 ~elektra     .. the directory above ~e and ~build
 ~elektra-ftp .. where ftp files go to
 ~elektra-doc .. where doc flies go to


= 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

Make an empty builddirectory:
 mkdir ~build


== 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

Rebuild cleanly, run all tests and also check for memleaks:
  ~e/scripts/configure-debian ~e && make -j20 && make run_all && make run_memcheck


= Preperation =

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

 export VERSION=0.8.8

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:
 tar xvzf elektra-$VERSION.tar.gz && mkdir build
 cd ~build/build && ~e/scripts/configure-debian ~e && make -j 20 && make run_all && make run_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 && mv elektra_$VERSION.orig.tar.gz deb/$DVERSION/
 sudo dpkg -i deb/$DVERSION/*.deb


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

Run local tests:
 kdb run_all

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

Run unit-tests in-source again (because they use installed kdb.h):
 make run_all

== Documentation ==

And the API docu:
 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_${DVERSION}_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)
