# -*- 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: Portfile 119165 2014-04-18 11:17:53Z devans@macports.org $

PortSystem          1.0

name                zeitgeist
version             0.9.14
revision            6
license             LGPL-2.1
set branch          [join [lrange [split ${version} .] 0 1] .]
description         Zeitgeist is a service which logs the users's activities and \
                    events (files opened, websites visites, conversations held with \
                    other people, etc.) and makes relevant information available to \
                    other applications.
long_description    ${description}
maintainers         devans openmaintainer
categories          devel
platforms           darwin
homepage            https://launchpad.net/zeitgeist-project
master_sites        http://ftp.heanet.ie/mirrors/gnome/teams/releng/tarballs-needing-help/${name}/

checksums           rmd160  fad3efc670a627e7494fe179b8afcbd612152a05 \
                    sha256  64affdf543ca16c688845ac053bbacd8cb6021991afa7b27c4545efc5d86033f

depends_build       port:pkgconfig \
                    port:intltool \
                    port:autoconf \
                    port:automake \
                    port:libtool \
                    port:gnome-common

depends_lib         port:gtk3 \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:dbus \
                    port:json-glib \
                    port:telepathy-glib \
                    port:gobject-introspection \
                    port:raptor2 \
                    port:vala

patchfiles          patch-configure.ac.diff \
                    patch-libzeitgeist-Makefile.am.diff

post-patch {
    reinplace "s|^#\!.*|#!${configure.python}|" \
        ${worksrcpath}/data/ontology2code \
        ${worksrcpath}/test/dbus/blacklist-test.py \
        ${worksrcpath}/test/dbus/dsr-test.py \
        ${worksrcpath}/test/dbus/engine-test.py \
        ${worksrcpath}/test/dbus/histogram-test.py \
        ${worksrcpath}/test/dbus/monitor-test.py \
        ${worksrcpath}/test/dbus/remote-test.py \
        ${worksrcpath}/test/dbus/result-types-test.py \
        ${worksrcpath}/test/dbus/run-all-tests.py \
        ${worksrcpath}/test/dbus/upgrade-test.py \
        ${worksrcpath}/tools/development/index_switcher.py \
        ${worksrcpath}/tools/development/insert_events_from_json.py \
        ${worksrcpath}/tools/development/query_timings.py \
        ${worksrcpath}/tools/development/series.py \
        ${worksrcpath}/tools/development/slow_query_finder.py \
        ${worksrcpath}/tools/generate_events.py \
        ${worksrcpath}/tools/gtk/zeitgeist-data-sources-gtk.py \
        ${worksrcpath}/tools/ontology_graph.py \
        ${worksrcpath}/tools/scalability_benchmark.py \
        ${worksrcpath}/tools/talis  \
        ${worksrcpath}/tools/zeitgeist-explorer/zeitgeist-explorer
}

configure.cmd       ./autogen.sh
configure.args      --disable-silent-rules \
                    --enable-introspection

# gobject-introspection uses g-ir-scanner, which uses $CC from env
build.args-append       CC="${configure.cc} ${configure.cc_archflags}"
destroot.args-append    CC="${configure.cc} ${configure.cc_archflags}"

variant python25 conflicts python26 python27 description {Build using Python 2.5} {
    depends_lib-append  port:py25-rdflib
    configure.python    ${prefix}/bin/python2.5
}

variant python26 conflicts python25 python27 description {Build using Python 2.6} {
    depends_lib-append  port:py26-rdflib
    configure.python    ${prefix}/bin/python2.6
}

variant python27 conflicts python25 python26 description {Build using Python 2.7} {
    depends_lib-append  port:py27-rdflib
    configure.python    ${prefix}/bin/python2.7
}

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

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
