This describes what to do for an release!

== Preperation ==

TODO: describe directory structure
Make build-release folder

Set environment variable VERSION to current version to make those
scripts work:

 export VERSION=0.x.y


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

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

And now commit everything:
 git-commit -a

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

Finally increment version number in CMakeLists.txt:
 editor CMakeLists.txt
 git-commit -m "Ready for release $VERSION" CMakeLists.txt



== Source Package ==

Now lets merge that to the release branch:
 git-checkout release
 git-merge --no-ff master
 git-commit --amend -m "Release $VERSION"

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

TODO: write script for that (+ merge with 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 && 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

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"


== Documentation ==

And the API docu (stay in same folder):
 mkdir ~elektra-doc/api/$VERSION/ && cd ~build/build && 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



== Debian Package ==


Build deb:
 git-checkout debian
 git-merge --no-ff release

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


Now install package + run some basic commands:
 kdb --version



== Publish ==


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 changes to gitorious:
 git-pull && git-push

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


TODO: Debian packages in chroot + publish in reprepro

Finally check links and send out mail to list
