# $Id: Portfile,v 1.2 2005/04/21 15:58:22 jberry Exp $

PortSystem 1.0

name			dokuwiki
version			2004-11-02
categories		www
platforms		darwin
maintainers		mww@opendarwin.org
description		simple to use wiki aimed at documentation projects
long_description	dokuwiki is a simple to use wiki aimed at a small \
				companies documentation needs. It works on plain texts files \
				and thus needs no database. It has a simple but powerful \
				syntax which makes sure the datafiles remain readable outside \
				the Wiki.

homepage		http://www.splitbrain.org/Programming/PHP/DokuWiki/
master_sites	${homepage}
extract.suffix	.tgz
checksums		md5 6a26abbae28f774cd142ee0582cd1b78

depends_run		port:apache2 \
				port:php4

use_configure	no

build			{}

destroot	{
	xinstall -m 755 -d ${destroot}${prefix}/apache2/htdocs \
		${destroot}${prefix}/share ${destroot}${prefix}/var/${name}
	system "cd ${destroot}${prefix}/apache2/htdocs/ \
		&& ln -sf ${prefix}/share/${name}"
	file copy ${worksrcpath} ${destroot}${prefix}/share/${name}
	file rename ${destroot}${prefix}/share/${name}/attic \
		${destroot}${prefix}/var/${name}/attic
	file rename ${destroot}${prefix}/share/${name}/data \
		${destroot}${prefix}/var/${name}/data
	file rename ${destroot}${prefix}/share/${name}/media \
		${destroot}${prefix}/var/${name}/media
	system "touch ${destroot}${prefix}/var/${name}/attic/.turd"
	system "touch ${destroot}${prefix}/var/${name}/data/.turd"
	system "touch ${destroot}${prefix}/share/${name}/changes.log"
	system "cd ${destroot}${prefix}/share/${name}/ \
		&& ln -s ${prefix}/var/${name}/data \
		&& ln -s ${prefix}/var/${name}/attic \
		&& ln -s ${prefix}/var/${name}/media"
	system "chown -R www:www ${destroot}${prefix}/var/${name} \
		${destroot}${prefix}/share/${name}/changes.log"
}
