# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 89174 2012-01-20 08:37:30Z dports@macports.org $

PortSystem 1.0

name            gnumeric
version         1.10.17
license         GPL-2
set branch      [join [lrange [split ${version} .] 0 1] .]
description	A spreadsheet with gnome support.
long_description	${description}
maintainers	nomaintainer
categories	gnome math
platforms	darwin
homepage	http://projects.gnome.org/gnumeric/

master_sites    gnome:sources/${name}/${branch}/
use_xz          yes

checksums       sha256  8f105a10dc0dd47e14df2879591d2f28482fd03809fa95977dd4d1470a02f963

depends_build	port:gnome-doc-utils \
		port:intltool \
		port:pkgconfig

depends_lib	port:goffice \
                port:libglade2

configure.args  --disable-schemas-install \
                --without-gda \
                --without-paradox \
                --without-psiconv

variant python25 conflicts python26 python27 description {Use python 2.5} {
    configure.python          ${prefix}/bin/python2.5
    depends_lib-append        port:py25-gobject
    set python_framework      ${frameworks_dir}/Python.framework/Versions/2.5
    configure.pkg_config_path ${python_framework}/lib/pkgconfig
}

variant python26 conflicts python25 python27 description {Use python 2.6} {
    configure.python          ${prefix}/bin/python2.6
    depends_lib-append        port:py26-gobject
    set python_framework      ${frameworks_dir}/Python.framework/Versions/2.6
    configure.pkg_config_path ${python_framework}/lib/pkgconfig
}

variant python27 conflicts python25 python26 description {Use python 2.7} {
    configure.python          ${prefix}/bin/python2.7
    depends_lib-append        port:py27-gobject
    set python_framework      ${frameworks_dir}/Python.framework/Versions/2.7
    configure.pkg_config_path ${python_framework}/lib/pkgconfig
}

if {![variant_isset python25] && ![variant_isset python26]} {
    default_variants +python27
}

if {${configure.compiler} == "clang"} {
    configure.cflags-append "-std=gnu89"
}

post-activate {
	system "${prefix}/bin/scrollkeeper-update"
        system "${prefix}/bin/gtk-update-icon-cache -f -t ${prefix}/share/icons/hicolor"
        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+)*)}
