# $Id: Portfile,v 1.1 2004/09/24 00:28:16 landonf Exp $

PortSystem 1.0
name			jetty
version			4.2.22
platforms		darwin
categories		www java
maintainers		landonf@opendarwin.org
description		Java HTTP Servlet Server
homepage		http://www.mortbay.org/jetty/
long_description	Jetty is a 100% Java HTTP Server and Servlet \
			Container. Jetty is a fully featured web server for \
			static and dynamic content. Unlike separate \
			server/container solutions, this means that your web \
			server and web application run in the same process, \
			without interconnection overheads and complications. \
			Furthermore, as a pure java component, Jetty can be \
			simply included in your application for \
			demonstration, distribution or deployment.

master_sites		sourceforge \
			ftp://jetty.mortbay.com/pub/

distname		${name}-${version}-all
worksrcdir		${name}-${version}

checksums		md5 9d376acd3dd39dc3b8ef51fe55ad554d

patchfiles		patch-bin-jetty.sh

set javadest "${prefix}/share/java/${name}-${version}"

post-patch {
			reinplace "s|@JETTY_HOME@|${javadest}|g" ${worksrcpath}/bin/jetty.sh
			reinplace "s|@JETTY_RUN@|${prefix}/var/run|g" ${worksrcpath}/bin/jetty.sh
}

configure {}

build {}

destroot {
			file mkdir "${destroot}${javadest}"
			file mkdir "${destroot}${prefix}/share/doc"
#			file copy "${worksrcpath}/javadoc" "${destroot}${prefix}/share/doc/jetty"
			file copy "${worksrcpath}/lib" "${destroot}${javadest}/"
			file copy "${worksrcpath}/ext" "${destroot}${javadest}/"
			file copy "${worksrcpath}/etc" "${destroot}${javadest}/"
			file copy "${worksrcpath}/start.jar" "${destroot}${javadest}/"
			file copy "${worksrcpath}/stop.jar" "${destroot}${javadest}/"
			file copy "${worksrcpath}/webapps" "${destroot}${javadest}/"
			file copy "${worksrcpath}/bin" "${destroot}${javadest}/"
			system "cd ${destroot}${prefix}/sbin/ && ln -s ../share/java/${name}-${version}/bin/jetty.sh jetty"
			file attributes ${destroot}${javadest}/bin/jetty.sh -permissions a+x
}
