Kolab2 Beta testing

From Kolab wiki

Jump to: navigation, search


Note
The sources available in Kolab CVS are not guaranteed to work all of the time. So there is always a high chance that the following will fail. You should have extensive knowledge concerning the Kolab server and the underlying OpenPKG system to get your Kolab CVS server successfully installed.

This section will give an overview on how you can test the latest Kolab CVS version and start your own development if you desire to do so.


Contents

Prerequisites

In order to use the Kolab CVS repository and build packages from the current HEAD revision (or one of the active branches) you will need to provide a sound build environment on your base distribution (the distribution hosting the OpenPKG environment). You will definitely need the following elements:

  • a working GCC compiler
  • autoconf and automake (a note for Debian systems: You should have automake-1.9 installed)
  • the tool CVS

Beyond that you will need a working Kolab installation that matches the CVS branch you wish to test or improve.

Working with the unstable HEAD branch

The current HEAD branch in CVS will become the Kolab-2.2.* branch once it becomes stable.

You have two options for establishing your development environment:

Automatic setup

There is a script available in Kolab CVS that allows you to automate the sequence explained in the manual setup below.

Download the script first:

 wget http://kolab.org/cgi-bin/viewcvs-kolab.cgi/*checkout*/server/cvs-kolab.sh

In principle you should be able to get a development system up and running by executing:

./cvs-kolab.sh -i

If you wish to include fbview and the Horde web client you can use the -F and/or -H' switches:

./cvs-kolab.sh -i -F -H
Note
As mentioned above the Kolab CVS system is not always 100% clean so that you might experience problems when building from CVS. Report any bugs you find at the Kolab bug tracker.

Manual setup

The following gives a detailed explanation of the steps that can be executed via the shell script mentioned above.

Initial setup of the development environment

The setup of the Kolab development environment is somewhat lengthy though it should not be extremely complex. It will take some time because you will build the Kolab server about two and a half times and you will end up with two installed Kolab server environments (one development and one testing area).

Single environment
You can actually reduce the complexity of the development setup and reduce yourself to a single environment. That will also reduce the compile time necessary for generating the development system. But you do actually have a higher risk of destroying your environment while developing. If you are uncertain you should choose the longer variant and ignore these notes.

Creating the development environment

You will need an installed Kolab-2.2 server. This is described under Kolab2 Installation - Source but we will slightly modify the installation process to separate our development environment from the actually installed version.

Follow the first steps as described in the basic installation guide:

mkdir -p /kolabbuild/original
cd /kolabbuild/original
wget -r -l1 -nd -nc --no-parent <nowikihttp://ftp.gwdg.de/pub/linux/kolab/server/release/kolab-server-2.2.0/sources/</nowiki>
gpg --keyserver hkp://subkeys.pgp.net --recv-key 5816791A
gpg --verify MD5SUMS
md5sum -c MD5SUMS

Rather than installing the server into /kolab we are going to install it into /koldev. This will later allows us to perform all our test installations and to build binaries for the development platform within a second installation in the default /kolab folder. The newest Kolab server install script enables us to specify a non-standard installation location. Fetch it from CVS first:

cvs -d :pserver:anonymous@intevation.de:/home/kroupware/jail/kolabrepository  co server/install-kolab.sh
rm install-kolab.sh 
mv server/install-kolab.sh .

The install script provides the -t option that allows us to specify an alternate Kolab-2.2 server install location:

./install-kolab.sh -t koldev -I 20414
Single environment
Just run ./install-kolab-sh here in order to get the single envrionment setup.

The -t flag does not only change the target folder of the installation. It does in fact change three things:

  • The tag of the binary packages (which will now end with *-koldev.rpm)
  • The prefix of the Kolab server installation (which becomes /koldev)
  • The Kolab user names (which will now be koldev, koldev-r and koldev-n)

The -I flag sets the user ID of the basic Kolab user. Usually this is the kolab user but in this case it is the koldev user. By default the kolab user it is set to 19414 and the two restricted users kolab-r and kolab-n get the next two user IDs (19415 and 19416). By changing the base ID to 20414 we will later have the chance of using the default values for our build environment in the standard /kolab installation.

Once the installation completed we have a shiny new development installation. We will only use this as our background environment for the CVS sources and there will be no modifications to the installation in /koldev. This way there will be no chance that we destroy our own development environment. We can now continue with retrieving the current CVS repository for the server.

Note
Please keep your /kolabbuild/original directory at this point. We will still need it to create our actual build environment.

Retrieving the CVS repository

Finally we complete our development environment with the CVS sources. Fetch the HEAD revision of the Kolab CVS repository:

mkdir /koldev/CVS
cd /koldev/CVS
cvs -d :pserver:anonymous@intevation.de:/home/kroupware/jail/kolabrepository  co server
chown -R koldev\: /koldev/CVS
cd server
Single environment
Replace /koldev with /kolab to get the same result in the single environment setup.

Building source RPMs

Now it is time to check if everything works and actually build the most up to date source packages. A simple make within the server directory will build them:

su - koldev -c "cd `pwd` && make"

Creating the source distribution

If everything works fine the source RPMs will end up in both the /koldev/RPM/PKG and the stage directories. We are now ready to generate our own Kolab server source distribution and actually test build it.

Since we did only build the packages specific for the Kolab server and not the basic OpenPKG source packages we will have to include the source packages we originally downloaded into /kolabbuild/original. We just go back there and tell the installer that we would like to generate an updated source distribution based on the packages we just generated within /koldev:

cd /kolabbuild/original
./install-kolab.sh -S -t koldev
Single environment
Just run ./install-kolab.sh -S in the single environment setup.

