diff -ruN zope.orig/z2.py zope/z2.py
--- zope.orig/z2.py     Thu Feb 27 07:53:08 2003
+++ zope/z2.py  Sat Jan 10 20:48:04 2004
@@ -1,3 +1,4 @@
+#! @PREFIX@/bin/python2.3
 ##############################################################################
 #
 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
@@ -243,6 +244,9 @@
     sys.path.insert(4, '%s/bin/lib/win32/lib' % swhome)
     sys.path.insert(5, '%s' % swhome)
 
+# fink setup
+import sys
+sys.path.insert(0, '@PREFIX@/lib/zope/lib/python')
 
 import os, sys, getopt, codecs, string
 import socket
@@ -254,7 +258,9 @@
 sys.setcheckinterval(500)
 
 program=sys.argv[0]
-here=os.path.join(os.getcwd(), os.path.split(program)[0])
+#here=os.path.join(os.getcwd(), os.path.split(program)[0])
+here="@PREFIX@/lib/zope"
+os.chdir(here)
 
 ########################################################################
 # Configuration section
@@ -274,7 +280,10 @@
 # User id to run ZServer as. Note that this only works under Unix, and if
 # ZServer is started by root. This no longer defaults to 'nobody' since
 # that can lead to a Zope file compromise.
-UID=None
+# UID=None
+## For fink, this has been changed from 'nobody' to 'www'
+## which is also the apache web user
+UID='www'
 
 # Log file location. If this is a relative path, then it is joined the
 # the 'var' directory.
