diff -ur yaws.orig/Portfile yaws/Portfile
--- yaws.orig/Portfile	2009-11-11 15:17:56.000000000 +0200
+++ yaws/Portfile	2009-11-09 10:40:18.000000000 +0200
@@ -2,7 +2,7 @@
 
 PortSystem			1.0
 name				yaws
-version				1.76
+version				1.85
 categories			www
 maintainers			nomaintainer
 platforms			darwin
@@ -12,9 +12,9 @@
 					code. Yaws also features a built-in Wiki.
 homepage			http://yaws.hyber.org/
 master_sites		http://yaws.hyber.org/download/
-checksums			md5 c6072c4dc6664fa8be88e12baa458eaf \
-					sha1 a2517bc95bde181561a2214329f5fcc80ded3c38 \
-					rmd160 8107c46d7b4b34e1662e7aa585f2722da1d021b2
+checksums			md5 6941ea52638805246973bf94fd6e9a52 \
+					sha1 2d6bd52af002f356d6738900a67550c5531a0b4a \
+					rmd160 5be8e85019aade9d7e2213b981f27cc59995aecc
 
 depends_build		port:erlang
 
@@ -53,16 +53,16 @@
 post-destroot {
 	xinstall -d "${destroot}${prefix}/var/log/yaws/"
 	system "touch ${destroot}${prefix}/var/log/yaws/.turd"
-	file rename "${destroot}${prefix}/etc/yaws.conf" "${destroot}${prefix}/etc/yaws.conf.template"
+	file rename "${destroot}${prefix}/etc/yaws/yaws.conf" "${destroot}${prefix}/etc/yaws/yaws.conf.template"
 }
 
 post-install {
-	ui_msg "Copy and customize ${prefix}/etc/yaws.conf.template to ${prefix}/etc/yaws.conf"
+	ui_msg "Copy and customize ${prefix}/etc/yaws/yaws.conf.template to ${prefix}/etc/yaws/yaws.conf"
 }
 
 startupitem.create	yes
 startupitem.name	yaws
-startupitem.start	"${prefix}/bin/yaws --daemon --heart --conf ${prefix}/etc/yaws.conf"
+startupitem.start	"${prefix}/bin/yaws --daemon --heart --conf ${prefix}/etc/yaws/yaws.conf"
 startupitem.stop	"${prefix}/bin/yaws --stop"
 
 livecheck.type	regex
diff -ur yaws.orig/files/patch-man-yaws.1 yaws/files/patch-man-yaws.1
--- yaws.orig/files/patch-man-yaws.1	2009-11-11 15:17:56.000000000 +0200
+++ yaws/files/patch-man-yaws.1	2009-11-09 10:23:15.000000000 +0200
@@ -1,16 +1,14 @@
---- man/yaws.1.orig	2006-04-28 04:25:10.000000000 +0900
-+++ man/yaws.1	2006-07-22 17:37:47.000000000 +0900
-@@ -39,9 +39,10 @@
+--- man/yaws.1.orig	2009-11-09 10:01:46.000000000 +0200
++++ man/yaws.1	2009-11-09 10:01:51.000000000 +0200
+@@ -54,9 +54,9 @@
  .TP
  \fB\--conf file\fR
  Use a different configuration file than the default. The default configuration file
--when running as root is /etc/yaws.conf. When running as a non priviliged user, yaws
--will search for its configuration file in the following order. First in
--$HOME/yaws.conf, then in ./yaws.conf and finally in /etc/yaws.conf
-+when running as root is __PREFIX/etc/yaws.conf. When running as a non
-+priviliged user, yaws will search for its configuration file in the following order.
-+First in $HOME/yaws.conf, then in ./yaws.conf and
-+finally in __PREFIX/etc/yaws.conf
+-when running as root is /etc/yaws/yaws.conf. When running as a non priviliged user, yaws
++when running as root is __PREFIX/etc/yaws/yaws.conf. When running as a non priviliged user, yaws
+ will search for its configuration file in the following order. First in
+-$HOME/yaws.conf, then in ./yaws.conf and finally in /etc/yaws/yaws.conf
++$HOME/yaws.conf, then in ./yaws.conf and finally in __PREFIX/etc/yaws/yaws.conf
  .TP
  \fB\--runmod module\fR
  Tells yaws to call \fImodule:start/0\fR at startup. This makes it possible
