# -*- 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 115137 2013-12-26 02:12:09Z jeremyhu@macports.org $

PortSystem          1.0

name                liferea
# Note: do not remove the epoch line.
epoch               20090731
version             1.6.5
revision            3
description         A feed aggregator for GTK+/GNOME.
long_description    Liferea is an aggregator for online news feeds. \
                    It supports the RSS/RDF, CDF, Atom, OCS and OPML \
                    formats and enclosures (podcasting). It also has \
                    filtering mechanisms.
maintainers         nomaintainer
categories          gnome net
license             GPL-2+
platforms           darwin
homepage            http://liferea.sourceforge.net/
master_sites        sourceforge
checksums           md5     b5a2c0803eec5d0aff0b9ca4114eaf16 \
                    sha1    f24dbd0e81c5a8309f0d19853211fc02ff818477 \
                    rmd160  77b384595a757983ab9d3f8ed91d824628991670
depends_build       port:intltool \
                    port:pkgconfig

depends_lib         port:desktop-file-utils \
                    port:gtk2 \
                    port:gconf \
                    port:libxml2 \
                    port:libxslt \
                    port:sqlite3 \
                    path:lib/pkgconfig/webkit-1.0.pc:webkit-gtk \
                    port:libglade2

# TODO: Check ${configure.cxx_stdlib} directly once MacPorts 2.3 is released
platform darwin {
    set cxxstdlib {}

    if {[info exists configure.cxx_stdlib] &&
        ${configure.cxx_stdlib} ne {} &&
        [string match *clang* ${configure.cxx}]} {
        set cxxstdlib ${configure.cxx_stdlib}
    } elseif {[string match *clang* ${configure.cxx}] &&
              ${os.major} >= 13} {
        set cxxstdlib libc++
    } else {
        set cxxstdlib libstdc++
    }

    if {${cxxstdlib} eq "libstdc++"} {
       depends_lib-delete path:lib/pkgconfig/webkit-1.0.pc:webkit-gtk
       depends_lib-append path:lib/pkgconfig/webkit-1.0.pc:webkit-gtk-2.0
    }
}

# disable libnotify, does not build with libnotify-0.7+

configure.args      --disable-lua \
                    --disable-libnotify

variant lua description {LUA scripting support} {
    depends_lib-append      port:lua
    configure.args-delete   --disable-lua
    configure.args-append   --enable-lua
}

pre-destroot {
    file mkdir "${destroot}${prefix}/share/doc/${name}"
    xinstall -m 644 -v -W ${worksrcpath} AUTHORS ChangeLog README \
      "${destroot}${prefix}/share/doc/${name}"
}

post-activate {
    system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
    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"
}

notes {
The date/time format has changed. If you want to override the\
new one, you need to run

    gconftool-2 -s -t string /apps/liferea/date-format <format>

where <format> is the format in strftime syntax.
}

livecheck.type      regex
livecheck.url       https://sourceforge.net/projects/liferea/files/Liferea%20Stable/
livecheck.regex     "Click to enter (\\d+(?:\\.\\d+)*)"
