# $Id: Portfile,v 1.1 2004/08/30 18:25:52 mww Exp $

PortSystem 1.0

name			pserv
version			3.0
categories		www
platforms		darwin
maintainers		mww@opendarwin.org
description		Pico Server is a small web server.
long_description	${description}

homepage		http://pserv.sourceforge.net/
master_sites	sourceforge
extract.suffix	.tar.Z
checksums		md5 2c38f859631ab09f3cd4ff15b4de457e
patchfiles		patch-main.h \
				patch-Makefile

worksrcdir		pserv

use_configure	no

build.dir		${worksrcpath}/sources
build.args		PREFIX=${prefix}
build.target

destroot	{
	xinstall -m 755 ${worksrcpath}/sources/pserv \
		${destroot}${prefix}/sbin
	xinstall -m 755 -d ${destroot}${prefix}/var/www/ \
		${destroot}${prefix}/share/pserv/ \
		${destroot}${prefix}/etc/pserv/ \
		${destroot}${prefix}/var/log/pserv
	xinstall -m 644 ${worksrcpath}/defaults/index.html \
		${destroot}${prefix}/var/www
	xinstall -m 644 ${worksrcpath}/defaults/mime_types.dat \
		${destroot}${prefix}/share/pserv/
	xinstall -m 644 ${filespath}/pserv.conf \
		${destroot}${prefix}/etc/pserv/
	reinplace "s|__PREFIX__|${prefix}|g" \
		${destroot}${prefix}/etc/pserv/pserv.conf
	system "touch ${destroot}${prefix}/var/log/pserv/pserv.log"
}
