# $Id: Portfile 60105 2009-11-02 01:40:28Z jmr@macports.org $
PortSystem      1.0

name                    gkrellm
version                 2.3.2
categories              sysutils
maintainers             markd openmaintainer

description             A GTK based system monitor
long_description        ${description}

homepage                http://members.dslextreme.com/users/billw/gkrellm/gkrellm.html

platforms               darwin
master_sites            http://members.dslextreme.com/users/billw/gkrellm/
checksums               md5 d5543a439ee77950282d06b000048be7 \
			sha1 fe94996c4fe084c28bf7a7fbc3f8d4fd64724ac0 \
			rmd160 0aacc0d0783cff5bb2fd8c6736553a3ce8874ad9
use_bzip2		yes

depends_lib             port:gtk2

patchfiles		patch-Makefile.diff

use_configure		no

build.type		gnu
build.env		CPPFLAGS="-L${prefix}/lib -I${prefix}/include" \
			CFLAGS=-I${prefix}/include \
			LDFLAGS=-L${prefix}/lib

build.target		darwin
destroot.target		install_darwin

set plugin_dir          ${prefix}/libexec/gkrellm2/plugins
set theme_dir		${prefix}/share/gkrellm2/themes

platform darwin 8 { 
	patchfiles-delete   patch-Makefile.diff
} 

post-patch {
        reinplace "s|\$(PREFIX)|${prefix}|g" \
                "${worksrcpath}/Makefile"

        reinplace "s|/usr/local/share/gkrellm2/themes|${theme_dir}|g" \
                "${worksrcpath}/src/gkrellm.h"

	reinplace "s|/usr/share/gkrellm2/themes|${theme_dir}|g" \
                "${worksrcpath}/src/gkrellm.h"

        reinplace "s|/usr/local/lib/gkrellm2/plugins|${plugin_dir}|g" \
                "${worksrcpath}/src/gkrellm.h"

        reinplace "s|/usr/lib/gkrellm2/plugins|${plugin_dir}|g" \
                "${worksrcpath}/src/gkrellm.h"
}

post-destroot {
	xinstall -m 755 -d ${destroot}${theme_dir}
	xinstall -m 755 -d ${destroot}${plugin_dir}

	destroot.keepdirs \
                ${destroot}${theme_dir} \
		${destroot}${plugin_dir}
}

post-activate {
ui_msg "\n

After the first launch of GkrellM, the directory ~/.gkrellm2/
is created that contains the file user-config to keep your
settings, and also contains directories named themes/ and plugins/.
However, the plugins and themes directories for this port of
GkrellM are fixed at these locations:

${plugin_dir}
${theme_dir}
\n"
}
