# $Id: Portfile,v 1.4 2006/06/22 14:58:57 jwa Exp $

PortSystem 1.0
name		midgard-php4
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-d374a7e7de9825fa900291979d61b5b9/

use_bzip2	yes
checksums	sha1 8cd7a07c6055768ee4b4e861dc6e50569236c954
depends_lib	port:midgard-core\
		port:php4

patchfiles	patch-midgard.c
pre-configure	{ 
	cd ${worksrcpath}
	system "phpize4"
}
configure.env	EXTRA_LDFLAGS=" -m"
configure.args	--sysconfdir=${prefix}/etc/midgard/ \
		--with-apxs=${prefix}/apache2/bin/apxs\
		--with-apr-config=${prefix}/bin/apr-1-config\
		--with-php-config=${prefix}/bin/php-config4

destroot.destdir	INSTALL_ROOT=${destroot}

post-install {
	ui_msg "========================   IMPORTANT   ========================="
	ui_msg "If this is the first time you're installing Midgard, or you have"
	ui_msg "recently upgraded PHP, make sure to check your php.ini to verify"
	ui_msg "that extension_dir at least includes"
	system "php-config4 --extension-dir"
	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 EXTRA_LDFLAGS=" -m"
}