diff -ur yaws.orig/files/patch-man-yaws.conf.5 yaws/files/patch-man-yaws.conf.5
--- yaws.orig/files/patch-man-yaws.conf.5	2009-11-11 15:17:56.000000000 +0200
+++ yaws/files/patch-man-yaws.conf.5	2009-11-09 10:23:26.000000000 +0200
@@ -1,96 +1,25 @@
---- man/yaws.conf.5.orig	2008-04-03 23:27:18.000000000 +0200
-+++ man/yaws.conf.5	2008-04-13 22:13:23.000000000 +0200
+--- man/yaws.conf.5.orig	2009-11-09 10:02:37.000000000 +0200
++++ man/yaws.conf.5	2009-11-09 10:03:31.000000000 +0200
 @@ -1,6 +1,6 @@
  .TH YAWS.CONF "5" "" "" "User Commands"
  .SH NAME
--/etc/yaws.conf \- Configuration file for the yaws webserver
-+__PREFIX/etc/yaws.conf \- Configuration file for the yaws webserver
+-/etc/yaws/yaws.conf \- Configuration file for the yaws webserver
++__PREFIX/etc/yaws/yaws.conf \- Configuration file for the yaws webserver
  .SH DESCRIPTION
  .\" Add any additional description here
  .PP
-@@ -506,11 +506,11 @@
- The following example defines a single server on port 80.
- .nf
- 
--logdir = /var/log/yaws
-+logdir = __PREFIX/var/log/yaws
- <server www.mydomain.org>
-         port = 80
-         listen = 192.168.128.31
--        docroot = /var/yaws/www
-+        docroot = __PREFIX/var/yaws/www
- </server>
- .fi
- 
-@@ -519,17 +519,17 @@
- 
- .nf
- 
--logdir = /var/log/yaws
-+logdir = __PREFIX/var/log/yaws
- <server www.mydomain.org>
-         port = 80
-         listen = 192.168.128.31
--        docroot = /var/yaws/www
-+        docroot = __PREFIX/var/yaws/www
- </server>
- 
- <server www.funky.org>
-         port = 80
-         listen = 192.168.128.31
--        docroot = /var/yaws/www_funky_org
-+        docroot = __PREFIX/var/yaws/www_funky_org
- </server>
- 
- 
-@@ -543,7 +543,7 @@
- <server www.mydomain.org>
-         port = 80
-         listen = 192.168.128.31
--        docroot = /var/yaws/www
-+        docroot = __PREFIX/var/yaws/www
-         access_log = false
-         <auth>
-             dir = secret/dir1
-@@ -568,7 +568,7 @@
- <server www.funky.org>
-         port = 80
-         listen = 192.168.128.31
--        docroot = /var/yaws/www_funky_org
-+        docroot = __PREFIX/var/yaws/www_funky_org
-         start_mod = btt
+@@ -698,7 +698,7 @@
+                 dir = secret/dir1
+         </auth>
          <opaque>
-                 mydbdir = /tmp
-@@ -618,14 +618,14 @@
- 
- .nf
- 
--logdir = /var/log/yaws
-+logdir = __PREFIX/var/log/yaws
- max_num_cached_files = 8000
- max_num_cached_bytes = 6000000
- 
- <server www.mydomain.org>
-         port = 80
-         listen = 192.168.128.31
--        docroot = /var/yaws/www
-+        docroot = __PREFIX/var/yaws/www
- </server>
- 
- 
-@@ -633,16 +633,16 @@
- <server www.funky.org>
-         port = 80
-         listen = 192.168.128.31
--        docroot = /var/yaws/www_funky_org
-+        docroot = __PREFIX/var/yaws/www_funky_org
+-                keytab = /etc/yaws/http.keytab
++                keytab = __PREFIX/etc/yaws/http.keytab
+         </opaque>
  </server>
  
- <server www.funky.org>
-         port = 443
+@@ -740,8 +740,8 @@
          listen = 192.168.128.32
