# -*- 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 66908 2010-04-25 18:36:48Z rmsfisher@macports.org $

PortSystem      1.0
PortGroup       muniversal 1.0

name            gnome-vfs
version         2.24.3
set branch      [join [lrange [split ${version} .] 0 1] .]
maintainers     nomaintainer
categories      gnome
platforms       darwin
description     This is the GNOME Virtual File System.

long_description \
    This is the GNOME Virtual File System. \
    GNOME VFS is currently used as one of the \
    foundations of the Nautilus file manager.

homepage        http://www.gnome.org/
master_sites    gnome:sources/${name}/${branch}/
use_bzip2       yes

checksums       md5     646a2672c6e7e4ebff6a798b0fb7cc90 \
                sha1    56aed067eea79175bc186a00003c07a42e5e9aa6 \
                rmd160  652afba47a33b05128d354927d2648b39b50f35a

depends_lib     port:gconf \
                port:openssl \
                port:libidl \
                port:libxml2

depends_run     port:desktop-file-utils \
                port:gnome-mime-data \
                port:shared-mime-info

patchfiles      patch-configure.diff

configure.args  --enable-ipv6 \
                --disable-howl \
                --disable-avahi \
                --with-openssl-libs=${prefix}/lib \
                --with-openssl-includes=${prefix}/include \
                --disable-gnutls \
                ac_cv_func_open64=no \
                ac_cv_func_posix_fadvise=no \
                ac_cv_path_KRB5_CONFIG=none

configure.ldflags-append    -lresolv

post-patch {
    reinplace -E "/xdg_data_dirs =/s|\"\[^\"\]*\"|\"${prefix}/share\"|" \
        ${worksrcpath}/libgnomevfs/xdgmime.c

    reinplace "s|/etc/fstab|/etc/fstab.hd|" \
        ${worksrcpath}/libgnomevfs/gnome-vfs-unix-mounts.c
}

variant avahi description {Enable Bonjour through avahi} {
    depends_lib-append      port:avahi
    configure.args-delete   --disable-avahi
}
post-activate {
    # We need to register some stuff to gconf. Just putting the
    # schema files to the right place is not enough.
    # You can watch the successful installation with gconf-editor.

    system "cd ${prefix}/etc/gconf/schemas && \
    GCONF_CONFIG_SOURCE=`${prefix}/bin/gconftool-2 --get-default-source` ${prefix}/bin/gconftool-2 --makefile-install-rule \
        desktop_default_applications.schemas \
        desktop_gnome_url_handlers.schemas \
        system_dns_sd.schemas \
        system_http_proxy.schemas \
        system_smb.schemas"
}

livecheck.type  regex
livecheck.url   http://ftp.gnome.org/pub/gnome/sources/${name}/${branch}/
livecheck.regex {LATEST-IS-(\d+(?:\.\d+)*)}
