# $Id: Portfile 63918 2010-02-18 02:49:58Z markd@macports.org $

PortSystem 1.0

name			syslog-ng
version			3.0.5
categories		sysutils
platforms		darwin
maintainers		markd
description		Highly configurable syslog replacement.
long_description	syslog-ng is the world's most flexible and scalable audit \
					trail processing tool for organizations of any size. It \
					provides a centralised, securely stored log of all devices \
					on your network, whatever platform they run on. And \
					syslog-ng also incorporates a host of powerful features, \
					including filtering based on message content, as well as \
					customisable data mining and analysis capabilities.

homepage			http://www.balabit.com/products/syslog_ng/
master_sites			http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/${version}/source/
checksums			md5 28f0d9ff2243b330e8cd6311ef9b2f12
distfiles			${name}_${version}${extract.suffix}
patchfiles			patch-src-Makefile.in.diff

depends_build			path:bin/pkg-config:pkgconfig
depends_lib			port:eventlog \
				port:libnet11 \
				path:lib/pkgconfig/glib-2.0.pc:glib2

startupitem.create      yes
startupitem.executable  ${prefix}/sbin/syslog-ng

configure.args		--mandir=${prefix}/share/man \
			--enable-dynamic-linking \
			--sysconfdir=${prefix}/etc

platform powerpc	{
	configure.args-append		--host=powerpc
}

post-destroot	{
	xinstall -m 644 ${worksrcpath}/doc/examples/syslog-ng.conf.sample \
		${destroot}${prefix}/etc
	xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
	xinstall -m 644 -W ${worksrcpath} ChangeLog README AUTHORS COPYING NEWS \
		${destroot}${prefix}/share/doc/${name}
	reinplace "s|/dev/log|/var/run/syslog|g" \
		${destroot}${prefix}/etc/syslog-ng.conf.sample
}

post-activate {
ui_msg "\n

To use syslog-ng, first unload OS X's built-in syslog daemon:

	sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.syslogd.plist

Then customize ${prefix}/etc/syslog-ng.conf and load syslog-ng:

	sudo launchctl load -w /Library/LaunchDaemons/org.macports.syslog-ng.plist
\n"
}
