Index: trunk/dports/www/abyss/Portfile
===================================================================
--- trunk/dports/www/abyss/Portfile	(revision 4507)
+++ trunk/dports/www/abyss/Portfile	(revision 4507)
@@ -0,0 +1,42 @@
+# $Id: Portfile,v 1.1 2004/01/07 09:21:00 pguyot Exp $
+
+PortSystem 1.0
+name			abyss
+version			0.3
+categories		www
+maintainers		pguyot@kallisys.net
+description		HTTP/1.1 compliant web server for
+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:abyss
+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
+}
+configure {}
+build { system "cd ${worksrcpath}/src/ && make" }
+
+depends_run	path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup
+
+destroot {
+	system "install -o root -m 0755 -p ${worksrcpath}/bin/abyss ${destroot}${prefix}/sbin/"
+	system "install -d -o nobody -m 0755 ${destroot}${prefix}/share/abyss/"
+	system "install -d -o nobody -m 0755 ${destroot}${prefix}/share/abyss/log/"
+	system "touch ${destroot}${prefix}/share/abyss/log/access.log"
+	system "install -d -o nobody -m 0755 ${destroot}${prefix}/share/abyss/conf/"
+	system "install -o root -m 0644 -p ${worksrcpath}/conf/* ${destroot}${prefix}/share/abyss/conf/"
+	system "install -d -o root -m 0755 ${destroot}${prefix}/share/abyss/htdocs/"
+	system "install -o root -m 0644 ${portpath}/files/index.html ${destroot}${prefix}/share/abyss/htdocs/"
+	system "install -o root -m 755 -d ${destroot}${prefix}/etc/rc.d"
+	system "install -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
+}
Index: trunk/dports/www/abyss/files/abyss.sh
===================================================================
--- trunk/dports/www/abyss/files/abyss.sh	(revision 4507)
+++ trunk/dports/www/abyss/files/abyss.sh	(revision 4507)
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+case "$1" in
+
+start)
+  if [ -f __PREFIX/share/abyss/abyss.pid ]; then
+    echo "abyss seems to be running with pid" `cat __PREFIX/share/abyss/abyss.pid`
+  else
+    __PREFIX/sbin/abyss -c __PREFIX/share/abyss/conf/abyss.conf >> __PREFIX/share/abyss/log/error.log 2>&1
+  fi
+  ;;
+
+stop)
+  if [ -f __PREFIX/share/abyss/abyss.pid ]; then
+    (kill QUIT `cat __PREFIX/share/abyss/abyss.pid`) 2> /dev/null > /dev/null
+    rm -f __PREFIX/share/abyss/abyss.pid
+  else
+    echo "abyss doesn't seem to be running (pid file not found)"
+  fi
+  ;;
+
+esac
Index: trunk/dports/www/abyss/files/index.html
===================================================================
--- trunk/dports/www/abyss/files/index.html	(revision 4507)
+++ trunk/dports/www/abyss/files/index.html	(revision 4507)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+	<title>abyss default index page</title>
+	<meta name="generator" content="BBEdit 7.1" />
+</head>
+<body>
+	<h3>abyss webserver default index page</h3>
+	<p>Congratulation on successfully installing and running <a href="http://abyss.sourceforge.net/">abyss</a> webserver.</p>
+	<p></p>
+	<p><small>This page is brought to you by the <a href="http://www.opendarwin.org/">OpenDarwin</a> project.</small></p>
+</body>
+</html>
Index: trunk/dports/www/abyss/files/patch-conf-abyss.conf
===================================================================
--- trunk/dports/www/abyss/files/patch-conf-abyss.conf	(revision 4507)
+++ trunk/dports/www/abyss/files/patch-conf-abyss.conf	(revision 4507)
@@ -0,0 +1,20 @@
+--- conf/abyss.conf	Fri Dec 12 00:07:27 2003
++++ conf/abyss.conf	Fri Dec 12 00:08:07 2003
+@@ -19,7 +19,7 @@
+ User nobody
+ 
+ # The Server Root (UNIX systems style)
+-ServerRoot /home/mahfoudh/abyss
++ServerRoot __PREFIX/share/abyss
+ 
+ # The Server Root (Win32 systems style)
+ # ServerRoot c:\abyss
+@@ -47,7 +47,7 @@
+ LogFile log/access.log
+ 
+ # The file where the pid of the server is logged (UNIX specific)
+-PidFile log/abyss.pid
++PidFile abyss.pid
+ 
+ # If AdvertiseServer if set to no, then no server field would be
+ # appended to the responses. This is the way to make the server
Index: trunk/dports/www/abyss/files/patch-src-conn.c
===================================================================
--- trunk/dports/www/abyss/files/patch-src-conn.c	(revision 4507)
+++ trunk/dports/www/abyss/files/patch-src-conn.c	(revision 4507)
@@ -0,0 +1,15 @@
+--- src/conn.c	Sun Feb 13 09:22:10 2000
++++ src/conn.c	Thu Jan  4 16:07:36 2001
+@@ -232,7 +232,12 @@
+ 					*(p++)=' ';
+ 					continue;
+ 				};
+-			};
++			} else {
++			    /* emk - 04 Jan 2001 - Bug fix to leave buffer
++			    ** pointing at start of body after reading blank
++			    ** line following header. */
++			    p=t;
++			}
+ 
+ 			c->bufferpos+=p+1-*z;
Index: trunk/dports/www/abyss/files/patch-src-data.c
===================================================================
--- trunk/dports/www/abyss/files/patch-src-data.c	(revision 4507)
+++ trunk/dports/www/abyss/files/patch-src-data.c	(revision 4507)
@@ -0,0 +1,11 @@
+--- src/data.c	Thu Dec 11 16:53:30 2003
++++ src/data.c	Thu Dec 11 16:53:40 2003
+@@ -32,7 +32,7 @@
+ **
+ *******************************************************************************/
+ 
+-#include <malloc.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include "abyss.h"
+ 
Index: trunk/dports/www/abyss/files/patch-src-server.c
===================================================================
--- trunk/dports/www/abyss/files/patch-src-server.c	(revision 4507)
+++ trunk/dports/www/abyss/files/patch-src-server.c	(revision 4507)
@@ -0,0 +1,39 @@
+--- src/server.c	Thu Dec 11 16:56:57 2003
++++ src/server.c	Thu Dec 11 17:01:52 2003
+@@ -36,12 +36,14 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <time.h>
++
+ #ifdef _WIN32
+ #include <io.h>
+ #else
+-/* Check this
+-#include <sys/io.h>
+-*/
++#include <sys/types.h>
++#include <sys/socket.h>
++#include <netinet/in.h>
++#include <arpa/inet.h>
+ #endif	/* _WIN32 */
+ #include <fcntl.h>
+ #include "abyss.h"
+@@ -803,9 +805,18 @@
+ 	if (strlen(s->requestline)>1024-26-50)
+ 		s->requestline[1024-26-50]='\0';
+ 
++#ifdef _WIN32
+ 	n=sprintf(z,"%d.%d.%d.%d - %s - [",s->conn->peerip.S_un.S_un_b.s_b1,
+ 		s->conn->peerip.S_un.S_un_b.s_b2,s->conn->peerip.S_un.S_un_b.s_b3,
+ 		s->conn->peerip.S_un.S_un_b.s_b4,(s->user?s->user:""));
++#else
++	{
++		char theIPString[256];
++		(void) inet_ntop( AF_INET, &s->conn->peerip, theIPString, 256 );
++
++		n=sprintf(z,"%s - %s - [",theIPString,(s->user?s->user:""));
++	}
++#endif
+ 
+ 	DateToLogString(&s->date,z+n);
+ 