--        docroot = /var/yaws/www_funky_org
-+        docroot = __PREFIX/var/yaws/www_funky_org
+         docroot = /var/yaws/www_funky_org
          <ssl>
 -           keyfile = /etc/funky.key
 -           certfile = /etc/funky.cert
diff -ur yaws.orig/files/patch-man-yaws_api.5 yaws/files/patch-man-yaws_api.5
--- yaws.orig/files/patch-man-yaws_api.5	2009-11-11 15:17:56.000000000 +0200
+++ yaws/files/patch-man-yaws_api.5	2009-11-09 10:23:38.000000000 +0200
@@ -1,13 +1,11 @@
---- man/yaws_api.5.orig	2008-02-14 17:57:23.000000000 +0100
-+++ man/yaws_api.5	2008-04-13 22:17:31.000000000 +0200
-@@ -312,8 +312,8 @@
+--- man/yaws_api.5.orig	2009-11-09 10:04:05.000000000 +0200
++++ man/yaws_api.5	2009-11-09 10:04:21.000000000 +0200
+@@ -379,7 +379,7 @@
  .TP
  \fBsetconf(Gconf, Groups)\fR
  This function is intended for embedded mode in yaws. It makes it possible
 -to load a yaws configuration from another data source than /etc/yaws.conf, such
--as a database. 
-+to load a yaws configuration from another data source than
-+__PREFIX/etc/yaws.conf, such as a database. 
++to load a yaws configuration from another data source than __PREFIX/etc/yaws.conf, such
+ as a database.
  If yaws is started with the environment \fI{embedded, true}\fR, yaws will
  start with an empty default configuration, and wait for some other
- program to execute a \fIsetconf/2\fR
diff -ur yaws.orig/files/patch-scripts-Install yaws/files/patch-scripts-Install
--- yaws.orig/files/patch-scripts-Install	2009-11-11 15:17:56.000000000 +0200
+++ yaws/files/patch-scripts-Install	2009-11-09 10:24:27.000000000 +0200
@@ -1,38 +1,38 @@
---- scripts/Install.orig	2007-09-07 14:33:43.000000000 +0200
-+++ scripts/Install	2008-04-13 22:15:56.000000000 +0200
-@@ -36,58 +36,58 @@
+--- scripts/Install.orig	2009-11-09 10:04:44.000000000 +0200
++++ scripts/Install	2009-11-09 10:08:54.000000000 +0200
+@@ -37,58 +37,58 @@
  
  ## seems gentoo don't like to be installed in /usr/local/etc
  ## since /sbin/runscript still reads /etc/conf.d
 -if [ -f /etc/gentoo-release ]; then
--    install -d ${destdir}/${etcdir}/init.d/
--    install -d ${destdir}/${etcdir}/conf.d/
--    install -d ${destdir}/${vardir}/run/yaws
--    chmod a+rwx ${destdir}/${vardir}/run/yaws
+-    install -d ${destdir}${etcdir}/init.d/
+-    install -d ${destdir}${etcdir}/conf.d/
+-    install -d ${destdir}${vardir}/run/yaws
+-    chmod a+rwx ${destdir}${vardir}/run/yaws
 -    sed -e  "s;%prefix%;$p;g"  \
--	-e "s;%etcdir%;$e;g" gentoo/init.d.yaws > ${destdir}/${etcdir}/init.d/yaws
--    chmod +x ${destdir}/${etcdir}/init.d/yaws
+-	-e "s;%etcdir%;$e;g" gentoo/init.d.yaws > ${destdir}${etcdir}/init.d/yaws
+-    chmod +x ${destdir}${etcdir}/init.d/yaws
 -elif [ -f /etc/redhat-release ]; then
--    install -d ${destdir}/${etcdir}/init.d
+-    install -d ${destdir}${etcdir}/init.d
 -    sed -e "s;%prefix%;$p;g" \
--	-e "s;%etcdir%;$e;g" redhat/yaws.init.d >  ${destdir}/${etcdir}/init.d/yaws
--    chmod +x ${destdir}/${etcdir}/init.d/yaws
--    install -d ${destdir}/${vardir}/run/yaws
--    chmod a+rwx ${destdir}/${vardir}/run/yaws
+-	-e "s;%etcdir%;$e;g" redhat/yaws.init.d >  ${destdir}${etcdir}/init.d/yaws
+-    chmod +x ${destdir}${etcdir}/init.d/yaws
+-    install -d ${destdir}${vardir}/run/yaws
+-    chmod a+rwx ${destdir}${vardir}/run/yaws
 -elif [ -f /etc/suseservers ]; then
