# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id$

PortSystem 1.0

name            evolution-data-server
version         2.30.3
revision        2
set branch      [join [lrange [split ${version} .] 0 1] .]
description     Addressbook and calender libs for GNOME.
long_description    Evolution Data Server provides a central location for \
                    addressbook and calendar in the GNOME Desktop.
maintainers     geekdaily.org:jim
categories      gnome
license         LGPL-2+
platforms       darwin
homepage        http://www.gnome.org/
master_sites    gnome:sources/${name}/${branch}/

checksums       md5     095bac0a80043d57d00f64319f3cbdbb \
                sha1    449d3e7a9b19768d5a792434ca5d55c9d2496993 \
                rmd160  2d4dc2fd6b8dfdc013042400b382f4684e642425

depends_build   port:pkgconfig \
                port:intltool \
                port:gtk-doc

depends_lib     port:gconf \
                port:libgnome-keyring \
                port:libgweather \
                port:libical \
                port:nss \
                port:gnuregex \
                port:db46

use_bzip2       yes

patchfiles      patch-configure.ac.diff \
                patch-m4-evo_krb5_support.m4.diff

use_autoreconf    yes
autoreconf.args  -fvi

configure.args  \
        --enable-static \
        --enable-smime \
        --enable-gnome-keyring \
        --enable-ipv6 \
        --enable-nntp \
        --with-nspr-includes=${prefix}/include/nspr  \
        --with-nspr-libs=${prefix}/lib/nspr  \
        --with-nss-includes=${prefix}/include/nss \
        --with-nss-libs=${prefix}/lib/nss \
        --with-krb5=/usr \
        --disable-schemas-install

#
# port nss is not universal
#
universal_variant no

platform darwin 8 {
    post-patch {
        reinplace "s|#include <stdio.h>|#include <stdio.h>\\\n#include <sys/types.h>|g" \
        ${worksrcpath}/camel/camel-block-file.h
    }
    configure.args-delete --with-krb5=/usr
    configure.args-append --without-krb5
}

variant gtk_doc description {Build gtk-doc documentation} {
  configure.args-append --enable-gtk-doc
}

post-activate    {
    system "export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` && \
        gconftool-2 --makefile-install-rule ${prefix}/etc/gconf/schemas/*.schemas"
}

livecheck.type  regex
livecheck.url   http://ftp.gnome.org/pub/gnome/sources/${name}/${branch}/
livecheck.regex {LATEST-IS-(\d+(?:\.\d+)*)}