Index: trunk/packages/sipb-xen-www/debian/changelog
===================================================================
--- trunk/packages/sipb-xen-www/debian/changelog	(revision 766)
+++ trunk/packages/sipb-xen-www/debian/changelog	(revision 768)
@@ -1,2 +1,9 @@
+sipb-xen-www (3.6) unstable; urgency=low
+
+  * Add Anders' kstart-using apache2 init script.
+  * Add some dependencies the svn site needs.
+
+ -- Greg Price <price@mit.edu>  Mon, 28 Jul 2008 07:51:09 -0400
+
 sipb-xen-www (3.5) unstable; urgency=low
 
Index: trunk/packages/sipb-xen-www/debian/control
===================================================================
--- trunk/packages/sipb-xen-www/debian/control	(revision 766)
+++ trunk/packages/sipb-xen-www/debian/control	(revision 768)
@@ -8,4 +8,5 @@
 Package: sipb-xen-www
 Architecture: all
-Depends: ${misc:Depends}, libapache2-mod-fcgid, python-cheetah, python-simplejson, sipb-xen-database-common, sipb-xen-vnc-client
+Depends: ${misc:Depends}, libapache2-mod-fcgid, python-cheetah, python-simplejson, sipb-xen-database-common, sipb-xen-vnc-client, kstart,
+ libapache2-svn, postfix, subversion, zephyr-clients
 Description: Install the sipb-xen-dev website
Index: trunk/packages/sipb-xen-www/debian/rules
===================================================================
--- trunk/packages/sipb-xen-www/debian/rules	(revision 766)
+++ trunk/packages/sipb-xen-www/debian/rules	(revision 768)
@@ -1,5 +1,10 @@
 #!/usr/bin/make -f
 
+DEB_DIVERT_EXTENSION = .invirt
+DEB_DIVERT_FILES_sipb-xen-www += \
+    /etc/init.d/apache2
+
 include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/config-package.mk
 
 binary-fixup/sipb-xen-www::
Index: trunk/packages/sipb-xen-www/files/etc/init.d/apache2.invirt
===================================================================
--- trunk/packages/sipb-xen-www/files/etc/init.d/apache2.invirt	(revision 768)
+++ trunk/packages/sipb-xen-www/files/etc/init.d/apache2.invirt	(revision 768)
@@ -0,0 +1,53 @@
+#!/usr/bin/pagsh -e
+#
+# Apache kstart wrapper by anders.
+#
+
+SCRIPT=/etc/init.d/apache2.invirt-orig
+KSTART_PIDFILE=/var/run/k5start-apache2.pid
+KSTART_KEYTAB=/etc/apache2/keytab
+
+export AFSCELL=sipb.mit.edu
+
+kstart_start () {
+    TMP_PIDFILE=$(mktemp /tmp/k5start-apache2.pid-XXXXXX)
+    chown www-data "$TMP_PIDFILE"
+    export KRB5CCNAME=$(mktemp /tmp/krb5cc_33.kstart-XXXXXX)
+    chown www-data $KRB5CCNAME
+    /sbin/start-stop-daemon --start --pidfile "$TMP_PIDFILE" -c www-data \
+	--exec /usr/bin/k5start -- -b -p "$TMP_PIDFILE" \
+	-f "$KSTART_KEYTAB" -K10 -u daemon -i sipb-xen.mit.edu -S afs -I sipb.mit.edu -t -b
+    cat "$TMP_PIDFILE" >|"$KSTART_PIDFILE"
+    rm -f "$TMP_PIDFILE"
+}
+kstart_stop () {
+    if [ -e $KSTART_PIDFILE ]; then
+	/sbin/start-stop-daemon --stop --pidfile $KSTART_PIDFILE
+	rm -f $KSTART_PIDFILE
+    else
+	echo -n " ... no kstart pidfile"
+    fi
+}
+
+case "$1" in
+  start)
+    echo -n "Starting kstart for Apache2: k5start"
+    kstart_start
+    echo "."
+    exec "$SCRIPT" start
+    ;;
+  stop)
+    "$SCRIPT" stop
+    echo -n "Stopping kstart for Apache2: k5start"
+    kstart_stop
+    echo "."
+    ;;
+  restart|force-reload)
+    "$0" stop
+    sleep 1
+    "$0" start
+    ;;
+  *)
+    exec "$SCRIPT" "$@"
+    ;;
+esac
