# $Id: Portfile,v 1.3 2006/06/22 14:51:29 jwa Exp $

PortSystem 1.0
name		midgard-apache2
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-0209b731a09d364e70ac50bc150fc5f6/

use_bzip2	yes
checksums	sha1 86dd782f755b5618f44a61ebceacf9af6fac9bcb
depends_lib	port:midgard-core\
		port:apache2\
		port:apr\
		port:apr-util

configure.args	--sysconfdir=${prefix}/etc/midgard/ \
		--with-apxs=${prefix}/apache2/bin/apxs\
		--with-apr-config=${prefix}/bin/apr-1-config

pre-destroot {
	file mkdir ${destroot}${prefix}/apache2
	file mkdir ${destroot}${prefix}/apache2/conf/extra
	file mkdir ${destroot}${prefix}/apache2/modules
}

post-destroot	{
	xinstall -m 755 ${worksrcpath}/midgard.conf ${destroot}${prefix}/apache2/conf/extra
}

post-install {
	ui_msg "========================   IMPORTANT   ========================="
	ui_msg "Make sure the following exist in ${prefix}/apache2/conf/httpd.conf"
	ui_msg "In DSO Support section, i.e. LoadModule section"
	ui_msg "  LoadModule php4_module modules/libphp4.so"
	ui_msg "DirectoryIndex section"
	ui_msg "  DirectoryIndex to include index.php index.php4"
	ui_msg "AddType section"
	ui_msg "  AddType application/x-httpd-php .php"
	ui_msg "  AddType application/x-httpd-php-source .phps"
	ui_msg "In Supplemental configuration, add"
	ui_msg "  Include conf/extra/midgard.conf"
	ui_msg "================================================================"
}

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