--    install -d ${destdir}/${etcdir}/init.d
+-    install -d ${destdir}${etcdir}/init.d
 -    sed -e "s;%prefix%;$p;g" \
--	-e "s;%etcdir%;$e;g" suse/yaws.init.d/ > ${destdir}/${etcdir}/init.d/yaws
--    chmod +x ${destdir}/${etcdir}/init.d/yaws
--    install -d ${destdir}/${vardir}/run/yaws
--    chmod a+rwx ${destdir}/${vardir}/run/yaws
+-	-e "s;%etcdir%;$e;g" suse/yaws.init.d/ > ${destdir}${etcdir}/init.d/yaws
+-    chmod +x ${destdir}${etcdir}/init.d/yaws
+-    install -d ${destdir}${vardir}/run/yaws
+-    chmod a+rwx ${destdir}${vardir}/run/yaws
 -elif [ -f /etc/debian_version ]; then
--    install -d ${destdir}/${etcdir}/init.d
+-    install -d ${destdir}${etcdir}/init.d
 -    sed -e "s;%prefix%;$p;g" \
--	-e "s;%etcdir%;$e;g" debian/yaws.init.d >  ${destdir}/${etcdir}/init.d/yaws
--    chmod +x ${destdir}/${etcdir}/init.d/yaws
--    install -d ${destdir}/${vardir}/run/yaws
--    chmod a+rwx ${destdir}/${vardir}/run/yaws
+-	-e "s;%etcdir%;$e;g" debian/yaws.init.d >  ${destdir}${etcdir}/init.d/yaws
+-    chmod +x ${destdir}${etcdir}/init.d/yaws
+-    install -d ${destdir}${vardir}/run/yaws
+-    chmod a+rwx ${destdir}${vardir}/run/yaws
 -
 -elif [ "`uname -s`" = "Darwin" -a `id -u` = 0 ]; then
 -     startupdir="/Library/StartupItems/Yaws"
@@ -48,43 +48,43 @@
 -      # MacOS is particular about the ownership of startup items.
 -     chown -R root:wheel ${startupdir}
 -elif [ "`uname -s`" = "FreeBSD" ]; then
--    sed -e "s;%prefix%;$p;g" -e "s;%etcdir%;$e;g" freebsd/yaws.sh > ${destdir}/${etcdir}/rc.d/yaws.sh
+-    sed -e "s;%prefix%;$p;g" -e "s;%etcdir%;$e;g" freebsd/yaws.sh > ${destdir}${etcdir}/rc.d/yaws.sh
 -elif [ "`uname -s`" = "NetBSD" ]; then
 -    sed -e "s;%prefix%;$p;g" -e "s;%etcdir%;$e;g" netbsd/yaws.sh > /etc/rc.d/yaws
 -else    
--    install -d ${destdir}/${etcdir} 
+-    install -d ${destdir}${etcdir} 
 -    echo "Don't know how to make /etc/init scrips for this system"
 -    echo "possibly add ${prefix}/bin/yaws --daemon --heart to your /etc/rc.local manually"
 -fi
 +# if [ -f /etc/gentoo-release ]; then
-+#     install -d ${destdir}/${etcdir}/init.d/
-+#     install -d ${destdir}/${etcdir}/conf.d/
-+#     install -d ${destdir}/${vardir}/run/yaws
-+#     chmod a+rwx ${destdir}/${vardir}/run/yaws
++#     install -d ${destdir}${etcdir}/init.d/
++#     install -d ${destdir}${etcdir}/conf.d/
++#     install -d ${destdir}${vardir}/run/yaws
++#     chmod a+rwx ${destdir}${vardir}/run/yaws
 +#     sed -e  "s;%prefix%;$p;g"  \
