#!/bin/sh
#
# Copyright 2004 Dagmar d'Surreal <rivyqntzne@tznvy.pbz>
# Available under the terms of the GNU GPL.
#

NAME="evolution"
VERSION="2.4.2.1"
REVISION="1"
PKG_SOURCEURL='http://ftp.gnome.org/pub/GNOME/sources/$NAME/$VER_MAJ.$VER_MIN/$NAME-$VERSION.tar.bz2'

. $DLG_ROOT/config
. $DLG_ROOT/SCRIPTS/dropline-functions.sh

cflags
prepare

analyzesource

# This should REALLY be done with a patch to configure to make it look to
# pkgconfig to get the information about Firefox the way it does Mozilla.
#   --+Dagmar

# Begin ugly hack

if [ -d /usr/include/firefox/nss -a \
     -d /usr/include/firefox/nspr ]; then
  spew 2 "Building against Firefox sources instead of Mozilla sources"
  extra_configargs="--with-nss-includes=/usr/include/firefox/nss \
    --with-nss-libs=/usr/lib/firefox \
    --with-nspr-includes=/usr/include/firefox/nspr \
    --with-nspr-libs=/usr/lib/firefox"
fi

# End ugly hack

configure --enable-nss \
	--enable-smime=yes \
	--with-krb5=$PKG_PREFIX \
	--with-krb4=$PKG_PREFIX \
	--with-openldap \
	--enable-pilot-conduits=yes \
	--enable-ipv6 \
	--enable-gtk-doc \
	--enable-file-chooser \
	--with-sub-version=\" Dropline GNOME\" \
	$extra_configargs
make
makeinstall install-strip

spewdo "cd $PKG_STAGEROOT$PKG_PREFIX/bin"
spewdo "ln -sf evolution-$VER_MAJ.$VER_MIN evolution"

tidydocumentation
analyzebinaries
finalizepackage
packagize
cleanup
