# $Id: Portfile,v 1.5 2006/03/13 22:30:47 mww Exp $

PortSystem 1.0

name			mt-daapd
version			0.2.4
categories		audio net
platforms		darwin
maintainers		mww@opendarwin.org
description		A multi-threaded DAAP server emulating an iTunes server.
long_description	${description}

homepage		http://www.mt-daapd.org/
master_sites	sourceforge
checksums		sha1 b8c242e5fd5d2d97010d5e09b9f02ccf9def13ab
patchfiles		patch-mt-daapd.conf

depends_lib		port:zlib port:gdbm port:libid3tag port:libogg port:libvorbis

configure.args	--enable-mdns --enable-oggvorbis
configure.env	CFLAGS="-I${prefix}/include" \
				CPPFLAGS="-I${prefix}/include" \
				LDFLAGS="-L${prefix}/lib"

post-destroot	{
	xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name} \
		${destroot}${prefix}/var/db/mt-daapd/ \
		${destroot}${prefix}/var/log

	xinstall -m 644 ${worksrcpath}/contrib/mt-daapd.conf \
		${destroot}${prefix}/etc/mt-daapd.conf.sample
	reinplace "s|__PREFIX__|${prefix}|g" \
		${destroot}${prefix}/etc/mt-daapd.conf.sample

	xinstall -m 644 ${worksrcpath}/contrib/mt-daapd.playlist \
		${destroot}${prefix}/etc/mt-daapd.playlist.sample
	destroot.keepdirs ${destroot}${prefix}/var/db/mt-daapd
	xinstall -c -m 644 /dev/null ${destroot}${prefix}/var/log/mt-daapd.log
	xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING CREDITS ChangeLog \
		INSTALL NEWS README TODO ${destroot}${prefix}/share/doc/${name}
}

platform darwin 8 {
	configure.env-append	CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 CXX=/usr/bin/g++-4.0
}
