Home Documentation OpenSUSE Port Setup Environment
OpenSUSE - Setup Build Environment PDF Print E-mail

Setup environment

There are various useful environment variables to set in /etc/profile, relating to Zimbra build vars, Java/Ant vars, and P4 setup.
PS1='$LOGNAME@`hostname`: `pwd`> '
BUILD_HOME="/opt/build.zimbra/source"
JAVA_HOME=/opt/build.zimbra/java
ANT_HOME=/opt/build.zimbra/ant
PATH=/opt/build.zimbra/java/bin:/opt/build.zimbra/ant/bin:/opt/build.zimbra/bin:$PATH
P4EDITOR=emacs
P4PORT=codes.zimbra.com:2666
P4USER=public
P4CLIENT=public-view
P4PASSWD=public1234
P4=${BUILD_HOME}/bin/p4
RELEASE=FRANKLIN
PERLLIB=/opt/build.zimbra/source/FRANKLIN/ThirdParty/Perl/zimbramon/lib
PERLLIB=$PERLLIB:/opt/build.zimbra/source/FRANKLIN/ThirdParty/Perl/zimbramon/lib/x86_64-linux-gnu-thread-multi:/opt/bu
ild.zimbra/source/FRANKLIN/ThirdParty/Perl/zimbramon/lib/i486-linux-gnu-thread-multi
export PATH PS1 JAVA_HOME ANT_HOME BUILD_HOME PERLLIB P4EDITOR P4PORT P4USER P4CLIENT P4PASSWD P4 RELEASE
Logout, log back in.


Install OS Packages for building

zypper install gcc make libtool automake autoconf m4 ncurses-devel gcc-c++ zlib-devel pcre-devel openldap2-devel


Setup Java and ANT for building

** IGNORE THIS SECTION FOR NOW **
Although Zimbra now runs with Java 1.6, it still needs to be built with 1.5 so both must be downloaded. Download the latest 1.5 and 1.6 JDKs for Linux.  Note the versions are very specific - currently you must get 1.6.0_04 and 1.5.0_15.  You will have to go to Previous Releases, and Archive to get these:
Download Java 1.6
Download Java 1.5

We should end up with files similar to this:

jdk-1_5_0_15-linux-amd64.bin
jdk-1_5_0_15-linux-i586.bin
jdk-6u4-linux-i586.bin
jdk-6u4-linux-x64.bin
** END IGNORE **

Zimbra 5.0.6 has regressed to JDK1.5.0_15 for runtime, as there are unresolved bugs in JDK1.6.   So you don't have to download and unpack JDK1.6, only 1.5.0_15.
Download Java 1.5

Install JDK1.5:
sh jdk-1_5_0_15-linux-i586.bin
 or
sh jdk-1_5_0_15-linux-amd64.bin
mkdir -p /opt/build.zimbra
mv jdk1.5.0_15 /opt/build.zimbra
ln -s /opt/build.zimbra/jdk1.5.0_15/ /opt/build.zimbra/java
ln -s /opt/build.zimbra/java /usr/local/java
Install ANT:
wget http://mirror.public-internet.co.uk/ftp/apache/ant/binaries/apache-ant-1.7.1-bin.tar.gz
tar xf apache-ant-1.7.1-bin.tar.gz
mv apache-ant-1.7.1 /opt/build.zimbra/
ln -s /opt/build.zimbra/apache-ant-1.7.1 /opt/build.zimbra/ant


Create Users/Groups

Create zimbra user and group:
groupadd zimbra && useradd -g zimbra zimbra
mkdir -p /opt/zimbra
usermod -d /opt/zimbra zimbra
usermod -s /bin/bash zimbra
Create postfix user and group:
groupadd postdrop
groupadd postfix
useradd -g postfix postfix


Obtain Zimbra Source

First we need to download the p4 client binary from perforce:
mkdir -p /opt/build.zimbra/source
mkdir -p /opt/build.zimbra/bin; cd /opt/build.zimbra/bin
wget http://www.perforce.com/downloads/perforce/r07.3/bin.linux26x86_64/p4
chmod a+rx p4
Now synch the source (hint: don't do this right now, keep reading):
cd /opt/build.zimbra/source
/opt/build.zimbra/bin/p4 sync -f //depot/zcs/...
This should currently synch three branches - FRANK, FRANKLIN and main. FRANK is 4.5.x, and main is HEAD - as we want to build a stable 5.0 release, we want FRANKLIN branch. If you're doing dev, probably better choosing main branch.

As the trees are quite large, you can (and probably should) opt for a single tree.  Here we're going for the current 5.0.x branch - FRANKLIN:
/opt/build.zimbra/bin/p4 sync -f //depot/zcs/FRANKLIN/..

UPDATE: Zimbra has created special branches for 5.0.x.  So the actual command is (this example is for 5.0.11):
/opt/build.zimbra/bin/p4 sync -f //depot/zcs/FRANKLIN-5011/...
mv /home/public/p4/FRANKLIN-5011 /home/public/p4/FRANKLIN

The synch goes into /home/public/p4/FRANKLIN.  When the synch is completed, move it into our build tree:
mv /home/public/p4/FRANKLIN /opt/build.zimbra/source

Insert Download files into Source tree

OK, so there a bunch of windows .exe/.msi files that are included with ZCS.  NE has more, but OSS has several.  It's far outside the scope of this tutorial, and any sane unix build to include building these windows binaries from scratch.   It would be helpful/sensible/sane for Zimbra to include these in the source tree but they don't for now, so instead we download precompiled binaries from a running zimbra installation:
cd /opt/zimbra/jetty/webapps/zimbra/downloads; tar cf /tmp/downloads.tar *; cd -
scp /tmp/downloads.tar <our build server>:/tmp
Back on our build server:
cd /opt/build.zimbra/source/FRANKLIN/ZimbraServer/src/windows
tar xf /tmp/downloads.tar


Build ThirdParty

Right, now you're ready to start building ThirdParty component!
<- Go Here ->

temp: qshape copy
temp: windows files

 
RocketTheme Joomla Templates