# $Id: Portfile,v 1.3 2006/06/22 16:26:45 jwa Exp $

PortSystem 1.0
name		midgard-data
version		1.7.6
categories	www
maintainers	jwa@opendarwin.org
description	"A content management system"
long_description "Midgard is a content management system\
		platform using Apache, PHP and MySQL."
platforms	darwin
homepage	http://www.midgard-project.org/

master_sites	http://www.midgard-project.org/midcom-serveattachmentguid-98d06d15fc92b54c83ecce52676e1f01/

use_bzip2	yes
checksums	sha1 608a2e7b0515f2386a4d540d17fd4439990a4faa
depends_lib	port:midgard-core\
		port:midgard-apache2\
		port:midgard-php4\
		port:dialog\
		port:ImageMagick

patchfiles	midcom-template.xml.diff datagard.in.diff

post-extract	{
	reinplace "s/mysql\\(\[_a-z\]*\\)/mysql\\15/" ${worksrcpath}/configure
}

configure.args	--sysconfdir=${prefix}/etc/midgard/ \
		--with-mysql-config=${prefix}/bin/mysql_config5 \
		--with-apxs=${prefix}/apache2/bin/apxs \
		--with-apache-user=www \
		--with-apache-group=www

build	{}	

post-destroot	{
	reinplace "s/zcat/gzcat/" ${destroot}${prefix}/share/midgard/datagard/lib.postinst
	reinplace "s;/usr/bin/pear;${prefix}/bin/pear4;" ${destroot}${prefix}/share/midgard/datagard/datagard.conf
}

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