diff -ruN zope.orig/zope-z2.8 zope/zope-z2.8
--- zope.orig/zope-z2.8	Thu Jan  1 01:00:00 1970
+++ zope/zope-z2.8	Wed Apr 24 18:46:45 2002
@@ -0,0 +1,134 @@
+.TH zope-z2 8
+.SH NAME
+zope-z2 \- The Zope 2 ZServer
+.SH SYNOPSIS
+.B zope-z2
+\fI[options]\fP \fI[environment settings]\fP
+.SH DESCRIPTION
+.B zope-z2
+is the script that starts up a Zope 2 ZServer process. You can modify
+the configuration of the ZServer process with various command line
+options. Depending on the options, zope-z2 will detach the Zope process
+from the terminal, and zope-z2 will return after the process was started.
+.
+.SH OPTIONS
+.TP 12
+.BI \-h
+Print a help message.
+.TP
+.BI "-z " path
+The location of the Zope installation.
+On Debian systems, this is /usr/lib/zope.
+.TP
+.BI "\-Z " path
+[Unix only! This option is ignored on Windows.]
+If this option is specified, a separate management process will
+be created that restarts the Zope process after a shutdown (or crash).
+The process will record its process id in the file path. If path
+is a relative path, it will be used relative to the Zope location.
+.
+To prevent use of a separate management process, provide an
+empty string (-Z '').
+.TP
+.BI "\-t " n
+The number of threads to use, if ZODB3 is used. The default is 4.
+.TP
+.BI \-D
+Run in Zope debug mode.  This causes the Zope process not to
+detach from the controlling terminal, and is equivalent to
+supplying the environment variable setting Z_DEBUG_MODE=1.
+.TP
+.BI "\-a " ipaddress
+The IP address to listen on.  If this is an empty string
+(e.g. -a ''), then Zope listens to all addresses of the machine. The
+default is ''.
+.TP
+.BI "\-d " ipaddress
+The IP address of your DNS server. If you don't provide a DNS server
+(i.e. -d ''), then IP addresses will not be resolved into host names.
+If you have a DNS service on your local machine then you can set this
+to 127.0.0.1. The default is: ''.
+.TP
+.BI "\-u " username/uid
+The username to run ZServer as. You may want to run ZServer as 'www-data'
+or some other user with limited resouces. The only works under Unix, and
+if ZServer is started by root. The default (on Debian systems)
+is 'www-data'.
+.TP
+.BI "\-P " number
+Set the web, ftp and monitor port numbers simultaneously
+as offsets from the number. The web port number will be number+80.
+The FTP port number will be number+21. The monitor port number will
+be number+99.
+.TP
+.BI "\-w " port
+The Web server (HTTP) port. If this is an empty string (e.g. -w ''),
+then HTTP is disabled. The standard port for HTTP services is 80.
+The default is 8080.
+.TP
+.BI "\-f " port
+The FTP port.  If this is an empty string (e.g. -f ''), then FTP
+is disabled.  The standard port for FTP services is 21.  The
+default is 8021.
+.TP
+.BI "\-m " port
+The secure monitor server port. If this is an empty string
+(-m ''), then the monitor server is disabled. The monitor server
+allows interactive Python style access to a running ZServer. To
+access the server see medusa/monitor_client.py or
+medusa/monitor_client_win32.py. The monitor server password is the
+same as the Zope superuser password set in the 'access'
+file. The default is 8089.
+.TP
+.BI "\-p " path
+Path to the PCGI resource file.  If this is an empty string (-p '')
+or the file does not exist, then PCGI is disabled. If this is no absolute
+path, than it's relative to the Zope location. For Debian, the default
+value is '/usr/lib/cgi-bin/Zope'.
+.TP
+.BI "\-F " path_or_port
+Either a port number (for inet sockets) or a path name (for unix
+domain sockets) for the FastCGI Server. If the flag and value are
+not specified then the FastCGI Server is disabled.
+.TP
+.BI "\-l " path
+Path to the ZServer log file. If this is a relative path then the
+log file will be written to the 'var' directory. The default is
+'Z2.log'. 
+.TP
+.BI \-r
+Run ZServer is read-only mode. ZServer won't write anything to disk.
+No log files, no pid files, nothing. This means that you can't do a
+lot of stuff like use PCGI, and zdaemon. ZServer will log hits to
+STDOUT and zLOG will log to STDERR.
+.TP
+.BI \-L
+Enable locale (internationalization) support. The value passed for
+this option should be the name of the locale to be used (see your
+operating system documentation for locale information specific to
+your system). If an empty string is passed for this option (-L ''),
+Zope will set the locale to the user's default setting (typically
+specified in the $LANG environment variable). If your Python
+installation does not support the locale module, the requested
+locale is not supported by your system or an empty string was
+passed but no default locale can be found, an error will be raised
+and Zope will not start.
+.PP
+Finally, you can provide a list of environment settings in the
+form NAME=VALUE.
+.
+.SH AUTHOR
+zope-z2 is derived with little modifications from the z2.py script
+included in the Zope distribution.
+Zope and z2.py were written by Digital Creations.
+Zope is distributed under the terms of the Zope Public License
+(see the zope-zpasswd file or /usr/share/doc/zope/copyright on Debian systems).
+.PP
+The modifications to zope-z2 and the zope-z2 manual page were
+written by Gregor Hoffleit <flight@debian.org> for the Debian project.
+Feel free to use, copy and modify the manpage.
+
+The zopectl script and this manual page were written by Gregor Hoffleit
+<flight@debian.org> for the Debian project. Feel free to use, copy and
+modify.
+.
diff -ruN zope.orig/zope-zpasswd.8 zope/zope-zpasswd.8
--- zope.orig/zope-zpasswd.8	Thu Jan  1 01:00:00 1970
+++ zope/zope-zpasswd.8	Wed Apr 24 18:47:17 2002
@@ -0,0 +1,55 @@
+.TH zope-zpasswd 8
+.SH NAME
+zope-zpasswd \- Create a Zope superuser password file
+.SH SYNOPSIS
+.B zope-zpasswd \fI[-u username -p password [-e encoding] [-d domains]]\fP passwdfile
+.SH DESCRIPTION
+.B zope-zpasswd
+is an utility to create a Zope password file ('access') for the
+superuser account in Zope.
+.PP
+.B zope-zpasswd
+will create a file \fIpasswdfile\fP with a single line with two or three
+fields separated by colons:
+\fIusername\fP:\fIencrypted password\fP[:\fIdomainlist\fP]
+If this file is named `access' and put in the INSTANCE_HOME directory
+of a Zope instance, Zope will use \fIusername\fP and \fIpassword\fP as
+values for the superuser (administrator) account of that instance.
+.
+.SH OPTIONS
+\fIpasswdfile\fP is a required option in any case. Normally, you will
+want to name the file `access'.
+.PP
+If you don't provide any other options on the command line, zope-zpasswd
+will start in interactive mode and prompt you for all necessary information.
+.PP
+.TP 12
+.BI \-u, \-\-username
+Username used for the Zope superuser. In interactive mode, the default is
+`superuser'.
+.TP
+.BI \-p, \-\-password
+Password for the Zope superuser. If you don't specify encoding `cleartext',
+the password will be saved encrypted.
+.TP
+.BI \-e, \-\-encoding
+The encryption/encoding scheme to be used for the password. Possible
+values are SHA, CRYPT or CLEARTEXT. If you don't provide this option,
+SHA will be used. This is also the default in interactive mode.
+.TP
+.BI \-d, \-\-domains
+The list of domains the superuser can log in from. An empty string ("")
+means any domain is allowed. This is also the default in interactive mode.
+If you want to provide multiple domains, the names must be separated by
+spaces and enclosed in quotes.
+.
+.SH AUTHOR
+zope-zpasswd is derived with little modifications from the zpasswd.py
+script included in the Zope distribution.
+Zope and zpasswd.py were written by Digital Creations.
+Zope is distributed under the terms of the Zope Public License
+(see the zope-zpasswd file or /usr/share/doc/zope/copyright on Debian systems).
+.PP
+The modifications to zope-passwd and the zope-zpasswd manual page were
+written by Gregor Hoffleit <flight@debian.org> for the Debian project.
+Feel free to use, copy and modify the manpage.
diff -ruN zope.orig/zope.cnf zope/zope.cnf
--- zope.orig/zope.cnf	Thu Jan  1 01:00:00 1970
+++ zope/zope.cnf	Wed Apr 24 18:46:51 2002
@@ -0,0 +1,9 @@
+#
+# You might want to modify the following settings (the defaults are
+# valid for the fink Zope installation):
+#
+ZOPE_HOME=@PREFIX@/lib/zope
+INSTANCE_HOME=@PREFIX@/var/lib/zope
+# if you want to add additional options uncomment the following line
+#ZOPEOPTS="-P 9000"
+
diff -ruN zope.orig/zopectl.8 zope/zopectl.8
--- zope.orig/zopectl.8	Thu Jan  1 01:00:00 1970
+++ zope/zopectl.8	Wed Apr 24 18:47:45 2002
@@ -0,0 +1,61 @@
+.TH zopectl 8
+.SH NAME
+zopectl \- A Zope ZServer control script
+.SH SYNOPSIS
+.B zopectl 
+[-I INSTANCE_HOME_DIRECTORY] \fI(start|stop|restart|force-reload|status)\fP [...]
+.SH DESCRIPTION
+.B zopectl
+is an utility to start, stop, restart and examine a Zope application. 
+It is a replacement for Zope's start and stop scripts.
+.PP
+.B NOTE: 
+If your Zope installation uses non-standard paths and/or if you want to
+run multiple Zope instances, you can specify the INSTANCE_HOME environment
+variable to the
+.B zopectl
+script by using the -I option.
+.PP
+The 
+.B zopectl
+script returns a 0 exit value on success, and >0 if an error 
+occurs.  For more details, view the comments in the script.
+.
+.SH OPTIONS
+The \fIcommand\fP can be any one of the following options:
+.TP 12
+.BI start
+Start the Zope zdaemon process.  Gives an error if it is already running.
+Additional parameters will be given to z2.py when it's started.
+.TP
+.BI stop
+Stops the Zope zdaemon process. This is equivalent to the "Shutdown"
+button in the Zope Control Panel.
+.TP
+.BI restart
+Restarts the Zope process controlled by the zdaemon. This is equivalent
+to the "Restart" button in the Zope Control Panel.
+If the zdaemon is not running, it is started.
+Note that this doesn't restart zdaemon! If you need to restart zdaemon
+as well, use force-reload.
+.TP
+.BI force-reload
+Restarts zdaemon as well.
+.TP
+.BI status
+Displays the current status of the zdaemon and z2 processes.
+.
+.SH BUGS
+The process handling is not completely robust. E.g. "zopectl restart"
+and immediately "zopectl stop" will leave you with an single z2 process.
+Handle with care and be patient.
+.
+.SH SEE ALSO
+.BR zope-z2 (8)
+.BR zope-zpasswd (8)
+.
+.SH AUTHOR
+The zopectl script and this manual page were written by Gregor Hoffleit
+<flight@debian.org> for the Debian project. Feel free to use, copy and
+modify.
+.
diff -ruN zope.orig/zpasswd.py zope/zpasswd.py
--- zope.orig/zpasswd.py	Wed Apr 24 18:49:18 2002
+++ zope/zpasswd.py	Thu Apr 25 03:00:11 2002
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#! @PREFIX@/bin/python2.3
 ##############################################################################
 #
 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