-+# 	-e "s;%etcdir%;$e;g" gentoo/init.d.yaws > ${destdir}/${etcdir}/init.d/yaws
-+#     chmod +x ${destdir}/${etcdir}/init.d/yaws
++# 	-e "s;%etcdir%;$e;g" gentoo/init.d.yaws > ${destdir}${etcdir}/init.d/yaws
++#     chmod +x ${destdir}${etcdir}/init.d/yaws
 +# elif [ -f /etc/redhat-release ]; then
-+#     install -d ${destdir}/${etcdir}/init.d
++#     install -d ${destdir}${etcdir}/init.d
 +#     sed -e "s;%prefix%;$p;g" \
-+# 	-e "s;%etcdir%;$e;g" redhat/yaws.init.d >  ${destdir}/${etcdir}/init.d/yaws
-+#     chmod +x ${destdir}/${etcdir}/init.d/yaws
-+#     install -d ${destdir}/${vardir}/run/yaws
-+#     chmod a+rwx ${destdir}/${vardir}/run/yaws
++# 	-e "s;%etcdir%;$e;g" redhat/yaws.init.d >  ${destdir}${etcdir}/init.d/yaws
++#     chmod +x ${destdir}${etcdir}/init.d/yaws
++#     install -d ${destdir}${vardir}/run/yaws
++#     chmod a+rwx ${destdir}${vardir}/run/yaws
 +# elif [ -f /etc/suseservers ]; then
-+#     install -d ${destdir}/${etcdir}/init.d
++#     install -d ${destdir}${etcdir}/init.d
 +#     sed -e "s;%prefix%;$p;g" \
-+# 	-e "s;%etcdir%;$e;g" suse/yaws.init.d/ > ${destdir}/${etcdir}/init.d/yaws
-+#     chmod +x ${destdir}/${etcdir}/init.d/yaws
-+#     install -d ${destdir}/${vardir}/run/yaws
-+#     chmod a+rwx ${destdir}/${vardir}/run/yaws
++# 	-e "s;%etcdir%;$e;g" suse/yaws.init.d/ > ${destdir}${etcdir}/init.d/yaws
++#     chmod +x ${destdir}${etcdir}/init.d/yaws
++#     install -d ${destdir}${vardir}/run/yaws
++#     chmod a+rwx ${destdir}${vardir}/run/yaws
 +# elif [ -f /etc/debian_version ]; then
-+#     install -d ${destdir}/${etcdir}/init.d
++#     install -d ${destdir}${etcdir}/init.d
 +#     sed -e "s;%prefix%;$p;g" \
-+# 	-e "s;%etcdir%;$e;g" debian/yaws.init.d >  ${destdir}/${etcdir}/init.d/yaws
-+#     chmod +x ${destdir}/${etcdir}/init.d/yaws
-+#     install -d ${destdir}/${vardir}/run/yaws
-+#     chmod a+rwx ${destdir}/${vardir}/run/yaws
++# 	-e "s;%etcdir%;$e;g" debian/yaws.init.d >  ${destdir}${etcdir}/init.d/yaws
++#     chmod +x ${destdir}${etcdir}/init.d/yaws
++#     install -d ${destdir}${vardir}/run/yaws
++#     chmod a+rwx ${destdir}${vardir}/run/yaws
 +# 
 +# elif [ "`uname -s`" = "Darwin" -a `id -u` = 0 ]; then
 +#      startupdir="/Library/StartupItems/Yaws"
@@ -100,11 +100,11 @@
 +#       # MacOS is particular about the ownership of startup items.
 +#      chown -R root:wheel ${startupdir}
 +# elif [ "`uname -s`" = "FreeBSD" ]; then
-+#     sed -e "s;%prefix%;$p;g" -e "s;%etcdir%;$e;g" freebsd/yaws.sh > ${destdir}/${etcdir}/rc.d/yaws.sh
++#     sed -e "s;%prefix%;$p;g" -e "s;%etcdir%;$e;g" freebsd/yaws.sh > ${destdir}${etcdir}/rc.d/yaws.sh
 +# elif [ "`uname -s`" = "NetBSD" ]; then
 +#     sed -e "s;%prefix%;$p;g" -e "s;%etcdir%;$e;g" netbsd/yaws.sh > /etc/rc.d/yaws
 +# else    
