GNR on Debian Lenny

From Zimbra :: Wiki

Jump to: navigation, search
Developer Article

Article Information

This article applies to the following ZCS versions.
  ZCS 6.0 Article  ZCS 6.0

This document explains some tricks & tips on how to build ZCS on Debian Lenny (x86 or x86_64).

Latest version: February 2010

A very simple vserver with minimal packages has been used to build it. The source size is almost 500MB, and once compiled, the /opt/public-src folder will be at least 4GB large. More, you will need some MB in /tmp to be able to create the Debian packages.

Install on a clean system, or safe your Zimbra, because ./buildZCS.sh -t will erase all your /opt/zimbra!


Contents

Get the source

First, create a zimbra user, and ensure that your user account (here "Benjamin") can to /opt/zimbra and /opt/public-src

 $ sudo adduser zimbra
 $ sudo adduser zimbra --home /opt/zimbra
 $ sudo mkdir -p  /opt/zimbra /opt/public-src
 $ sudo chown -R benjamin.benjamin /opt/zimbra /opt/public-src

Download the Perforce P4 command line client from here : http://www.perforce.com/perforce/downloads/platform.html use your platform (typically linux 32bits or linux 64bits)

Add p4 binary to your path, example :

 $ sudo cp p4 /usr/local/bin/
 $ sudo chmod a+x /usr/local/bin/p4
 $ export P4PORT=codes.zimbra.com:2666
 $ p4 -u public -P public1234 -c public-view sync -f //depot/zcs/GNR-605/...

(yes, the ... must be included in the command line, use this command as written. You may replace 605 by 606 or 607 if a new version of ZCS 6.x has been published)

Install dependencies

You have to install Java Sun 5 and 6 (don't really know which one is used, seems like both of them ...) You will also need some libraries and development packages as follow. LSB will install build-essential and other basic development libraries.

 $ sudo aptitude install lsb ant sun-java6-jdk sun-java6-jre sun-java5-jdk sun-java5-jre 
 $ sudo aptitude install autoconf locales libtool bison flex libncurses5-dev libpcre3-dev libexpat1-dev \
   libpopt-dev libwww-perl libperl-dev  zlib1g-dev zlib1g gcj

Notes:

libwww-perl presence is not checked by zcs compiler, but is required by curl.

libperl-dev presence is not checked by zcs compiler, but is required by openldap.

Create a tarball of Java

Now you need to create a tarball (.tgz file) of java installation, under debian, proceed as follow :

 $ cd /usr/lib/jvm/java-6-sun
 $ mkdir -p /opt/public-src/main/GNR-605/ThirdPartyBuilds/x86_64/java
 $ tar -czvf /opt/public-src/main/GNR-605/ThirdPartyBuilds/x86_64/java/jdk1.6.0_16.tgz *
 $ mv /opt/public-src/main/GNR-605/ThirdPartyBuilds /home/public/p4/zcs/GNR-605/


Compile ZCS

Now you can launch the ZCS builder. The first time you launch it, you should add -t option (warning, this will erase all /opt/zimbra directory) to compile third party libraries and programs.

 $ export JAVA_HOME=/usr/lib/jvm/java-6-sun
 $ cd /home/public/p4/zcs/GNR-605/ZimbraBuild
 $ ./buildZCS.sh -t

Note: buildZCS.sh as of GNR607 specifically looks for sun-java5 hence i had to do below on my setup

$ sudo update-alternatives --config java and had to choose the one that provides java-1.5.0

This may take between 15 and 120 minutes depending on your machine computing power and disk I/O ...

End

The compilation ends with :

*** BUILD COMPLETED ***

But the /home/public/p4/zcs/GNR-605/ZimbraBuild/zcs_* folder contains a valid Zimbra install.sh and binaries...

have fun ;)


Verified Against: ZCS 6.0.5 Date Created: 02/26/2010
Article ID: http://wiki.zimbra.com/index.php?title=GNR_on_Debian_Lenny Date Modified: 03/21/2011
Personal tools