diff -ruN zope.orig/zopectl zope/zopectl
--- zope.orig/zopectl	Wed Dec 31 16:00:00 1969
+++ zope/zopectl	Sun Jan 11 00:15:53 2004
@@ -0,0 +1,195 @@
+#!/bin/sh
+#
+# @PREFIX@/sbin/zopectl
+#
+# Written by Gregor Hoffleit <flight@debian.org> for the Debian Zope package.
+# Modified for fink by Kilian Koepsell <kilian@users.sourceforge.net>
+#
+# License: Feel free to use, share and modify this code as you like.
+#
+#
+# This is a comfortable replacement for Zope's start and stop scripts
+# It let's you start, stop, restart and examine a Zope process 
+#
+
+# include local settings
+. @PREFIX@/etc/zope/zope.cnf
+
+# include fink path of python
+PATH=@PREFIX@/bin:$PATH                        
+export PATH
+
+if [ `whoami` != "root" ]
+then
+    echo
+    echo 'Only root is allowed to start/stop zope!'
+    echo 'Usage: sudo zopectl start/stop'
+    echo 
+    exit 1
+fi
+
+if [ "$1" = "-I" ]
+then
+    shift
+    if [ -z "$1" ]; then
+        echo >&1 "usage: zopectl [ -I <instance home> ]"
+        exit 1
+    fi
+    INSTANCE_HOME="$1"
+    shift
+fi
+
+zope_pidfile=$INSTANCE_HOME/var/Z2.pid
+zope_logfile=$INSTANCE_HOME/var/Z2.log
+
+OPTION=$1
+shift
+
+
+export INSTANCE_HOME
+
+test_zope() {
+    if [ -f $zope_pidfile ]; then
+        echo >> $zope_pidfile
+        zope_pid=`cat $zope_pidfile | cut -d' ' -f2`
+	if [ ! "x$zope_pid" = "x" ] && kill -0 $zope_pid 2>/dev/null; then
+	    zope=1
+	    true
+	else
+	    zope=-1
+	    false
+	fi
+    else
+        zope=0
+	false
+    fi
+}
+
+waitfor_zope() {
+    timeout=100
+    test_zope
+	while [ $timeout -gt 0 -a ! $zope -eq 1 ]; do
+	    sleep 1
+	    echo -n '.'
+	    test_zope
+	    timeout=`expr $timeout - 1`
+	done
+    if [ $zope -eq 1 ]; then
+        true
+    else
+        false
+    fi
+}
+
+start_zope() {
+    @PREFIX@/sbin/zope-z2 $ZOPEOPTS $@
+}
+
+
+stop_zope() {
+    test_zope
+    if [ $zope -eq 1 ]; then
+        kill $zope_pid 2>/dev/null && true
+        test_zope
+        if [ $zope -eq -1 ]; then
+            rm -f $zope_pidfile
+        fi
+    else
+        if [ $zope -eq -1 ]; then
+            rm -f $zope_pidfile
+	    echo "Removed stale z2 pidfile (pid $zope_pid)."
+        fi
+    fi
+}
+
+
+
+case $OPTION in
+
+status)
+    test_zope
+        if [ $zope -eq 1 ]; then
+            echo "Zope running (pid=$zope_pid)."
+	else
+	    echo "Zope not running."
+	fi
+    ;;
+
+start)
+    test_zope
+    echo -n "Starting Zope..."
+    if [ ! $zope -eq 1 ]; then
+        start_zope $@
+        if waitfor_zope; then
+            echo " done."
+        else
+            echo " failed."
+            false
+        fi
+    else
+        if [ $zope -eq 1 ]; then
+	    echo " done (Zope already running)."
+	fi
+    fi
+    ;;
+
+stop)
+    echo -n "Stopping Zope..."
+    test_zope
+    if [ $zope -eq 0 ]; then
+        echo " done (Zope was not running)."
+	not_running=1
+    else
+        not_running=0
+    fi
+    test_zope
+    if [ $zope -eq 1 ]; then
+        stop_zope
+	#echo -n " [z2 process killed (pid $zope_pid)]"
+    else
+        if [ $zope -eq -1 ]; then
+	    rm -f $zope_pidfile
+	    echo -n " [removed stale z2 pidfile (pid $zope_pid)]"
+	fi
+    fi
+    sleep 2
+    if [ $not_running -eq 0 ]; then
+        echo " done."
+    fi
+    ;;
+
+restart)
+    test_zope
+    if [ ! $zope -eq 1 ]; then
+	 echo -n "Starting Zope..."
+         start_zope
+         waitfor_zope
+         echo " done."
+    else
+        if [ $zope -eq 1 ]; then
+	    echo -n "Restarting Zope..."
+	    stop_zope
+            sleep 3
+            start_zope $@
+            if waitfor_zope; then
+                echo " done."
+            else
+                echo " failed."
+                false
+            fi
+        else
+	    echo "Zope is currently restarting (or something's very strange)."
+	fi
+    fi
+    ;;
+
+force-reload)
+    @PREFIX@/sbin/zopectl stop || true
+    @PREFIX@/sbin/zopectl start $@ || true
+    ;;
+
+*)
+    echo "Usage: $0 (start|stop|restart|force-reload|status)"
+    ;;
+
+esac