-+#     install -d ${destdir}/${etcdir} 
++#     install -d ${destdir}${etcdir} 
 +#     echo "Don't know how to make /etc/init scrips for this system"
 +#     echo "possibly add ${prefix}/bin/yaws --daemon --heart to your /etc/rc.local manually"
 +# fi
diff -ur yaws.orig/files/patch-scripts-Makefile yaws/files/patch-scripts-Makefile
--- yaws.orig/files/patch-scripts-Makefile	2009-11-11 15:17:56.000000000 +0200
+++ yaws/files/patch-scripts-Makefile	2009-11-09 10:24:54.000000000 +0200
@@ -1,7 +1,7 @@
---- scripts/Makefile.orig	Wed Sep 29 13:27:28 2004
-+++ scripts/Makefile	Wed Sep 29 13:27:48 2004
+--- scripts/Makefile.orig	2009-11-09 10:08:37.000000000 +0200
++++ scripts/Makefile	2009-11-09 10:10:14.000000000 +0200
 @@ -1,3 +1,5 @@
-+.PHONY	: install
++.PHONY : install
 +
  include ../include.mk
  
diff -ur yaws.orig/files/patch-scripts-yaws.conf.template yaws/files/patch-scripts-yaws.conf.template
--- yaws.orig/files/patch-scripts-yaws.conf.template	2009-11-11 15:17:56.000000000 +0200
+++ yaws/files/patch-scripts-yaws.conf.template	2009-11-11 15:07:44.000000000 +0200
@@ -1,5 +1,5 @@
---- scripts/yaws.conf.template.orig	2008-03-10 19:09:22.000000000 +0100
-+++ scripts/yaws.conf.template	2008-04-13 22:22:43.000000000 +0200
+--- scripts/yaws.conf.template.orig	2009-11-11 12:59:41.000000000 +0200
++++ scripts/yaws.conf.template	2009-11-11 13:08:39.000000000 +0200
 @@ -15,7 +15,7 @@
  # beam code can be placed. The daemon will add this
  # directory to its search path
@@ -16,23 +16,65 @@
 -include_dir = %yawsdir%/examples/include
 +include_dir = %yawsdir%/include
  
+ # Set this to an integer value to control
+ # max number of connections from clients into the server
+@@ -123,34 +123,34 @@
+         appmods = <cgi-bin, yaws_appmod_cgi>        
+ </server>
+ 
+-<server localhost>
+-        port = %port%
+-        listen = 0.0.0.0
+-        docroot = /tmp
+-        dir_listings = true
+-        statistics = true
+-        <auth>
+-                realm = foobar
+-                dir = /
+-                user = foo:bar
+-                user = baz:bar
+-        </auth>
+-</server>
+-
++# <server localhost>
++#         port = %port%
++#         listen = 0.0.0.0
++#         docroot = __PREFIX/tmp
++#         dir_listings = true
++#         statistics = true
++#         <auth>
++#                 realm = foobar
++#                 dir = /
++#                 user = foo:bar
++#                 user = baz:bar
++#         </auth>
++# </server>
  
  
-@@ -131,7 +131,7 @@
- <server localhost>
-         port = %port%
-         listen = 0.0.0.0
--        docroot = /tmp
-+        docroot = __PREFIX/tmp
-         dir_listings = true
-         <auth>
-                 realm = foobar
-@@ -147,7 +147,7 @@
+-# And then an ssl server
  
- <server %host%>
-         port = %sslport%
+-<server %host%>
+-        port = %sslport%
 -        docroot = /tmp
-+        docroot = __PREFIX/tmp
-         listen = 0.0.0.0
-         dir_listings = true
-         <ssl>  
+-        listen = 0.0.0.0
+-        dir_listings = true
+-        <ssl>  
+-                keyfile = %certdir%/yaws-key.pem
+-                certfile = %certdir%/yaws-cert.pem
+-        </ssl>
+-</server>
++# # And then an ssl server
++# 
++# <server %host%>
++#         port = %sslport%
++#         docroot = __PREFIX/tmp
++#         listen = 0.0.0.0
++#         dir_listings = true
++#         <ssl>  
++#                 keyfile = %certdir%/yaws-key.pem
++#                 certfile = %certdir%/yaws-cert.pem
++#         </ssl>
++# </server>
+                                 
+         
+ 
