Building HELIX 7.1.4 on FreeBSD 9 amd64

Developer Article

Article Information

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

General information

Please, read Zimbra_on_FreeBSD for all the details.

This guide describes building HELIX-714 on FreeBSD-9_amd64. However, the very same guide works for other amd64 versions as well.

At this point it's good to note that everything should be run as root unless stated otherwise.

Initial pre-build steps

Let's check our system:

uname -a
FreeBSD 9.0-RELEASE FreeBSD 9.0-RELEASE #3: Tue Feb 21 22:30:14 CET 2012  amd64

We love some optimizations:

cat /etc/make.conf
COPTFLAGS= -O2 -pipe
CFLAGS= -O2 -fno-strict-aliasing -pipe

Preparing build enviroment via /usr/ports

I created simple "meta" ports which will take care of everything. Since I am a very very creative person I named those: mail/zimbra-rundeps and mail/zimbra-builddeps.

The first installs all dependencies needed to run HELIX-714 while the second installs all dependencies needed to build HELIX-714. For reasons vastly uknown the second requires the first one.

cd /usr/ports/mail
fetch && \
    tar xzf usrports_zimbra-rundeps-7.1.4.tgz && \
        rm -f usrports_zimbra-rundeps-7.1.4.tgz
fetch && \
    tar xzf usrports_zimbra-builddeps-7.1.4.tgz && \
        rm -f usrports_zimbra-builddeps-7.1.4.tgz
cd /usr/ports/mail/zimbra-builddeps && make config-recursive install

followed by an optional:

make distclean

to completely clean the build mess including source files.

If you are able to use /usr/ports you should be able to figure out the configure options (not that it matters much, mostly unimportant stuff).

If you are using a csh derivate shell, which is the FreeBSD default, run:


Preparing build enviroment via

Since some people like to compile and others like to install-only I prepared all the necessary zimbra-builddeps packages.

cd /tmp && \
    fetch && \
        tar xzf zimbra-builddeps-7.1.4.tgz && \
            cd zimbra-builddeps-7.1.4 && \
                pkg_add zimbra-builddeps-7.1.4.tbz && cd /tmp && rm -rf zimbra-builddeps-7.1.4

If you are using a csh derivate shell, which is the FreeBSD default, run:


Grats, you just saved yourself a lot of time.

Getting the ready-to-build(TM) source from


mkdir -p /home/public/p4 && \
    cd /home/public/p4 && \
        fetch && \
            tar xzf HELIX-714.fbsd-src.tgz && cd HELIX-714.fbsd

Note: this tarball contains everything to simplify the build procedure on FreeBSD-9_amd64. It is the same source I used to build the packages therefore it is guaranteed to work.

If you are building on a different version of FreeBSD (!=FreeBSD 9.0-RELEASE) be sure to include your own version-specific-compiled java:

mkdir -p ThirdPartyBuilds/FreeBSD_amd64/java && cd ThirdPartyBuilds/FreeBSD_amd64/java && \
    rm -rf openjdk6 && \
    cp -pr /usr/local/openjdk6 openjdk6 &&\
        tar zcf openjdk6.tgz openjdk6 && \
            rm -rf openjdk6 && cd ../../../

Quick-hacks for a better day

Since Zimbra is a Linux lover by nature everything is /bin/bash but guess what.. we have /usr/local/bin/bash:

ln -s /usr/local/bin/bash /bin/bash

Building Zimbra Collaboration Suite: HELIX-714

First build yourself the native library and push it to the proper place:

cd ZimbraNative && gmake push && cd ../

Then get yourself occupied for at least an hour:

cd ZimbraBuild
./ -t

Installing Zimbra Collaboration Suite: HELIX-714 after a successful build

cd zcs-7.*

Further reading


--Solko 10:57, 27 February 2012 (PST)

Jump to: navigation, search