# -*- 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 120336 2014-05-23 17:25:56Z devans@macports.org $

PortSystem      1.0

name            gvfs
version         1.21.2
set branch      [join [lrange [split ${version} .] 0 1] .]
maintainers     nomaintainer
categories      devel
# trashlib code used in the daemon is GPL
license         {LGPL GPL-3}
platforms       darwin
description     The Gnome Virtual File System.

long_description \
                gvfs is a userspace virtual filesystem designed \
                to work with the i/o abstractions of gio (a new \
                library available with glib). It installs several \
                modules that are automatically used by applications \
                using the APIs of libgio. The gvfs model differs \
                from e.g. gnome-vfs in that filesystems must be \
                mounted before they are used. There is a central \
                daemon (gvfsd) that handles coordinting mounts, and \
                then each mount is (typically) in its own daemon \
                process (although mounts can share daemon process). \
                gvfs comes with a set of backends, including trash \
                support, sftp, smb, http, dav and others. There is \
                a set of command line programs starting with gvfs- \
                that lets you run commands (like cat, ls, stat, etc) \
                on files in the gvfs.

homepage        https://wiki.gnome.org/Projects/gvfs
master_sites    gnome:sources/${name}/${branch}/

use_xz          yes

checksums       rmd160  d56f6d0d510317e02fdd9e10d825de0e0d40c841 \
                sha256  aadf18dea818bdd1fd14856e56a30171bd9f89ce5e36591ab8c74d10199e0142

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

depends_lib     port:gtk3 \
                port:gettext \
                path:lib/pkgconfig/glib-2.0.pc:glib2 \
                port:libarchive \
                port:libgcrypt \
                port:openssh \
                port:libsoup \
                port:libxml2 \
                port:libsecret \
                port:gnome-online-accounts

# update m4/intltool.m4 and autoreconf

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

use_autoreconf  yes
autoreconf.args -fvi

configure.args  --disable-avahi \
                --disable-fuse \
                --disable-hal \
                --disable-cdda \
                --disable-obexftp \
                --disable-gphoto2 \
                --disable-samba \
                --disable-udev \
                --disable-gdu \
                --disable-udisks2 \
                --disable-libsystemd-login \
                --disable-gudev \
                --disable-afc \
                --disable-bluray \
                --disable-libmtp \
                --enable-goa \
                --enable-http \
                --enable-archive \
                --enable-afp \
                --disable-silent-rules

test.run        yes
test.target     check

destroot.keepdirs ${destroot}${prefix}/share/gvfs/remote-volume-monitors

post-destroot {
    xinstall -d ${destroot}${prefix}/share/gvfs/remote-volume-monitors
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING MAINTAINERS NEWS README \
        ${destroot}${docdir}
}

post-activate {
    system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas"
    system "${prefix}/bin/gio-querymodules ${prefix}/lib/gio/modules"
}

livecheck.type  gnome-with-unstable