The -S flag instructs the installer to try to build a complete source distribution and the -t flag is again necessary to tell the script that we are talking about the /koldev environment.

What will actually happen in this step?

  • The install script will create a new directory /koldev/RPM/SDIST and will place the new distribution there.
  • The script will copy itself to the new location.
  • It will also copy the basic OpenPKG installation package over to the source distribution directory.
  • Next all source packages found in the directory of the installer will be copied into the SDIST directory.
  • Finally any new source packages found in the specified envrionment under /koldev/RPM/PKG will also be copied into the source distribution directory
  • And last but not least the package index will be recreated

Now we can move into our new source distribution and check that all packages are present there:

cd /koldev/RPM/SDIST/
ls
Single environment
Your packages will be in /kolab/RPM/SDIST.

This should give you a longer list of source packages and the few necessary helper files (like 00INDEX.rdf, install-kolab.sh etc.). Some source packages might be duplicated but this is normal since you build the newer packages yourself. You may delete the older packages if you wish to do so.

At this point you can also run

cd /kolabbuild/original
./install-kolab.sh -D -t koldev

to build a binary backup distribution of your development environment. The packages end up in /koldev/RPM/BDIST and you can later use them to easily reconstruct your development installation. Just move the binary packages over to your /kolabbuild environment:

mv /koldev/RPM/BDIST /kolabbuild/koldev-binary

In case you ever delete your development environment and want to rebuild it or you want to install it on another machine that is binary compatible you can just go in the /kolabbuild/koldev-binary directory and run a quick binary installation:

cd /kolabbuild/koldev-binary
./install-kolab -t koldev
Single environment
This is something you can only do if you separate your environments.

Creating the installation environment

Creating your installation and test environment should now be rather easy. Just move into the source distribution you just created somewhere outside the /koldev environment (otherwise the OpenPKG installer will misbehave) and install the Kolab server in the default way:

mv /koldev/RPM/SDIST/ /kolabbuild/mysource
cd /kolabbuild/mysource
./install-kolab.sh
Single environment
Replace /koldev/RPM/SDIST with /kolab/RPM/SDIST.

This will now use the Kolab default settings and install the packages in the standard /kolab location.

If you want to use the binary packages you created during the installation process on a different machine you can create a binary distribution from your /kolab environment:

cd /kolabbuild/mysource
./install-kolab.sh -D

This will place the binaries in /kolab/RPM/BDIST. Just move these into /kolabbuild/binary to get a distribution that you can easily install in /kolab on any machine that is binary compatible:

mv /kolab/RPM/BDIST /kolabbuild/binary

Now go into your /kolab environment and configure it like a normal Kolab server:

/kolab/etc/kolab/kolab_bootstrap -b
/kolab/bin/openpkg rc all start

Using the development environment

Installing the development environment is only half the fun. You actually want to use it, modify the source and/or follow CVS updates.

Updating CVS, rebuilding the packages

If you wish to update your CVS at a later time point or you modified the sources and want to test your patches, you will be able to do so by using the following procedure.

  • Move into the development environment:
cd /koldev/CVS/server
  • Update CVS:
su - koldev -c "cd `pwd` && cvs update"
  • Generate new packages:
su - koldev -c "cd `pwd` && make"
  • Update the source distribution:
cd /kolabbuild/original/
./install-kolab.sh -S -t koldev
  • Sync the packages to your build area:
rsync -avz /koldev/RPM/SDIST/ /kolabbuild/mysource/
  • Move to your build area:
cd /kolabbuild/mysource
  • Update the /kolab environment
./install-kolab.sh
/kolab/sbin/kolabconf
/kolab/bin/openpkg rc all restart
Note
This will only work if you actually modified the release number of the package. The release number is by default coupled to the current day so if you already installed a package with the current date as release number rpm won't upgrade your fresh packages with the same release number. You will have to update you packages manually using something like
/kolab/bin/openpkg rpm --rebuild kolabd-2.1.99-20070727.src.rpm
/kolab/bin/openpkg rpm -Uhv --force /kolab/RPM/PKG/kolabd-2.1.99-20070727.ix86-gentoo1.6.14-kolab.rpm
  • Test the Kolab server in /kolab and build a binary distribution if desired:
cd /kolabbuild/mysource
./install-kolab.sh -D
rsync -avz /kolab/RPM/BDIST/ /kolabbuild/binary/
Single environment
Always replace /koldev with /kolab and remove any -t koldev tags.

Notes

Converting a source package to binary

You should be able to compile a source RPM package into a binary RPM package using something like:

/kolab/bin/openpkg rpm --rebuild kolabd-2.1.99-20070719.src.rpm

The compiled package will end up in /kolab/RPM/PKG and have a name similar to kolabd-2.1.99-20070719.ix86-debian4.0-kolab.rpm (depends on your platform).

Upgrading packages manually

You should be able to upgrade single packages manually, too:

/kolab/bin/openpkg rpm -Uvh --force /kolab/RPM/PKG/kolabd-2.1.99-20070719.ix86-debian4.0-kolab.rpm

Working with the stable 2.1.* branch

Make sure you install your server under /kolab as described under Kolab2 Installation - Source.

Retrieving the CVS repository

Fetch the 2.1.*-branch of the Kolab CVS repository:

mkdir /kolab/CVS
cd /kolab/CVS
cvs -d :pserver:anonymous@intevation.de:/home/kroupware/jail/kolabrepository co -r kolab_2_1_branch server
chown -R kolab\: /kolab/CVS
cd server

Building source RPMs

Finally a simple make within the server directory will build the newest packages:

su - kolab -c "cd `pwd` && make"

Upgrade to CVS

The new packages will end up in the stage directory and you should be able to install them manually as described below.

Personal tools