--- javaserver-5.1.orig/debian/patches/log4j.patch
+++ javaserver-5.1/debian/patches/log4j.patch
@@ -0,0 +1,13 @@
+--- src/com/zzo/javaserver/Log.java.orig
++++ src/com/zzo/javaserver/Log.java
+@@ -61,7 +61,9 @@
+ 		    new Class[] { Class.forName("java.lang.Class")});
+ 	    log = getLogger.invoke(null, new Object[] { Log.class } );
+ 	} catch (Exception e) {
+-	    log = new Debug();
++	    // Debug is not included in the JavaServer source distribution!
++	    // log = new Debug();
++	    System.err.println("Unable to get logging functions: install Apache package log4j");
+ 	}
+ 
+ 	// whatever the heck it is - don't matter
--- javaserver-5.1.orig/debian/compat
+++ javaserver-5.1/debian/compat
@@ -0,0 +1 @@
+4
--- javaserver-5.1.orig/debian/rules
+++ javaserver-5.1/debian/rules
@@ -0,0 +1,81 @@
+#!/usr/bin/make -f
+# debian/rules file for javaserver
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+PACKAGE	= $(shell dh_listpackages)
+TMP	= $(CURDIR)/debian/$(PACKAGE)
+JAVAC	= /usr/bin/jikes-sablevm
+JAR	= /usr/bin/fastjar
+
+VERSION=$(shell awk '/^[^ ]/ { version=substr($$2,2,match($$2,"-|.$$")-2); version=substr(version,index(version,":")+1); print version; exit }' debian/changelog)
+
+build: build-stamp
+build-stamp:
+	dh_testdir
+	for patch in debian/patches/*; do patch -p0 < $$patch; done
+	cd src && CLASSPATH=com/zzo/javaserver $(JAVAC) com/zzo/javaserver/JavaServer.java
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	find src -name \*.class -exec rm {} \;
+	rm -f src/javaserver.jar
+	if [ -e build-stamp ]; then for patch in debian/patches/*; do patch -p0 -R < $$patch; done; fi
+	dh_clean build-stamp install-stamp
+
+install: install-stamp
+install-stamp: build-stamp
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+
+#	Add here more commands to install the package into $(TMP)
+	dh_installdirs
+	echo "# DO NOT EDIT OR REMOVE" > $(TMP)/etc/javaserver/classpath.d/.placeholder
+	echo "# This file is a simple placeholder to keep dpkg from removing this directory" >> $(TMP)/etc/javaserver/classpath.d/.placeholder
+	cp -p $(TMP)/etc/javaserver/classpath.d/.placeholder $(TMP)/etc/javaserver/java-opts.d/.placeholder
+	echo "-Dlog4j.configuration=file:/etc/javaserver/log4j.conf" > $(TMP)/etc/javaserver/java-opts.d/javaserver
+	install -m 644 debian/log4j.conf $(TMP)/etc/javaserver
+	install -m 644 debian/javaserver.conf $(TMP)/usr/share/javaserver/javaserver.conf
+	install -m 755 debian/javaserver.sh $(TMP)/usr/sbin/javaserver
+	cd src && $(JAR) cf $(TMP)/usr/share/java/javaserver-$(VERSION).jar com/zzo/javaserver/*.class
+	dh_link usr/share/java/javaserver-$(VERSION).jar usr/share/java/javaserver.jar
+	pod2man --section=8 --release="$(VERSION)" --center="JavaServer Daemon" debian/javaserver.pod > $(TMP)/usr/share/man/man8/javaserver.8
+
+	touch install-stamp
+
+binary-indep: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs
+	dh_installdocs
+#	dh_installexamples
+#	dh_installmenu
+	dh_installdebconf
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installcatalogs
+#	dh_installpam
+#	dh_installmime
+	dh_installinit
+#	dh_installcron
+#	dh_installinfo
+#	dh_undocumented
+	dh_installman
+	dh_link
+	dh_compress
+	dh_fixperms
+#	dh_perl
+#	dh_python
+	dh_installdeb
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary-arch: build install
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary
--- javaserver-5.1.orig/debian/control
+++ javaserver-5.1/debian/control
@@ -0,0 +1,17 @@
+Source: javaserver
+Section: net
+Priority: optional
+Maintainer: Ken Neighbors <ken@nsds.com>
+Standards-Version: 3.6.1
+Build-Depends-Indep: debhelper (>= 4), jikes-sablevm, fastjar, perl
+
+Package: javaserver
+Architecture: all
+Depends: ${misc:Depends}, ucf, sablevm | java-virtual-machine, sablevm | java2-runtime | java-runtime, liblog4j1.2-java
+Suggests: libjava-perl
+Description: Server daemon for Perl and C to call Java classes
+ This daemon provides a remotely scriptable Java Virtual Machine which
+ can be called from Perl and C clients.  You can create objects, call
+ functions, access fields, deal with arrays, get events, etc.
+ .
+ See http://sourceforge.net/projects/javaserver/
--- javaserver-5.1.orig/debian/log4j.conf
+++ javaserver-5.1/debian/log4j.conf
@@ -0,0 +1,38 @@
+# Configuration file for logging by JavaServer with log4j.
+#
+# Specify the level of logging (DEBUG, INFO, WARN, ERROR, or FATAL)
+# and a list of appenders you want to use (null, file, and syslog are
+# defined below).  See http://www.vipan.com/htdocs/log4jhelp.html
+#
+log4j.rootCategory=INFO, null
+
+#
+# The default is the null appender (no logging).
+#
+log4j.appender.null=org.apache.log4j.varia.NullAppender
+
+#
+# Here is a setup for logging to a temporary file which might be
+# helpful for debugging (set the rootCategory level above to DEBUG).
+#
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.File=/tmp/javaserver.log
+log4j.appender.file.ImmediateFlush=true
+log4j.appender.file.Append=false
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{ISO8601} %c{2}: [%t] %p %x- %m%n
+
+#
+# To use the syslog appender it is necessary that the syslog daemon
+# (syslogd) be started with the "-r" option so that it will listen on
+# the network (which is how SyslogAppender talks to syslogd).  On Debian
+# with SysV-style init, you can set this option in /etc/init.d/sysklogd.
+# Please be aware of the security issues related to providing syslog
+# service remotely with the "-r" option (e.g., denial-of-service).  For
+# more information refer to the manual page for syslogd.
+#
+log4j.appender.syslog=org.apache.log4j.net.SyslogAppender
+log4j.appender.syslog.layout=org.apache.log4j.PatternLayout
+log4j.appender.syslog.layout.ConversionPattern=%c{2}: [%t] %p %x- %m%n
+log4j.appender.syslog.SyslogHost=localhost
+log4j.appender.syslog.Facility=DAEMON
--- javaserver-5.1.orig/debian/copyright
+++ javaserver-5.1/debian/copyright
@@ -0,0 +1,24 @@
+This package was debianized by Ken Neighbors <ken@nsds.com> on
+Sat, 1 Oct 2005 10:54:00 -0700.
+
+It was obtained from http://sourceforge.net/projects/javaserver/.
+
+The upstream author is: Mark Ethan Trostler <mark@zzo.com>.
+
+Copyright (c) 2000-2003 Mark Ethan Trostler
+
+All Rights Reserved. This module is free software.  It may be used,
+redistributed and/or modified under the terms of the Perl Artistic
+License or the GNU Lesser General Public License.
+
+On Debian GNU/Linux systems, the complete text of the Artistic License
+can be found in `/usr/share/common-licenses/Artistic' and the GNU
+Lesser General Public License in `/usr/share/common-licenses/LGPL'.
+
+The javaserver wrapper script author is: Ken Neighbors <ken@nsds.com>.
+
+Copyright (c) 2005 Ken Neighbors <ken@nsds.com>
+
+All Rights Reserved.  This shell script is free software.  It may be
+used, redistributed and/or modified under the terms of the Perl
+Artistic License or the GNU Lesser General Public License.
--- javaserver-5.1.orig/debian/javaserver.init
+++ javaserver-5.1/debian/javaserver.init
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+set -e
+
+DAEMON=/usr/sbin/javaserver
+PIDFILE=/var/run/javaserver.pid
+
+test -x $DAEMON || exit 0
+
+JAVASERVER_START=true
+JAVASERVER_DIRECTORY=/usr/share/javaserver/empty/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z
+JAVASERVER_USER=javaserv
+JAVASERVER_GROUP=javaserv
+JAVASERVER_UMASK=002
+JAVASERVER_PORT=2000
+JAVASERVER_DISPLAY=
+[ -f /etc/default/javaserver ] && . /etc/default/javaserver
+if [ "$JAVASERVER_START" != "true" -a "$1" != "stop" ]; then
+    echo "Not starting Java Server: disabled in /etc/default/javaserver"
+    exit 0;
+fi
+if [ -z "$JAVASERVER_DISPLAY" ]; then
+    unset DISPLAY
+    JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"
+    export JAVA_OPTS
+else
+    DISPLAY=$JAVASERVER_DISPLAY
+    export DISPLAY
+fi
+START_OPTS="--start --startas $DAEMON --chdir $JAVASERVER_DIRECTORY --chuid $JAVASERVER_USER --group $JAVASERVER_GROUP --background --make-pidfile"
+DAEMON_OPTS="--umask=$JAVASERVER_UMASK --classpath-from=/etc/javaserver/classpath.d --java-opts-from=/etc/javaserver/java-opts.d --authfile=/etc/javaserver/authfile $JAVASERVER_PORT"
+STOP_OPTS="--stop --oknodo"
+
+case "$1" in
+  start)
+	echo -n "Starting Java Server: javaserver"
+	start-stop-daemon --quiet --pidfile $PIDFILE $START_OPTS -- $DAEMON_OPTS
+	echo "."
+	;;
+  stop)
+	echo -n "Stopping Java Server: javaserver"
+	start-stop-daemon --quiet --pidfile $PIDFILE $STOP_OPTS
+	echo "."
+	;;
+  restart|force-reload)
+	echo -n "Restarting Java Server: javaserver..."
+	start-stop-daemon --quiet --pidfile $PIDFILE $STOP_OPTS
+	sleep 1
+	start-stop-daemon --quiet --pidfile $PIDFILE $START_OPTS -- $DAEMON_OPTS
+	echo "done."
+	;;
+  *)
+	echo "Usage: /etc/init.d/javaserver {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
--- javaserver-5.1.orig/debian/javaserver.cron.weekly
+++ javaserver-5.1/debian/javaserver.cron.weekly
@@ -0,0 +1,12 @@
+#!/bin/sh
+# /etc/cron.weekly/javaserver
+
+# Cron script to restart JavaServer weekly to avoid memory leaks or
+# other problems that may occur due to Java programs staying resident
+# too long.
+
+set -e
+
+[ -x /etc/init.d/javaserver ] || exit
+
+/usr/sbin/invoke-rc.d javaserver restart > /dev/null
--- javaserver-5.1.orig/debian/javaserver.pod
+++ javaserver-5.1/debian/javaserver.pod
@@ -0,0 +1,119 @@
+=head1 NAME
+
+javaserver - wrapper to start the JavaServer backend
+
+=head1 SYNOPSIS
+
+B<javaserver>
+[B<--debug-wrapper>]
+[B<--umask>=I<umask>]
+[B<--classpath-from>=I<directory-or-file>]
+[B<--java-opts-from>=I<directory-or-file>]
+[B<--authfile>=I<authfile>]
+[B<port>]
+[B<--help>]
+
+=head1 DESCRIPTION
+
+B<javaserver> starts the JavaServer backend.  It will listen for
+requests from a frontend.  For example, the Java.pm frontend links
+Perl and Java classes so they can call each another.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<--debug-wrapper>
+
+Show step-by-step how CLASSPATH and JAVA_OPTS are constructed.  Also
+shows the umask and the final command which gets executed.
+
+=item B<--umask>=I<umask>
+
+Set the umask before starting the JavaServer backend.
+
+=item B<--classpath-from>=I<directory-or-file>
+
+By default, the environment variable CLASSPATH is inherited from its
+current setting and any jar files needed by JavaServer are added to
+the beginning of the inherited value.  By setting the
+B<--classpath-from> option, additional CLASSPATHs are read from a file
+or from a group of files in a directory, where one CLASSPATH is
+defined per line in each file.  These CLASSPATHS will be added to the
+end of the inherited value.  This option may be repeated to read
+multiple directories and/or files.
+
+=item B<--java-opts-from>=I<directory-or-file>
+
+By default, the environment variable JAVA_OPTS is inherited from its
+current setting and these options are passed to Java.  By setting the
+B<--java-opts-from> option, additional options are read from a file or
+from a group of files in a directory.  The options will be added to
+the end of the inherited value.  You can define options on separate
+lines for readability if you wish--they will automatically be
+concatenated and separated with spaces.  The --java-opts-from option
+may be repeated to read multiple directories and/or files.
+
+=item B<--authfile>=I<authfile>
+
+Specify the authfile.  The first line of this file is used as a shared
+secret between the backend and the frontend.
+
+=item I<port>
+
+By default, the JavaServer backend runs on port 2000.  You can specify
+a different port with this option.
+
+=item B<--help>
+
+Show a very short help message.
+
+=back
+
+=head1 EXAMPLES
+
+All on one line:
+
+JAVA_OPTS=-Dlog4j.configuration=file:/etc/javaserver/log4j.conf
+javaserver --classpath-from=/etc/javaserver/classpath.d
+--java-opts-from=/etc/javaserver/java-opts.d
+--authfile=/etc/javaserver/authfile 8000 &
+
+=head1 ENVIRONMENT
+
+=over 4
+
+=item CLASSPATH
+
+The value of an existing CLASSPATH environment variable is inherited
+and placed I<after> any CLASSPATHs required by the JavaServer.
+Futhermore, any additional CLASSPATHs defined by the
+B<--classpath-from> option will be placed I<after> the existing
+CLASSPATH.  That is, the CLASSPATH will be constructed in this order:
+
+  CLASSPATHs required by JavaServer
+  existing CLASSPATH
+  CLASSPATHs read from files defined by --classpath-from
+
+=item JAVA_OPTS
+
+The options in this environment variable are passed to java.
+Specifically, JavaServer will be invoked with the following line:
+
+  java $JAVA_OPTS com.zzo.javaserver.JavaServer I<command line options>
+
+Futhermore, any additional Java options defined by the
+B<--java-opts-from> option will be placed I<after> the existing
+JAVA_OPTS.
+
+=back
+
+=head1 AUTHOR
+
+javaserver program: Mark Ethan Trostler <mark@zzo.com>
+
+wrapper and manual page: Ken Neighbors <ken@nsds.com>
+
+=head1 SEE ALSO
+
+L<Java.pm|Java>
--- javaserver-5.1.orig/debian/javaserver.sh
+++ javaserver-5.1/debian/javaserver.sh
@@ -0,0 +1,164 @@
+#!/bin/sh
+# Command line wrapper for running JavaServer.
+# Copyright (c) 2005 Ken Neighbors <ken@nsds.com>
+# All Rights Reserved.  This shell script is free software.  It may be
+# used, redistributed and/or modified under the terms of the Perl
+# Artistic License or the GNU Lesser General Public License.
+
+# Location of JAR files required by JavaServer.
+JAVASERVER_CLASSPATH=/usr/share/java/javaserver.jar:/usr/share/java/log4j-1.2.jar
+
+# Parse command line arguments, looking for --debug-wrapper, --umask,
+# --classpath-from, and --java-opts-from.  Any other arguments are
+# saved in JAVASERVER_OPTS to be passed to the JavaServer program.
+DEBUG_WRAPPER=
+UMASK=
+CLASSPATH_FROM=
+JAVA_OPTS_FROM=
+JAVASERVER_OPTS=
+while [ $# -gt 0 ]; do
+    case "$1" in
+	--debug-wrapper)
+	    DEBUG_WRAPPER="true"
+	    shift
+	    ;;
+	--umask)
+	    UMASK=$2
+	    shift
+	    shift
+	    ;;
+	--umask=*)
+	    UMASK=${1#--umask=}
+	    shift
+	    ;;
+	--classpath-from)
+	    CLASSPATH_FROM="$CLASSPATH_FROM $2"
+	    CLASSPATH_FROM=${CLASSPATH_FROM%/} # remove trailing slash
+	    shift
+	    shift
+	    ;;
+	--classpath-from=*)
+	    CLASSPATH_FROM="$CLASSPATH_FROM ${1#--classpath-from=}"
+	    CLASSPATH_FROM=${CLASSPATH_FROM%/} # remove trailing slash
+	    shift
+	    ;;
+	--java-opts-from)
+	    JAVA_OPTS_FROM="$JAVA_OPTS_FROM $2"
+	    JAVA_OPTS_FROM=${JAVA_OPTS_FROM%/} # remove trailing slash
+	    shift
+	    shift
+	    ;;
+	--java-opts-from=*)
+	    JAVA_OPTS_FROM="$JAVA_OPTS_FROM ${1#--java-opts-from=}"
+	    JAVA_OPTS_FROM=${JAVA_OPTS_FROM%/} # remove trailing slash
+	    shift
+	    ;;
+	--help)
+	    cat <<EOF
+Wrapper script usage:
+javaserver [--debug-wrapper] [--umask=<umask>]
+[--classpath-from=<directory-or-file>]
+[--java-opts-from=<directory-or-file>]
+[--authfile=<authfile>] [<port>] [--help]
+
+Help provided by JavaServer program:
+EOF
+	    CLASSPATH=$JAVASERVER_CLASSPATH
+	    export CLASSPATH
+	    exec java com.zzo.javaserver.JavaServer --help
+	    ;;
+	*)
+	    JAVASERVER_OPTS="$JAVASERVER_OPTS $1"
+	    shift
+	    ;;
+    esac
+done
+
+# Set umask.
+if [ -n "$DEBUG_WRAPPER" ]; then
+    UMASK_OLD=`umask`
+    if [ -n "$UMASK" ]; then
+	echo >&2 "Changing umask from $UMASK_OLD to $UMASK"
+    else
+	echo >&2 "Leaving umask at $UMASK_OLD"
+    fi
+fi
+if [ -n "$UMASK" ]; then
+    umask $UMASK
+fi
+
+# The following function reads all lines from a file and adds each
+# line to VARIABLE, separated by the character specified as the second
+# argument.  If a directory is given as the first argument, then this
+# function processes each file in that directory which is listed by
+# the run-parts command.
+# Synopsis: add_to_variable $FILE_OR_DIRECTORY $SEPARATOR
+function add_to_variable () {
+    if [ -d "$1" ]; then
+	for file in `run-parts $1 --list`; do
+	    if [ -n "$DEBUG_WRAPPER" ]; then
+		echo >&2 "  $1 (directory)"
+	    fi
+	    add_to_variable $file "$2"
+	done
+    elif [ -e "$1" ]; then
+	for line in `cat $1 | xargs`; do
+	    if [ -n "$DEBUG_WRAPPER" ]; then
+		echo >&2 "  $1: $line"
+	    fi
+	    VARIABLE="$VARIABLE$2$line"
+	done
+    else
+	echo >&2 "$1 does not exist; ignored"
+    fi
+}
+
+# Construct CLASSPATH from --classpath-from options.
+if [ -n "$DEBUG_WRAPPER" ]; then
+    echo >&2 "Constructing CLASSPATH ..."
+    echo >&2 "  JavaServer CLASSPATH: $JAVASERVER_CLASSPATH"
+    if [ -n "$CLASSPATH" ]; then
+	echo >&2 "  existing CLASSPATH: $CLASSPATH"
+    fi
+fi
+VARIABLE=$CLASSPATH
+for source in $CLASSPATH_FROM; do
+    add_to_variable $source ":"
+done
+CLASSPATH=$VARIABLE
+CLASSPATH=${CLASSPATH#:} # remove leading colon
+
+# Add location of JavaServer JAR files to beginning of CLASSPATH
+CLASSPATH=$JAVASERVER_CLASSPATH:$CLASSPATH
+CLASSPATH=${CLASSPATH%:} # remove trailing colon
+export CLASSPATH
+if [ -n "$DEBUG_WRAPPER" ]; then
+    echo >&2 "Final CLASSPATH: $CLASSPATH"
+fi
+
+# Construct JAVA_OPTS from --java-opts-from options.  The following
+# function reads all lines from a file and adds each line to the
+# JAVA_OPTS.  If a directory is given as an argument, then this
+# function processes each file in that directory returned by the
+# run-parts command.
+if [ -n "$DEBUG_WRAPPER" ]; then
+    echo >&2 "Constructing JAVA_OPTS ..."
+    if [ -n "$JAVA_OPTS" ]; then
+	echo >&2 "  existing JAVA_OPTS: $JAVA_OPTS"
+    fi
+fi
+VARIABLE=$JAVA_OPTS
+for source in $JAVA_OPTS_FROM; do
+    add_to_variable $source " "
+done
+JAVA_OPTS=$VARIABLE
+export JAVA_OPTS
+if [ -n "$DEBUG_WRAPPER" ]; then
+    echo >&2 "Final JAVA_OPTS: $JAVA_OPTS"
+fi
+
+# Execute the JavaServer program, passing along any command line arguments.
+if [ -n "$DEBUG_WRAPPER" ]; then
+    echo >&2 "exec java $JAVA_OPTS com.zzo.javaserver.JavaServer $JAVASERVER_OPTS"
+fi
+exec java $JAVA_OPTS com.zzo.javaserver.JavaServer $JAVASERVER_OPTS
--- javaserver-5.1.orig/debian/changelog
+++ javaserver-5.1/debian/changelog
@@ -0,0 +1,31 @@
+javaserver (5.1-0nsds5) stable; urgency=low
+
+  * Restart JavaServer weekly to avoid memory leaks or other problems.
+
+ -- Ken Neighbors <ken@nsds.com>  Thu,  8 Mar 2007 07:26:00 -0700
+
+javaserver (5.1-0nsds4) stable; urgency=low
+
+  * Avoid debconf loop by using fset seen on secret and secret_again.
+
+ -- Ken Neighbors <ken@nsds.com>  Thu, 19 Oct 2006 11:39:00 -0700
+
+javaserver (5.1-0nsds3) stable; urgency=low
+
+  * Start JavaServer with -Djava.awt.headless=true when DISPLAY is blank.
+  * Start JavaServer under empty directory by default.
+
+ -- Ken Neighbors <ken@nsds.com>  Wed,  7 Dec 2005 15:00:00 -0800
+
+javaserver (5.1-0nsds2) stable; urgency=low
+
+  * Do not display note about log4j configuration when installing.
+
+ -- Ken Neighbors <ken@nsds.com>  Thu,  3 Nov 2005 12:38:51 -0800
+
+javaserver (5.1-0nsds1) stable; urgency=low
+
+  * Initial Release.
+
+ -- Ken Neighbors <ken@nsds.com>  Sat, 1 Oct 2005 10:54:00 -0700
+
--- javaserver-5.1.orig/debian/README.Debian
+++ javaserver-5.1/debian/README.Debian
@@ -0,0 +1,175 @@
+JavaServer for Debian
+--------------------------------------------------------------------------------
+CONFIGURATION
+
+Some options described below can be configured when javaserver is
+installed.  These options can be reconfigured with this command:
+
+  dpkg-reconfigure --default-priority javaserver
+
+Note: if you wish to reconfigure *all* options regardless of your
+default priority setting, then do not specify "--default-priority".
+
+* /etc/init.d/javaserver
+
+  The JavaServer backend is started via this init script.  This init
+  script reads from the following files and directories for
+  configuration options.
+
+* /etc/defaults/javaserver
+
+  The init script reads configuration values from this file for
+  0. the directory to run JavaServer under
+     (default "/usr/share/javaserver/empty/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z")
+  1. the user to run JavaServer as (default "javaserv")
+  2. the group to run JavaServer under (default "javaserv")
+  3. the umask to run JavaServer under (default 002)
+  4. the port to run JavaServer on (default 2000)
+  5. the X Window System DISPLAY variable (default empty)
+
+* /etc/javaserver/classpath.d
+
+  If you need additional CLASSPATHs or JAR files to be searched, you can
+  specify them, one per line, in one or more files in this directory.
+  The "run-parts" program will be used to read in these files and each
+  line of these files will be added to the CLASSPATH environment
+  variable before the JavaServer backend is started.  For example, to
+  use JavaServer with Apache FOP you might set up a file
+  /etc/javaserver/classpath.d/apache-fop with the following contents:
+
+    /usr/share/java/fop.jar
+    /usr/share/java/xalan2.jar
+    /usr/share/java/xercesImpl.jar
+    /usr/share/java/xmlParserAPIs.jar
+    /usr/share/java/logkit.jar
+    /usr/share/java/avalon-framework.jar
+    /usr/share/java/batik.jar
+    /usr/share/java/jimi-1.0.jar
+
+* /etc/javaserver/java-opts.d
+
+  If you need additional Java options defined, you can specify them in
+  one or more files in this directory.  You may place them on separate
+  lines if you wish--they will automatically be concatenated and
+  separated by spaces.  The "run-parts" program will be used to read in
+  these files and each line will be added to the JAVA_OPTS environment
+  variable, which is then inserted into the Java command line by
+  /usr/sbin/javaserver.  Note that if the DISPLAY variable is empty,
+  then the Java option "-Djava.awt.headless=true" will be added
+  to JAVA_OPTS automatically.
+
+* /etc/javaserver/authfile
+
+  The first line of this file is a shared secret for the JavaServer.
+  This secret is used for authentication.  Any frontend that connects to
+  the JavaServer backend must supply the same shared secret before it
+  will be allowed to invoke any Java classes.  This file should only be
+  readable by the JavaServer, that is, it should be owned by the user
+  and group that JavaServer runs as and its permissions should allow
+  only the user to read it, for example:
+
+    ls -l /etc/javaserver/authfile
+    -rw-------  1 javaserv javaserv 1 Oct  3 11:49 authfile
+
+  When JavaServer is configured or re-configured in Debian, the owner
+  and group of this file will be updated automatically according to your
+  preferences, but the permissions will not change.  This allows you to
+  add group read permission at your discretion if another process needs
+  access to it (your web server for example).
+
+* /etc/javaserver/log4j.conf
+
+  Logging for JavaServer is provided through the log4j facility, which
+  is configured in this file.  By default, no logging is performed.
+  Sample entries are provided for logging to a file or to the syslog.
+  If you prefer to have your log4j configuration defined elsewhere,
+  then edit /etc/javaserver/java-opts/javaserver and specify the
+  location.
+
+  To use the syslog appender it is necessary that the syslog daemon
+  (syslogd) be started with the "-r" option so that it will listen on
+  the network (which is how SyslogAppender talks to syslogd).  On Debian
+  with SysV-style init, you can set this option in /etc/init.d/sysklogd.
+  Please be aware of the security issues related to providing syslog
+  service remotely with the "-r" option (e.g., denial-of-service).  For
+  more information refer to the manual page for syslogd.
+
+--------------------------------------------------------------------------------
+SUGGESTIONS
+
+If the Java application that you are invoking through JavaServer
+creates output files, then they will be owned by the javaserv user and
+the javaserv group.  If you need to manipulate these files (rename or
+delete them), then consider adding your user id to the javaserv group.
+For example, if you are invoking JavaServer from a web application
+running under the Apache user www-data, you can add www-data to the
+javaserv group with this command (as root):
+
+  adduser www-data javaserv
+
+You can then create a custom directory with a group of javaserv and
+direct the Java application to create files in that custom directory.
+For example, create a custom directory like this:
+
+  mkdir /tmp/javaserver
+  chown www-data:javaserv /tmp/javaserver
+  chmod 770 /tmp/javaserver
+
+Then direct the Java application to create its files in
+/tmp/javaserver.
+
+Note that there is no way to change the current directory for Java
+applications invoked through JavaServer.  Although daemons are usually
+started in the root directory, JavaServer is started by default under
+an empty directory several levels deep,
+/usr/share/javaserver/empty/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z,
+so that a Java application will not accidentally read some file from
+the root directory thinking it was started in a current directory
+somewhere else.  A specific case for this issue is Apache FOP, which
+tries to read relative-defined external-graphics first from the
+current directory and second from the baseDir.  It is therefore
+necessary to start JavaServer in an empty directory so that Apache FOP
+does not pull in some random external-graphic from the wrong directory
+when it should be using the baseDir.  The empty directory is placed
+several directory levels down to help prevent problems with a
+relative-defined external-graphic starting with one or more "../".
+
+--------------------------------------------------------------------------------
+DEBUGGING
+
+The JavaServer application does not automatically put itself into the
+background as a daemon, so the "--background" option of
+"start-stop-daemon" must be used in the init script
+"/etc/init.d/javaserver".  Unfortunately, this option does not allow
+JavaServer to display any error messages.  If you find that JavaServer
+is not starting and you don't know why, here are some suggestions for
+debugging:
+
+1. Change the logging line in /etc/javaserver/log4j.conf to:
+
+     log4j.rootCategory=DEBUG, file
+
+   This will tell JavaServer to write debugging information to a file, by
+   default /tmp/javaserver.log.
+
+2. Remove the "--background" option from START_OPTS in
+   /etc/init.d/javaserver and run it manually to see any error messages:
+
+     invoke-rc.d javaserver start
+
+3. Also add the "--debug-wrapper" option to DAEMON_OPTS in
+   /etc/init.d/javaserver and run it manually to see CLASSPATH and
+   JAVA_OPTS:
+
+     invoke-rc.d javaserver start
+
+--------------------------------------------------------------------------------
+REFERENCES
+
+  http://sourceforge.net/projects/javaserver/
+  http://search.cpan.org/~metzzo/Java-4.7/Java.pm
+  http://logging.apache.org/log4j/docs/
+  http://www.vipan.com/htdocs/log4jhelp.html
+
+--------------------------------------------------------------------------------
+ -- Ken Neighbors <ken@nsds.com>, Thu Dec  8 15:05:18 2005
--- javaserver-5.1.orig/debian/javaserver.postinst
+++ javaserver-5.1/debian/javaserver.postinst
@@ -0,0 +1,125 @@
+#!/bin/sh
+# postinst script for javaserver
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+# quoting from the policy:
+#     Any necessary prompting should almost always be confined to the
+#     post-installation script, and should be protected with a conditional
+#     so that unnecessary prompting doesn't happen if a package's
+#     installation fails and the `postinst' is called with `abort-upgrade',
+#     `abort-remove' or `abort-deconfigure'.
+
+# Default configuration options needed if debconf is not available.
+# These will be overridden with debconf values if available.
+SECRET=
+JAVASERVER_USER=javaserv
+JAVASERVER_GROUP=javaserv
+
+# Location of configuration files.
+CONFFILETEMPLATE=/usr/share/javaserver/javaserver.conf
+CONFFILE=/etc/default/javaserver
+AUTHFILE=/etc/javaserver/authfile
+
+case "$1" in
+    configure|reconfigure)
+	if [ -f /usr/share/debconf/confmodule ]; then
+	    . /usr/share/debconf/confmodule
+	    db_version 2.0
+	    db_set javaserver/need_to_read_configuration_files "true"
+	    db_get javaserver/secret
+	    SECRET=$RET
+	    db_set javaserver/secret ""
+	    db_set javaserver/secret_again ""
+	    db_get javaserver/start
+	    JAVASERVER_START=$RET
+	    db_get javaserver/directory
+	    JAVASERVER_DIRECTORY=$RET
+	    db_get javaserver/user
+	    JAVASERVER_USER=$RET
+	    db_get javaserver/group
+	    JAVASERVER_GROUP=$RET
+	    db_get javaserver/umask
+	    JAVASERVER_UMASK=$RET
+	    db_get javaserver/port
+	    JAVASERVER_PORT=$RET
+	    db_get javaserver/display
+	    JAVASERVER_DISPLAY=$RET
+	    if [ -e $AUTHFILE -a -n "$SECRET" ]; then
+		if [ "$SECRET" = "NULL" ]; then
+		    echo > $AUTHFILE
+		else
+		    echo "$SECRET" > $AUTHFILE
+		fi
+	    fi
+	    sed -e "s|START=.*|START=$JAVASERVER_START|" \
+		-e "s|DIRECTORY=.*|DIRECTORY=$JAVASERVER_DIRECTORY|" \
+		-e "s|USER=.*|USER=$JAVASERVER_USER|" \
+		-e "s|GROUP=.*|GROUP=$JAVASERVER_GROUP|" \
+		-e "s|UMASK=.*|UMASK=$JAVASERVER_UMASK|" \
+		-e "s|PORT=.*|PORT=$JAVASERVER_PORT|" \
+		-e "s|DISPLAY=.*|DISPLAY=$JAVASERVER_DISPLAY|" \
+		$CONFFILETEMPLATE > $CONFFILE.dpkg-inst
+	    ucf --debconf-ok $CONFFILE.dpkg-inst $CONFFILE
+	    rm -f $CONFFILE.dpkg-inst
+	    db_stop
+	fi
+
+	adduser --quiet --system --group --shell /bin/sh \
+	    --home / --no-create-home --gecos "JavaServer Daemon" javaserv
+
+	if [ ! -e $CONFFILE ]; then
+	    cp -p $CONFFILETEMPLATE $CONFFILE
+	fi
+	chown root:root $CONFFILE
+	chmod 644 $CONFFILE
+
+	if [ ! -e $AUTHFILE ]; then
+	    if [ "$SECRET" = "NULL" ]; then
+		echo > $AUTHFILE
+	    else
+		echo "$SECRET" > $AUTHFILE
+	    fi
+	    chmod 600 $AUTHFILE
+	fi
+	if getent passwd $JAVASERVER_USER >/dev/null 2>&1; then
+	    chown $JAVASERVER_USER $AUTHFILE
+	else		
+	    echo >&2 "Cannot chown $AUTHFILE: $JAVASERVER_USER does not exist"
+	fi
+	if getent group javaserv >/dev/null 2>&1; then
+	    chgrp $JAVASERVER_GROUP $AUTHFILE
+	else		
+	    echo >&2 "Cannot chgrp $AUTHFILE: $JAVASERVER_GROUP does not exist"
+	fi
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+	echo "postinst called with unknown argument \`$1'" >&2
+	exit 1
+    ;;
+
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
--- javaserver-5.1.orig/debian/javaserver.dirs
+++ javaserver-5.1/debian/javaserver.dirs
@@ -0,0 +1,7 @@
+etc/javaserver/classpath.d
+etc/javaserver/java-opts.d
+etc/default
+usr/sbin
+usr/share/java
+usr/share/javaserver/empty/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z
+usr/share/man/man8
--- javaserver-5.1.orig/debian/javaserver.templates
+++ javaserver-5.1/debian/javaserver.templates
@@ -0,0 +1,133 @@
+Template: javaserver/need_to_read_configuration_files
+Type: boolean
+Default: true
+Description: internal variable should never be seen
+ A variable is used to track whether or not the configuration files
+ have been read to track user changes to those files.  The config
+ script reads the values from the configuration files, asks the user
+ if they want to override the values, and then the postinst
+ script writes the values to the configuration files.  However, the
+ config script may be run twice in many circumstances, and we only
+ want to read the configurations file once (the first time), otherwise
+ the user's answers in debconf would be lost.
+
+Template: javaserver/continue_config
+Type: boolean
+Default: true
+Description: Continue JavaServer configuration?
+ There is no previous configuration item.  If you want to cancel
+ the configuration of JavaServer, choose "Back", "No", or "Cancel" to
+ exit.  You can return here to complete the configuration in the
+ future by typing "dpkg-reconfigure --default-priority javaserver" as
+ root.
+
+Template: javaserver/secret
+Type: password
+Default:
+Description: Enter the authentication secret for JavaServer:
+ A secret is used for authentication and is stored in the file
+ /etc/javaserver/authfile.  Any frontend that connects to the
+ JavaServer backend must supply the same shared secret before it will
+ be allowed to invoke any Java classes.
+ .
+ To disable authentication and allow any frontend to connect and
+ invoke Java classes (even from remote systems!), type NULL and an
+ empty secret will be used.  If you specify an empty authentication
+ secret, it is highly recommended that you use a firewall to limit
+ connections from remote hosts.  This is recommended even with a
+ non-empty secret.
+ .
+ ${blank_secret_note}
+
+Template: javaserver/secret_again
+Type: password
+Default:
+Description: Re-enter authentication secret to verify:
+ Please enter the same secret again to verify you have typed it
+ correctly.
+
+Template: javaserver/secret_mismatch
+Type: note
+Description: Secret input error.
+ The two secrets you entered were not the same.  Please try again.
+
+Template: javaserver/start
+Type: boolean
+Default: true
+Description: Automatically start JavaServer?
+ The JavaServer will automatically be started via the init script
+ /etc/init.d/javaserver, unless you specify otherwise.
+
+Template: javaserver/directory
+Type: string
+Default: /usr/share/javaserver/empty
+Description: Enter the directory to run JavaServer under:
+ The JavaServer is started under the directory you specify here.  This
+ directory will be the "current directory" for any Java application
+ invoked through the JavaServer.
+ .
+ It is recommended that you set this to an empty directory several
+ levels deep, such as
+ /usr/share/javaserver/empty/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z),
+ so that a Java application will not accidentally read some file from
+ this directory thinking it was started in a current directory
+ somewhere else.  A specific case for this issue is Apache FOP, which
+ tries to read relative-defined external-graphics first from the
+ current directory and second from the baseDir.  It is therefore
+ necessary to start JavaServer in an empty directory so that Apache
+ FOP does not pull in some random external-graphic from the wrong
+ directory when it should be using the baseDir.  The empty directory
+ should be placed several directory levels down to help prevent
+ problems with a relative-defined external-graphic starting with one
+ or more "../".
+
+Template: javaserver/user
+Type: string
+Default: javaserv
+Description: Enter the user to run JavaServer as:
+ For security reasons, the JavaServer daemon is not run as root.
+ Instead, a new system user ("javaserv") and group ("javaserv") are
+ created for JavaServer to run as.  If you prefer to use a different
+ user, then specify that username here.  This user must already exist.
+ If it does not exist, you can leave this setting as "javaserv",
+ create the user later, and then re-run this configuration with
+ "dpkg-reconfigure javaserv".
+
+Template: javaserver/group
+Type: string
+Default: javaserv
+Description: Enter the group to run JavaServer under:
+ For security reasons, the JavaServer daemon is not run as root.
+ Instead, a new system user ("javaserv") and group ("javaserv") are
+ created for JavaServer to run as.  If you prefer to use a different
+ group, then specify that group name here.  This group must already
+ exist.  If it does not exist, you can leave this setting as
+ "javaserv", create the group later, and then re-run this
+ configuration with "dpkg-reconfigure javaserv".
+
+Template: javaserver/umask
+Type: string
+Default: 002
+Description: Enter the umask to run JavaServer under:
+ If JavaServer creates files or directories, they will be owned by the
+ user and group specified previously, and the permissions will be
+ determined by the umask.  A setting of 002 will give owner and group
+ read/write permission and give others just read permission.
+
+Template: javaserver/port
+Type: string
+Default: 2000
+Description: Enter the port to run JavaServer on:
+ By default the JavaServer listens for requests on port 2000.  You can
+ change that here.  It is recommended that you configure your firewall
+ to not allow connections to this port except where needed.
+
+Template: javaserver/display
+Type: string
+Default:
+Description: Enter the X Window System DISPLAY variable:
+ If your JavaServer needs to connect to an X Window System server,
+ then enter the DISPLAY variable it should use.  Typically, you will
+ run JavaServer in "headless" mode, so it does not need to connect to
+ an X server, and you can leave DISPLAY blank, in which case
+ JavaServer will be started with "-Djava.awt.headless=true".
--- javaserver-5.1.orig/debian/javaserver.postrm
+++ javaserver-5.1/debian/javaserver.postrm
@@ -0,0 +1,54 @@
+#!/bin/sh
+# postrm script for javaserver
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+case "$1" in
+    remove|abort-install|disappear)
+    ;;
+
+    purge)
+	if getent passwd javaserv >/dev/null 2>&1; then
+	    deluser --quiet javaserv || true
+	fi
+	if getent group javaserv >/dev/null 2>&1; then
+	    delgroup --quiet javaserv || true
+	fi
+
+	rm -f /etc/javaserver/authfile
+	rm -f /etc/default/javaserver
+	if [ -x /usr/bin/ucf ]; then
+	    ucf --purge /etc/default/javaserver
+	fi
+    ;;
+
+    upgrade|failed-upgrade|abort-upgrade)
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
--- javaserver-5.1.orig/debian/javaserver.config
+++ javaserver-5.1/debian/javaserver.config
@@ -0,0 +1,203 @@
+#!/bin/sh
+# config script for javaserver
+#
+# see: debconf-devel(7)
+
+set -e
+
+# Source debconf library.
+test -f /usr/share/debconf/confmodule || exit 0
+. /usr/share/debconf/confmodule
+db_version 2.0
+db_capb "backup"
+db_title "JavaServer Configuration"
+
+BLANK_SECRET_NOTE="Note: there is no existing secret, so if you leave this blank, authentication will remain disabled (allowing any frontend to connect from anywhere)."
+db_get javaserver/need_to_read_configuration_files
+if [ "$RET" = "true" ]; then
+    # Read current settings from configuration files.
+    if [ -e /etc/default/javaserver ]; then
+	. /etc/default/javaserver || true
+	if grep -Eq '^ *JAVASERVER_START=' /etc/default/javaserver; then
+	    db_set javaserver/start "$JAVASERVER_START"
+	fi
+	if grep -Eq '^ *JAVASERVER_DIRECTORY=' /etc/default/javaserver; then
+	    db_set javaserver/directory "$JAVASERVER_DIRECTORY"
+	fi
+	if grep -Eq '^ *JAVASERVER_USER=' /etc/default/javaserver; then
+	    db_set javaserver/user "$JAVASERVER_USER"
+	fi
+	if grep -Eq '^ *JAVASERVER_GROUP=' /etc/default/javaserver; then
+	    db_set javaserver/group "$JAVASERVER_GROUP"
+	fi
+	if grep -Eq '^ *JAVASERVER_UMASK=' /etc/default/javaserver; then
+	    db_set javaserver/umask "$JAVASERVER_UMASK"
+	fi
+	if grep -Eq '^ *JAVASERVER_PORT=' /etc/default/javaserver; then
+	    db_set javaserver/port "$JAVASERVER_PORT"
+	fi
+	if grep -Eq '^ *JAVASERVER_DISPLAY=' /etc/default/javaserver; then
+	    db_set javaserver/display "$JAVASERVER_DISPLAY"
+	fi
+    fi
+    if [ -e /etc/javaserver/authfile ]; then
+	read -r < /etc/javaserver/authfile || true
+	if [ -n "$REPLY" ]; then
+	    BLANK_SECRET_NOTE="Note: if you leave this blank, the existing secret will remain unchanged.  Enter NULL to set an empty secret as described above."
+	    REPLY=
+	fi
+    fi
+    db_set javaserver/need_to_read_configuration_files "false"
+fi
+
+# Store original values of configuration questions if user chooses to cancel.
+VALUES="secret secret_again start directory user group umask port display"
+for value in $VALUES; do
+    db_fget javaserver/$value seen
+    eval "SEEN_$value='$RET'"
+    db_get javaserver/$value
+    eval "ORIG_$value='$RET'"
+done
+
+STATE="secret"
+while [ "$STATE" != "done" ]; do
+    case "$STATE" in
+	continue_config)
+	    db_fset javaserver/continue_config seen "false"
+	    db_set javaserver/continue_config "true"
+	    db_input high javaserver/continue_config || true
+	    if db_go; then
+		db_get javaserver/continue_config
+		if [ "$RET" = "true" ]; then
+		    STATE="secret"
+		    continue
+		fi
+	    fi
+	    # Reset values of configuration questions to original values.
+	    for value in $VALUES; do
+		eval "db_fset javaserver/$value seen \"\$SEEN_$value\""
+		eval "db_set javaserver/$value \"\$ORIG_$value\""
+	    done
+	    STATE="done"
+	;;
+
+	secret)
+	    db_subst javaserver/secret blank_secret_note "$BLANK_SECRET_NOTE"
+	    db_input high javaserver/secret || true
+	    if ! db_go; then
+		STATE="continue_config"
+	    else
+		db_get javaserver/secret
+		if [ -n "$RET" ]; then
+		    STATE="secret_again"
+		else
+		    db_set javaserver/secret_again ""
+		    STATE="start"
+		fi
+	    fi
+	;;
+
+	secret_again)
+	    db_input high javaserver/secret_again || true
+	    if ! db_go; then
+		STATE="secret"
+		continue
+	    fi
+
+	    # Compare the secrets; loop back if not identical.
+	    db_get javaserver/secret
+	    SECRET="$RET"
+	    db_get javaserver/secret_again
+	    if [ "$SECRET" = "$RET" ]; then
+		STATE="start"
+	    else
+		db_fset javaserver/secret_mismatch seen "false"
+		db_input high javaserver/secret_mismatch
+		db_go || true
+		db_set javaserver/secret ""
+		db_set javaserver/secret_again ""
+		db_fset javaserver/secret seen "false"
+		db_fset javaserver/secret_again seen "false"
+		STATE="secret"
+	    fi
+	    SECRET=
+	;;
+
+	start)
+	    db_input low javaserver/start || true
+	    if ! db_go; then
+		STATE="secret"
+	    else
+		STATE="directory"
+	    fi
+	;;
+
+	directory)
+	    db_input low javaserver/directory || true
+	    if ! db_go; then
+		STATE="start"
+	    else
+		STATE="user"
+	    fi
+	;;
+
+	user)
+	    db_input low javaserver/user || true
+	    if ! db_go; then
+		STATE="directory"
+	    else
+		STATE="group"
+	    fi
+	;;
+
+	group)
+	    db_input low javaserver/group || true
+	    if ! db_go; then
+		STATE="user"
+	    else
+		STATE="umask"
+	    fi
+	;;
+
+	umask)
+	    db_input low javaserver/umask || true
+	    if ! db_go; then
+		STATE="group"
+	    else
+		STATE="port"
+	    fi
+	;;
+
+	port)
+	    db_input low javaserver/port || true
+	    if ! db_go; then
+		STATE="umask"
+	    else
+		STATE="display"
+	    fi
+	;;
+
+	display)
+	    db_input low javaserver/display || true
+	    if ! db_go; then
+		STATE="port"
+	    else
+		STATE="logging_note"
+	    fi
+	;;
+
+	logging_note)
+	    db_input medium javaserver/logging_note || true
+	    if ! db_go; then
+		STATE="port"
+	    else
+		STATE="done"
+	    fi
+	;;
+
+	*)
+	    echo >&2 "Error: bad config file state: $STATE"
+	    STATE="done"
+	;;
+    esac
+done
--- javaserver-5.1.orig/debian/javaserver.conf
+++ javaserver-5.1/debian/javaserver.conf
@@ -0,0 +1,25 @@
+# /etc/default/javaserver
+# Configuration file for JavaServer.
+# This file is sourced by /bin/sh from /etc/init.d/javaserver.
+
+# Whether to start the JavaServer daemon; set to true or false.
+JAVASERVER_START=true
+
+# Directory to run JavaServer under.
+JAVASERVER_DIRECTORY=/usr/share/javaserver/empty/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z
+
+# User and group to run JavaServer daemon as.  This user and group
+# must already exist (see adduser).  If you change either of these
+# settings, be sure to also change the ownership of the file
+# /etc/javaserver/authfile so that JavaServer can read it.
+JAVASERVER_USER=javaserv
+JAVASERVER_GROUP=javaserv
+
+# Umask to run JavaServer daemon under.
+JAVASERVER_UMASK=002
+
+# Port to run JavaServer daemon on.
+JAVASERVER_PORT=2000
+
+# X Window System DISPLAY variable setting.
+JAVASERVER_DISPLAY=
