# $Id: Portfile 83598 2011-09-07 06:57:10Z afb@macports.org $

PortSystem 1.0

name            rox-filer
version         2.8
categories      x11 rox
platforms       darwin freebsd linux
license         GPL-2+
maintainers     afb
description     fast and powerful file manager
long_description \
ROX-Filer is a fast and powerful graphical file manager. It has full \
drag-and-drop support and background file operations, and is highly \
configurable. It can also act as a pinboard, allowing you to pin \
frequently used files to the desktop background.
homepage        http://rox.sourceforge.net/desktop/ROX-Filer
master_sites    sourceforge:rox
use_bzip2       yes
checksums       md5 f31b2999ac1ec3547ba2506655bf7d3f \
                sha1 7eec68a106a2605b2733025e44d890961b52ea1e \
                rmd160 9f0aecde32fdd9ecc39efe80bd037b95850bb38c

depends_build   port:pkgconfig
depends_lib     port:shared-mime-info port:libxml2 path:lib/pkgconfig/glib-2.0.pc:glib2 port:gtk2 \
                port:xorg-libX11 port:xorg-libsm port:libglade2

use_configure		no
universal_variant	no

configure.args --x-include=${prefix}/include --x-lib=${prefix}/lib

#build.env	CC=${configure.cc} CPPFLAGS=${configure.cppflags} LDFLAGS=${configure.ldflags}
build		{ system "cd ${worksrcpath}; CC=${configure.cc} CPPFLAGS=\"${configure.cppflags}\" LDFLAGS=\"${configure.ldflags}\" ./ROX-Filer/AppRun --compile ${configure.args}" }

destroot {
	xinstall -d ${destroot}${prefix}/etc/xdg/rox.sourceforge.net
	copy ${worksrcpath}/Choices/MIME-types ${destroot}${prefix}/etc/xdg/rox.sourceforge.net
	xinstall -d ${destroot}${prefix}/share/mime/packages
	copy ${worksrcpath}/rox.xml ${destroot}${prefix}/share/mime/packages
	xinstall -d ${destroot}${prefix}/apps
	copy ${worksrcpath}/ROX-Filer ${destroot}${prefix}/apps
	xinstall -m 755 ${filespath}/rox.sh.in ${destroot}${prefix}/bin/rox
	reinplace "s,@@APPDIR@@,${prefix}/apps," ${destroot}${prefix}/bin/rox
	xinstall ${worksrcpath}/rox.1 ${destroot}${prefix}/share/man/man1
	ln -s rox.1 ${destroot}${prefix}/share/man/man1/ROX-Filer.1
}

# not in mtree: ${prefix}/apps
destroot.violate_mtree	yes
