Solaris - Build ThirdParty

Prerequisites

This is the second stage of three in the process of building ZCS for Solaris 10.  You MUST have gone through the first stage, Setup Build Environment.  If you haven't go back and do it now!


Intro

Building ThirdParty is a painful process. Put a strong brew on, and/or order a batch of happy keepy uppy narcotics.  Note that as of the new p4 sourcetree, most of the various opensource tarballs are now included (thanks Qanah!!!), which makes the process a whole lot easier.

There is a top level Makefile and build script that attempts to build the entire ThirdParty section in one go, automatically.  It is strongly recommended to not attempt this - almost certainly one or more of the components will fail the first time round, and there are many inter-dependencies.  It is more sensible to build component by component, checking each one as you go along.  I have patched the toplevel Makefile to allow invidual building of all the different components.

I've changed the behaviour of buildThirdParty.sh for our purposes. The original does a p4 synch each call and then tries to build the entire ThirdParty unconditionally. Our modified script calls the new get_plat_env.sh and then calls the main Makefile with whatever argument we give it. This allows us to use it as a wrapper to build whatever ThirdParty component we want, eg:
./buildThirdParty.sh openldap


Build Components

run buildThirdParty.sh for each component in turn.  After compilation has finished, look through the log (/tmp/ThirdParty.log.<component>) to make sure everything has gone OK.  Compile in this order:
openssl
sleepycat
mysql
libxml2
heimdal
At this point we have to break and build perl LWP, which is a dependency for buidling curl: perl -MCPAN -e 'install "LWP"'
curl
cyrus-sasl
openldap
aspell
clamav
apache-httpd
php
Postfix
dspam
rrdtool
snmp
memcached
nginx


Build Perl Component

Make second cup of very strong coffee.
Make sure your PERLLIB was set in /etc/profile in the Setup Build Environment section - if this is not set correctly, the perl component will not build.First, edit the CPAN template for your build environment.  Edit Perl/MyConfig.template:
Change all instances of @@BUILDROOT@@ to src dir, eg. /opt/build.zimbra/source/FRANKLIN/ThirdParty/Perl
'tar' => q[/opt/csw/bin/gtar],
'make' => q[/opt/csw/bin/gmake],
Change the internal Zimbra cpan mirror to a public mirror:
'urllist' => [q[http://www.mirrorservice.org/sites/ftp.funet.fi/pub/languages/perl/CPAN/],],Set siteinstalllib to the same as $PERLLIB:
'installsitelib' => q[$PERLLIB],At this point I would recommend updating Bundle::CPAN, just to make sure your environment is setup well before you go off and run the main makefile, and it gets rid of lots of irritating messages in the log file.  First Run gmake and quickly Ctrl-C, this will setup your MyConfig.pm in /root/.cpan/.  Then update CPAN.
perl -MCPAN -e 'install "Bundle::CPAN"'Now hold your breath and try the main build:
gmakeAfter it's run its course, check /tmp/ThirdParty-Perllibs.log very carefully. I find the easiest way is to load it in in emacs(/vi/whatever) and search for the string "won't" - this indicates some compile failure.

Typical things that go wrong are:
Crypt::SSLeay can't find /opt/csw. Run it by hand and give it the path when asked (do this symlink bodge first, the Makefile.PL is too stupid to find correct include path):
ln -s /opt/csw/include/openssl /opt/csw/include/openssl/openssl
perl -MCPAN -e 'install "Crypt::SSLeay"'
SpamAssassin always fails, because it is too stupid to follow PERLLIB and ends up sitting for hours in failed tests.  Theoretically you should be able to set @@INSTALLSITELIB@@ but I can't for the life of me figure out how to do this.  I just download the tarball and compile it manually:
cd /opt/build.zimbra/source/FRANKLIN/ThirdParty/Perl/tmp
wget http://mirrors.dedipower.com/ftp.apache.org/spamassassin/source/Mail-SpamAssassin-3.2.5.tar.gz
gzip -dc Mail-SpamAssassin-3.2.5.tar.gz |tar xf -
cd Mail-SpamAssassin-3.2.5
perl Makefile.PL && make && make install
Then re-tar the Perl build:
cd ..
make tar
Prepare JDK
We have to prepare jdk1.5 into a tarball and place it into ThirdPartyBuilds for the build process to find.
cd /opt/build.zimbra
gtar czf jdk1.5.0_15.tgz jdk1.5.0_15
mkdir -p /opt/build.zimbra/source/FRANKLIN/ThirdPartyBuilds/SOLARIS10/java
mv jdk1.5.0_15.tgz /opt/build.zimbra/source/FRANKLIN/ThirdPartyBuilds/SOLARIS10/java


Build Zimbra

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


 
RocketTheme Joomla Templates