# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# $Id: Portfile 67887 2010-05-20 21:41:08Z ged@macports.org $

PortSystem 1.0

# PortGroup muniversal 1.0
PortGroup xcodeversion 1.0

name				cfengine3
conflicts			cfengine
version				3.0.4
revision			1
categories			sysutils
maintainers			ged
description			network configuration-management tool
long_description	a suite of programs for integrated autonomic \
					management of either individual or networked \
					computers. Cfengine 3 is a significant rewrite \
					of underlying cfengine technology which \
					preserves the core principles and methodology \
					of cfengine2’s approach.
homepage			http://www.cfengine.org/
distname			cfengine-${version}
master_sites		http://www.cfengine.org/tarballs/
checksums           md5     877ff961b445c1b7ddd6994ab8009433 \
                    sha1    71c6c41bc717a03df6db8585e11a673415f1f94c \
                    rmd160  6c7507d72b646b055b82513c943cecd237430072
platforms			darwin
                    
depends_lib			port:db46 \
					port:openssl \
					port:pcre \
					port:gd2
                    
patchfiles          patch-src-files_operators.c.diff

post-patch {
	foreach manfile [glob ${worksrcpath}/docs/*.8] {
		reinplace "s|/usr/local|${prefix}|g" $manfile
		reinplace "s|/var/cfengine|${prefix}&|g" $manfile
	}
}

post-build {
	system "${worksrcpath}/libtool --finish ${prefix}/lib"
}

set cfworkdir		${prefix}/var/cfengine

configure.cflags	-I${prefix}/include/db46 -I${prefix}/include
configure.ldflags	-L${prefix}/lib/db46 -L${prefix}/lib
configure.args		--mandir='\${prefix}/share/man' \
					--infodir='\${prefix}/share/info' \
					--with-workdir="${cfworkdir}" \
					--with-berkeleydb=default \
					--with-openssl=${prefix} \
					--with-pcre=${prefix}


# vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
