Home Documentation FreeBSD Port
FreeBSD Setup Build Environment
This is a TEMPORARY, IN PROGRESS Build Document.  It will be incorrect, incomplete and misleading.  DO NOT USE IT.
asdf

Setup environment


We need to set various environment settings to a) reflect the install environment, and b) enable us to obtain and build the source code.  As this port has evolved, we have removed the need to have Blastwave in the execution or library paths - these are specified through runtime variables and library hinting.  It is important not to set library paths in crle or LD_LIBRARY_PATH.
IMPORTANT: ensure $LD_LIBRARY_PATH is null, and 'crle' is not altered.

I set the prompt and change shell to bash.  Shell scripts should all have /bin/bash specified as the first line, so this is for convenience only, it is not a necessity. Now we setup /etc/profile.  There are various useful environment variables to set in here, relating to Zimbra build vars, Java/Ant vars, and P4 setup.
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/amd64-freebsd
PATH=/opt/SUNWspro/bin:/opt/build.zimbra/java/bin:/opt/build.zimbra/ant/bin:$PATH
export PATH JAVA_HOME ANT_HOME BUILD_HOME PERLLIB P4EDITOR P4PORT P4USER P4CLIENT P4PASSWD P4 RELEASE

add PS1="[\u@\h \w]# " to /root/.bashrc

Logout, log back in.

install necessary packages
pkg_add -r bash wget perl gmake gtar libgmp gsed gawk sudo libtool diffutils colordiff autotools xorg_libraries javavmwrapper xbitmaps open-motif cups-base patch

setup ports
pkg_add -r cvsup-without-gui
cp /usr/share/examples/cvsup/ports-supfile /root
edit /root/ports-supfile
change
CHANGE_THIS.FreeBSD.org to cvsup.uk.FreeBSD.org
cvsup -L 2 /root/ports-supfile

Setup Java and ANT for building Although Zimbra now runs with Java 1.6, it still needs to be built with 1.5 so both must be downloaded.

deep breath, build java

download bootstrap 1.5
http://www.freebsdfoundation.org/downloads/java.shtml
download latest jdk for your architecture, ie i386/amd64
pkg_add <package.tbz>

Download http://download.java.net/tiger/archive/tiger_u14/index.html
jrl source, source binaries
Download latest BSD 1.5 patchset here:
http://www.eyesbeyond.com/freebsddom/java/jdk15.html

Please open http://download.java.net/jdk6/6u3/promoted/b05/index.html
 in a web browser.  Download the
 Update 3 Source, jdk-6u3-fcs-src-b05-jrl-24_sep_2007.jar and the
 Source Binaries, jdk-6u3-fcs-bin-b05-jrl-24_sep_2007.jar and the
 Mozilla Headers, jdk-6u3-fcs-mozilla_headers-b05-unix-24_sep_2007.jar .

 Please open http://java.sun.com/javase/downloads/index.jsp
 in a web browser and follow the "Download" link for
 "JDK US DST Timezone Update Tool - 1.3.3" to obtain the
 time zone update file, tzupdater-1.3.3-2007k.zip.

 Please download the patchset, bsd-jdk16-patches-4.tar.bz2, from
 http://www.eyesbeyond.com/freebsddom/java/jdk16.html.
 
Put all the downloads in /usr/ports/distfiles

unsetenv LANG
unsetenv JAVA_HOME
unsetenv CLASSPATH
unsetenv LD_LIBRARY_PATH
setenv ALT_MOTIF_DIR /usr/X11R6
setenv SKIP_COMPARE_IMAGES YES
setenv DONT_ENABLE_IPV6 YES
setenv ALT_BOOTDIR /usr/local/diablo-jdk1.5.0

cd /usr/ports/java/jdk15
make
make install

cd /usr/ports/java/jdk16
make
make install

mv /usr/local/jdk1.5.0 /opt/build.zimbra
mv /usr/local/jdk1.6.0 /opt/build.zimbra

For now we just need jdk15, so:
ln -s /opt/build.zimbra/jdk1.5.0 /opt/build.zimbra/java
That is to match JAVA_HOME and the java path.

Now delete the bootstrap java
pkg_delete diablo-jdk-1.5.0.07.01

Now we need to package jdk16 as the build process expects.  Currently ports contains slightly different version of jdk16 (p3) than zimbra expects but builds in a generic jdk1.6.0 directory, so we need to rename the directory and package by hand:
cd /opt/build.zimbra
mv jdk1.6.0 jdk1.6.0_04
gtar czf jdk1.6.0_04.tgz jdk1.6.0_04
mkdir -p /opt/build.zimbra/source/FRANKLIN/ThirdPartyBuilds/FREEBSD6/java
mv jdk1.6.0_04.tgz /opt/build.zimbra/source/FRANKLIN/ThirdPartyBuilds/FREEBSD6/java


Install ANT:
cd /opt/build.zimbra/downloads
wget http://mirror.public-internet.co.uk/ftp/apache/ant/binaries/apache-ant-1.7.0-bin.tar.gz
cd ..
gtar -xf downloads/apache-ant-1.7.0-bin.tar.gz
ln -s /opt/build.zimbra/apache-ant-1.7.0 /opt/build.zimbra/ant
Create Users/Groups

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


adf

cd /opt/build.zimbra/source
wget http://varlogmessages.vroomvroom.org/download/FRANKLIN-5.0.3_2005.tgz
wget http://varlogmessages.vroomvroom.org/download/zimbra.5.0.3_2005.solaris10.gdiff
wget http://varlogmessages.vroomvroom.org/download/zimbra.5.0.3_2005.solaris10.ThirdParty.gdiff
gtar xf FRANKLIN-5.0.3_2005.tgz
cd FRANKLIN
gpatch -p1 <../zimbra.5.0.3_2005.solaris10.gdiff
gpatch -p0 <../zimbra.5.0.3_2005.solaris10.ThirdParty.gdiff

Add in a fake allocah.h for ZimbraNative - alloca is provided by stdlib.h (although use is architecture/compiler dependent and discouraged):
echo '#include <stdlib.h>' >/usr/include/alloca.h

Temporarily do the same for malloc until we've finished:
mv /usr/include/malloc.h /usr/include/malloc.h.orig
echo '#include <stlib.h>' >/usr/include/malloc.h
 
Build order:
core
proxy
mta
store
ldap
snmp
logger
apache
spell

 
RocketTheme Joomla Templates