#==============================================================================
# Some notes on packaging Self Service Password
#==============================================================================

# 1 - Archive tar.gz
#==============================================================================

From current directory, do:
$ ./makedist VERSION

with VERSION the current verion of the package

For example:
$ ./makedist 0.4


# 2 - Debian
#==============================================================================

Form current directory, do:
$ dpkg-buildpackage -b -kLTB

If you do not have LTB GPG secret key, do:
$ dpkg-buildpackage -b -us -uc

# 3 - RPM (RHEL, CentOS, Fedora, ...)
#==============================================================================

Prepare your build environment, for example in /home/clement/build.
You should have a ~/.rpmmacros like this:

----
%_topdir /home/clement/build
%dist .el5
%distribution .el5
%_signature gpg
%_gpg_name 6D45BFC5
%_gpgbin /usr/bin/gpg
%packager Clement OUDOT <clem.oudot@gmail.com>
%vendor LTB-project
----

Copy packaging files from current directory to build directory:
$ cp -Ra rpm/* /home/clement/build

Copy Self Service Archive to SOURCES/:
$ cp ltb-project-self-service-password-VERSION.tar.gz /home/clement/build/SOURCES

Go in build directory and build package:
$ cd /home/clement/build
$ rpmbuild -ba SPECS/self-service-password.spec

Sign RPM:
$ rpm --addsign RPMS/noarch/self-service-password*

# 4 - Docker
#==============================================================================

From current directory, do:
$ docker build -t self-service-password -f ./docker/Dockerfile ../
