# $Id$

PortSystem 1.0

name			abyss
version			0.3
categories		www
license			BSD
maintainers		nomaintainer
description		Light HTTP/1.1 compliant web server.
long_description	\
				ABYSS aims to be a fully HTTP/1.1 compliant web server. \
				Its main design goals are speed, low resource usage and \
				portability. ABYSS works on most UNIX based systems and \
				on Win32 systems (Win95/98/2000/NT).
homepage		http://abyss.sourceforge.net/
platforms		darwin
master_sites	sourceforge:project/abyss/abyss/${version}
checksums		md5 ca2dc7618e17dae8eea23c02dd3bbf9d
patchfiles		patch-src-data.c patch-src-server.c patch-conf-abyss.conf patch-src-conn.c
	worksrcdir		${name}
post-patch {
	reinplace "s|__PREFIX|${prefix}|g" ${worksrcpath}/conf/abyss.conf
}
use_configure	no
build { system "cd ${worksrcpath}/src/ && make" }

destroot {
	xinstall -o root -m 0755 -p "${worksrcpath}/bin/abyss" "${destroot}${prefix}/sbin/"
	xinstall -d -o nobody -m 0755 "${destroot}${prefix}/share/abyss/"
	xinstall -d -o nobody -m 0755 "${destroot}${prefix}/share/abyss/log/"
	system "touch ${destroot}${prefix}/share/abyss/log/access.log"
	xinstall -d -o nobody -m 0755 ${destroot}${prefix}/share/abyss/conf/"
	xinstall -o root -m 0644 -p "${worksrcpath}/conf/abyss.conf" \
		"${destroot}${prefix}/share/abyss/conf/"
	xinstall -o root -m 0644 -p "${worksrcpath}/conf/mime.types" \
	 	"${destroot}${prefix}/share/abyss/conf/"
	xinstall -d -o root -m 0755 "${destroot}${prefix}/share/abyss/htdocs/"
	xinstall -o root -m 0644 "${portpath}/files/index.html" \
		"${destroot}${prefix}/share/abyss/htdocs/"
	xinstall -o root -m 755 -d "${destroot}${prefix}/etc/rc.d"
	xinstall -o root -m 755 -c \
		"${portpath}/files/abyss.sh" "${destroot}${prefix}/etc/rc.d"
	reinplace "s|__PREFIX|${prefix}|g" \
		"${destroot}${prefix}/etc/rc.d/abyss.sh"
}

startupitem.create	yes
startupitem.name	abyss
startupitem.pidfile	"clean ${prefix}/share/abyss/abyss.pid"
startupitem.start	"${prefix}/etc/rc.d/abyss.sh start"
startupitem.stop	"${prefix}/etc/rc.d/abyss.sh start"