Last version of Zimbra collaboration, version 6.0.6, had been subject to several delays, which lead to a gap of nearly three weeks since the first proposed release date. These dates are considered target, thus flexible. Normally, I wouldn’t get crazy about release dates. Yes, while you may wish to get your hands on, because it fixes the most annoying but you ever had, you can wait some more days anyway.
But 6.0.6 had several fixes I really needed at some place. And after the second delay, I decided to try to compile Zimbra from source. Brave you think? Me too…
Well, you know, compiling a software is not always something really straightforward. Considering that Zimbra is a mix of several different projects, that raises complexity a lot. So, while according to the wiki building from source on Debian Lenny is an easy task, it never really is!
So, the start point is the above wiki page: GNR on Debian Lenny. It says it’s updated until last february, for 6.0.5, so we should be up to date enough, right?
First we need to get the source. Download perforce executable and put it into the path. Unless changed in the download page this should work for amd64:
wget -P /usr/local/bin http://www.perforce.com/downloads/perforce/r10.1/bin.linux26x86_64/p4 chmod +x /usr/local/bin/p4
If it doesn’t work, go to perforce download page and adjust url.
export P4PORT=codes.zimbra.com:2666 p4 -u public -P public1234 -c public-view sync -f //depot/zcs/GNR-606/...
Depending on what you wish to compile, the latest directory may change. I.e. if you need 6.0.7, the dir will be //depot/zcs/GNR-607/… . The command will get Zimbra sources into /home/public, so make sure you have the rights to write there.
Now go and have a lunch, fetching perforce source takes its time as they’re ~750MB. In the meantime, you can prepare the host system. Since I’m trying to build on a Debian based, commands won’t change. But despite of what stated on the document, at least on Ubuntu 8.04 some other packages are needed. This is the full apt command for the needed stuff:
aptitude install lsb ant sun-java6-jdk sun-java6-jre sun-java5-jdk sun-java5-jre autoconf locales libtool bison flex libncurses5-dev libpcre3-dev libexpat1-dev libpopt-dev libwww-perl libperl-dev unzip libz libextutils-parsexs-perl libsasl2-dev libldap2-dev zlib1g-dev
Zimbra 6 series build should be compatible on both 1.5 and 1.6, but to be safe let’s tell the compiler to use Java 1.5:
update-alternatives --config java
and select the proper option relative to J1.5.
Download the latest JRE from java.com, extract it somewhere and then:
cd jre1.6.0_22/ mkdir -p /home/public/p4/GNR/ThirdPartyBuilds/x86_64/java tar cvzf /home/public/p4/GNR/ThirdPartyBuilds/x86_64/java/jdk1.6.0_22.tgz *
Lot of Zimbra devs place Java in /usr/loca, so as a workaround for some build issues, we need a symlink for it:
ln -s /usr/lib/jvm/java-1.5.0-sun /usr/local/java
And finally launch build:
mkdir -p /opt/zimbra cd /home/public/p4/GNR/ZimbraBuild/ export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun ./buildZCS.sh -t
The -t option can be omitted in successive builds.
It took ~70 minutes on an Intel(R) Xeon(R) CPU X3430 @ 2.40GHz with 8GB of RAM and a quite fast raid array. The final /home/public directory will end up to take few less than 6GB.