|
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
apt-get install build-essential libncurses5-dev libtool automake libltdl3-dev libperl-dev bison flex zlib1g-dev libpcre3 libpcre3-dev
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.0-bin.tar.gz
tar xf apache-ant-1.7.0-bin.tar.gz
mv apache-ant-1.7.0 /opt/build.zimbra/
ln -s /opt/build.zimbra/apache-ant-1.7.0 /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 zimbraCreate 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/bin; cd /opt/build.zimbra/bin
wget http://www.perforce.com/downloads/perforce/r07.3/bin.linux26x86_64/p4
chmod a+rx p4Now 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 a special branch for 5.0.6. So the actual command is:
/opt/build.zimbra/bin/p4 sync -f //depot/zcs/FRANKLIN-506/...
mv /home/public/p4/FRANKLIN-506 /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/sourceNow download the patch with necessary fixes for Ubuntu 8.04:
And apply to the source:
cd /opt/build.zimbra/source/FRANKLIN
patch -p1 <path_to/zcs-5.0.6_GA_2314.UBUNTU8.diff
Build ThirdParty
Right, now you're ready to start building ThirdParty component!
<- Go Here ->
|