--- /dev/null
+invirt-web-afs-apache (0.0.1) unstable; urgency=low
+
+ * Initial release.
+
+ -- Greg Brockman <gdb@mit.edu> Fri, 22 Jan 2010 01:31:26 -0500
+
--- /dev/null
+Source: invirt-web-afs-apache
+Section: base
+Priority: extra
+Maintainer: Invirt project <invirt@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.1.0), config-package-dev
+Standards-Version: 3.7.2
+
+Package: invirt-web-afs-apache
+Architecture: all
+Depends: ${misc:Depends}, apache2,
+ kstart, debathena-afs-config, openafs-modules-xen
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Replaces: invirt-web-iptables (<= 0.0.2)
+Description: the Invirt web interface
--- /dev/null
+This software was written as part of the Invirt project <invirt@mit.edu>.
+
+Copyright :
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+On Debian systems, the complete text of the GNU General Public License
+can be found in the file /usr/share/common-licenses/GPL.
+
+The file "code/static/power_installing.png" is from the Human-O2 icon
+set by Oliver Scholtz and is released under the "GNU/GPL" (source:
+http://www.iconfinder.net/icondetails/24350/128/ -
+http://schollidesign.deviantart.com/art/Human-O2-Iconset-105344123)
--- /dev/null
+#!/bin/sh
+# postinst script for #PACKAGE#
+#
+# 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>
+# * <postinst> `abort-remove'
+# * <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
+
+
+case "$1" in
+ configure)
+ # Our init script proxies all requests to Apache's, so Apache's
+ # running is just a NOP
+ update-rc.d -f apache2 remove
+ ;;
+
+ 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
+
+
--- /dev/null
+#!/bin/sh
+# prerm script for invirt-web
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <prerm> `remove'
+# * <old-prerm> `upgrade' <new-version>
+# * <new-prerm> `failed-upgrade' <old-version>
+# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+# * <deconfigured's-prerm> `deconfigure' `in-favour'
+# <package-being-installed> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ remove|upgrade|deconfigure)
+ update-rc.d apache2 defaults 91 9
+ ;;
+
+ failed-upgrade)
+ ;;
+
+ *)
+ echo "prerm 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
+
+
--- /dev/null
+#!/usr/bin/make -f
+
+DEB_DIVERT_EXTENSION = .invirt
+DEB_DIVERT_FILES_invirt-web-afs-apache += \
+ /etc/init.d/apache2
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/config-package.mk
--- /dev/null
+#!/usr/bin/pagsh -e
+### BEGIN INIT INFO
+# Provides: apache2
+# Required-Start: $local_fs $remote_fs $network $syslog openafs-client
+# Required-Stop: $local_fs $remote_fs $network $syslog openafs-client
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start/stop apache2 web server
+### END INIT INFO
+#
+# Apache kstart wrapper by anders.
+#
+
+SCRIPT=/etc/init.d/apache2.invirt-orig
+KSTART_PIDFILE=/var/run/k5start-apache2.pid
+KSTART_KEYTAB=/etc/invirt/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 -S afs -I "$AFSCELL" -t \
+ "daemon/$(hostname -f)"
+ cat "$TMP_PIDFILE" >|"$KSTART_PIDFILE"
+ rm -f "$TMP_PIDFILE"
+}
+kstart_stop () {
+ if [ -e $KSTART_PIDFILE ]; then
+ /sbin/start-stop-daemon --stop --pidfile $KSTART_PIDFILE
+ pgrep apache2 >/dev/null && sleep 1 \
+ && pgrep apache2 >/dev/null && sleep 1 \
+ && pgrep apache2 >/dev/null && sleep 1 \
+ && pgrep apache2 >/dev/null && sleep 1 \
+ && pkill -9 apache2
+ 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