# -*- 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 120096 2014-05-15 04:26:20Z devans@macports.org $

PortSystem      1.0

name            seahorse
version         3.12.2
license         GPL-2+ GFDL-1.1+
set branch      [join [lrange [split ${version} .] 0 1] .]
description     Seahorse is a graphical interface for managing and using encryption keys.
long_description \
                ${description} \
                Currently it supports PGP keys (using GPG/GPGME) and SSH keys. Its goal is to \
                provide an easy to use Key Management Tool, along with an easy to use interface \
                for encryption operations.
maintainers     devans openmaintainer
categories      gnome crypto
platforms       darwin
homepage        https://wiki.gnome.org/Apps/Seahorse
master_sites    gnome:sources/${name}/${branch}/

use_xz          yes

checksums       rmd160  edae7fda6881abf9ef6cdcf70a4c565339fce207 \
                sha256  5e6fb25373fd4490e181e2fa0f5cacf99b78b2f6caa5d91c9c605900fb5f3839

depends_build   port:pkgconfig \
                port:intltool \
                port:itstool \
                port:yelp-tools \
                port:gnome-common

depends_lib     port:desktop-file-utils \
                port:gtk3 \
                port:gcr \
                port:gpgme \
                port:openldap \
                port:libsoup \
                port:libsecret \
                port:openssh \
                port:vala

depends_run     port:gnome-settings-daemon \
                port:yelp

# update build/m4/intltool.m4 and autoreconf

pre-configure {
    copy -force ${prefix}/share/aclocal/intltool.m4 ${worksrcpath}/build/m4
}

use_autoreconf  yes
autoreconf.args -fvi

configure.cflags-append \
                -Wno-return-type

configure.args  --disable-sharing \
                --disable-schemas-compile \
                --disable-silent-rules

post-activate {
    system "${prefix}/bin/update-desktop-database -q ${prefix}/share/applications"
    system "${prefix}/bin/gtk-update-icon-cache-3.0 -f -t ${prefix}/share/icons/hicolor"
    system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas"
}

livecheck.type  gnome
