--- debathena-pyhesiodfs-0.0.r157.orig/debian/control
+++ debathena-pyhesiodfs-0.0.r157/debian/control
@@ -0,0 +1,16 @@
+Source: debathena-pyhesiodfs
+Section: debathena/net
+Priority: extra
+Maintainer: Debian-Athena Project <debathena@mit.edu>
+Build-Depends: cdbs, debhelper, quilt, patchutils, config-package-dev, python-dev, python-support
+Standards-Version: 3.7.3
+
+Package: debathena-pyhesiodfs
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python-fuse, python-hesiod (>= 0.2.10), debathena-afs-config, debathena-hesiod-config, adduser, fuse-utils, lsb-base (>= 3.0-6)
+Provides: ${python:Provides}
+Conflicts: debathena-afuse-automounter, debathena-autofs-config
+Replaces: debathena-afuse-automounter, debathena-autofs-config
+Description: Hesiod automounter for Athena lockers
+ This package includes a FUSE filesystem to automatically mount Athena
+ lockers using the Hesiod directory information.
--- debathena-pyhesiodfs-0.0.r157.orig/debian/fuse.conf.debathena
+++ debathena-pyhesiodfs-0.0.r157/debian/fuse.conf.debathena
@@ -0,0 +1 @@
+user_allow_other
--- debathena-pyhesiodfs-0.0.r157.orig/debian/pyversions
+++ debathena-pyhesiodfs-0.0.r157/debian/pyversions
@@ -0,0 +1 @@
+2.4-
--- debathena-pyhesiodfs-0.0.r157.orig/debian/compat
+++ debathena-pyhesiodfs-0.0.r157/debian/compat
@@ -0,0 +1 @@
+4
--- debathena-pyhesiodfs-0.0.r157.orig/debian/debathena-pyhesiodfs.links
+++ debathena-pyhesiodfs-0.0.r157/debian/debathena-pyhesiodfs.links
@@ -0,0 +1 @@
+/etc/init.d/debathena-pyhesiodfs /etc/init.d/debathena-mit-automounter
--- debathena-pyhesiodfs-0.0.r157.orig/debian/changelog
+++ debathena-pyhesiodfs-0.0.r157/debian/changelog
@@ -0,0 +1,57 @@
+debathena-pyhesiodfs (0.0.r157-0debathena2) unstable; urgency=low
+
+  * Rebuild with new version of python-hesiod
+
+ -- Evan Broder <broder@mit.edu>  Thu, 20 Nov 2008 19:18:29 -0500
+
+debathena-pyhesiodfs (0.0.r157-0debathena1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Evan Broder <broder@mit.edu>  Tue, 11 Nov 2008 14:19:15 -0500
+
+debathena-pyhesiodfs (0.0.r150-0debathena4) unstable; urgency=low
+
+  * If /dev/fuse has group root, restart udev to work around LP #293502.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 04 Nov 2008 03:52:27 -0500
+
+debathena-pyhesiodfs (0.0.r150-0debathena3) unstable; urgency=low
+
+  * Fix a typo in the /lib/init/vars.sh part of the previous commit (which
+    was a work in progress and intentionally not committed).
+  * Revert /dev/fuse change, pending further investigation (/dev/fuse is
+    supposewd to be managed by udev).
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 04 Nov 2008 02:56:25 -0500
+
+debathena-pyhesiodfs (0.0.r150-0debathena2) unstable; urgency=low
+
+  [ Anders Kaseorg ]
+  * Don't require /lib/init/vars.sh in the initscript, so it works on
+    dapper.
+
+  [ Evan Broder ]
+  * Fixup the permission bits on /dev/fuse if they're wrong
+
+ -- Evan Broder <broder@mit.edu>  Mon, 03 Nov 2008 22:25:23 -0500
+
+debathena-pyhesiodfs (0.0.r150-0debathena1) unstable; urgency=low
+
+  * New upstream version
+  * Use PyHesiod bindings
+  * Remove the initscript for debathena-afuse-automounter on install
+  * Check properly if the package is still installed in the initscript
+  * Fix condition where fuse group might not exist when package is
+    installed
+  * Ensure permissions for /mit are correct in the initscript
+  * Don't fail to stop if the automounter is not currently running
+
+ -- Evan Broder <evan@remus.mit.edu>  Sun, 10 Aug 2008 18:49:30 -0400
+
+debathena-pyhesiodfs (0.0.r77-0debathena1) unstable; urgency=low
+
+  * Initial release
+
+ -- Evan Broder <broder@mit.edu>  Thu, 10 Jul 2008 20:33:40 -0400
+
--- debathena-pyhesiodfs-0.0.r157.orig/debian/copyright
+++ debathena-pyhesiodfs-0.0.r157/debian/copyright
@@ -0,0 +1,41 @@
+This package was debianized by Evan Broder <broder@mit.edu> on Thu, 10
+Jul 2008 20:33:40 -0400.
+
+It was downloaded from
+<http://macathena.mit.edu/dist/pyhesiodfs-svn77.tar.gz>
+
+Upstream Author: 
+
+    Quentin Smith <quentin@mit.edu>
+
+Copyright: 
+
+    Copyright (C) 2007 Quentin Smith
+
+License:
+
+    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.
+    
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+    02110-1301 USA.
+
+pyHesiodFS is released under the GPL, see `/usr/share/common-licenses/GPL'.
+
+pyHesiodFS is based on hello.py, an example Python FUSE filesystem
+available from the python-fuse package at
+`/usr/share/doc/python-fuse/examples/hello.py'. This example is
+released under the LGPL, see `/usr/share/common-licenses/LGPL'.
+
+This Debian package was created as part of the Debian-Athena Project
+<http://web.mit.edu/debathena/www/> of the MIT Student Information
+Processing Board, and is released to the public domain.
--- debathena-pyhesiodfs-0.0.r157.orig/debian/debathena-pyhesiodfs.init
+++ debathena-pyhesiodfs-0.0.r157/debian/debathena-pyhesiodfs.init
@@ -0,0 +1,135 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          debathena-pyhesiodfs
+# Required-Start:    openafs-client
+# Required-Stop:     openafs-client
+# Should-Start:      $local_fs $network
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Hesiod automounter for Athena lockers
+# Description:       Auto-create symlinks from /mit/LOCKER to AFS using Hesiod lookups.
+### END INIT INFO
+
+# Author: Evan Broder <broder@mit.edu>, Geoffrey Thomas <geofft@mit.edu>
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Debathena /mit automounter"
+NAME=debathena-pyhesiodfs
+DAEMON=/usr/bin/pyhesiodfs
+pyhesiodfs_dir="/mit"
+DAEMON_ARGS="-f $pyhesiodfs_dir"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+: ${VERBOSE:=yes}
+if [ -f /lib/init/vars.sh ]; then
+    . /lib/init/vars.sh
+elif [ -f /etc/default/rcS ]; then
+    . /etc/default/rcS
+fi
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+    # Return
+    #   0 if daemon has been started
+    #   1 if daemon was already running
+    #   2 if daemon could not be started
+    
+    # Try to make sure fuse is setup
+    [ -e /dev/fuse ] || modprobe fuse || return 2
+    
+    if cat /proc/mounts | grep " $pyhesiodfs_dir " >/dev/null 2>&1; then
+	return 1
+    fi
+    
+    mkdir -p "$pyhesiodfs_dir"
+    chown root:pyhesiodfs "$pyhesiodfs_dir"
+    chmod 770 "$pyhesiodfs_dir"
+    
+    start-stop-daemon --start --quiet --pidfile $PIDFILE \
+        --chuid pyhesiodfs:pyhesiodfs --background \
+        --make-pidfile \
+	--exec $DAEMON -- \
+        $DAEMON_ARGS \
+        || return 2
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+    # Return
+    #   0 if daemon has been stopped
+    #   1 if daemon was already stopped
+    #   2 if daemon could not be stopped
+    #   other if a failure occurred
+    
+    if cat /proc/mounts | grep " $pyhesiodfs_dir " >/dev/null 2>&1; then
+        umount -l "$pyhesiodfs_dir" || return 2
+        # Many daemons don't delete their pidfiles when they exit.
+	rm -f "$PIDFILE"
+    else
+	return 1
+    fi
+}
+
+case "$1" in
+    start)
+        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+        do_start
+        case "$?" in
+            0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+            2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+        esac
+        ;;
+    stop)
+        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+        do_stop
+        case "$?" in
+            0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+            2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+        esac
+        ;;
+    restart|force-reload)
+        log_daemon_msg "Restarting $DESC" "$NAME"
+        do_stop
+        case "$?" in
+            0|1)
+                do_start
+                case "$?" in
+                    0) log_end_msg 0 ;;
+                    1) log_end_msg 1 ;; # Old process is still running
+                    *) log_end_msg 1 ;; # Failed to start
+                esac
+                ;;
+            *)
+                # Failed to stop
+                log_end_msg 1
+                ;;
+        esac
+        ;;
+    *)
+        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+        exit 3
+        ;;
+esac
+
+:
--- debathena-pyhesiodfs-0.0.r157.orig/debian/debathena-pyhesiodfs.postinst
+++ debathena-pyhesiodfs-0.0.r157/debian/debathena-pyhesiodfs.postinst
@@ -0,0 +1,53 @@
+#!/bin/sh
+# postinst script for debathena-python-pyhesiodfs
+#
+# 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
+
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+case "$1" in
+    configure)
+        adduser pyhesiodfs fuse
+        
+	if hash invoke-rc.d 2>/dev/null; then
+	    # If /dev/fuse has group root, restart udev to work around
+	    # <https://bugs.launchpad.net/ubuntu/+source/fuse/+bug/293502>
+	    [ "$(stat -c %g /dev/fuse)" != 0 ] || invoke-rc.d udev restart || :
+	    invoke-rc.d debathena-pyhesiodfs restart
+	else
+	    [ "$(stat -c %g /dev/fuse)" != 0 ] || /etc/init.d/udev restart || :
+	    /etc/init.d/debathena-pyhesiodfs restart
+	fi
+        update-rc.d -f debathena-afuse-automounter remove >/dev/null || :
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+exit 0
+
+
--- debathena-pyhesiodfs-0.0.r157.orig/debian/debathena-pyhesiodfs.postrm
+++ debathena-pyhesiodfs-0.0.r157/debian/debathena-pyhesiodfs.postrm
@@ -0,0 +1,46 @@
+#!/bin/sh
+# postrm script for #PACKAGE#
+#
+# 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' <overwriter>
+#          <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    purge)
+	if getent passwd pyhesiodfs >/dev/null; then
+	    deluser --system pyhesiodfs || :
+	fi
+	if getent group pyhesiodfs >/dev/null; then
+	    delgroup --system pyhesiodfs || :
+	fi
+	;;
+    
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    *)
+        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
--- debathena-pyhesiodfs-0.0.r157.orig/debian/debathena-pyhesiodfs.preinst
+++ debathena-pyhesiodfs-0.0.r157/debian/debathena-pyhesiodfs.preinst
@@ -0,0 +1,38 @@
+#!/bin/sh
+# preinst script for debathena-pyhesiodfs
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <new-preinst> `install'
+#        * <new-preinst> `install' <old-version>
+#        * <new-preinst> `upgrade' <old-version>
+#        * <old-preinst> `abort-upgrade' <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    install|upgrade)
+	if ! getent passwd pyhesiodfs >/dev/null; then
+	    adduser --system --no-create-home --group pyhesiodfs
+	fi
+	;;
+    
+    abort-upgrade)
+	;;
+    
+    *)
+        echo "preinst 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
--- debathena-pyhesiodfs-0.0.r157.orig/debian/rules
+++ debathena-pyhesiodfs-0.0.r157/debian/rules
@@ -0,0 +1,21 @@
+#!/usr/bin/make -f
+
+DEB_DIVERT_EXTENSION = .debathena
+DEB_DIVERT_FILES_debathena-pyhesiodfs += \
+	/etc/fuse.conf.debathena
+DEB_PYTHON_SYSTEM=pysupport
+
+ifneq ($(shell grep RESTART_AFTER_UPGRADE /usr/bin/dh_installinit),)
+	DEB_DH_INSTALLINIT_ARGS += --restart-after-upgrade
+endif
+
+clean::
+	if [ -f pyhesiodfs ]; then mv pyhesiodfs pyHesiodFS.py; fi
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
+include /usr/share/cdbs/1/rules/config-package.mk
+include /usr/share/cdbs/1/class/python-distutils.mk
+
+common-configure-indep::
+	if [ -f pyHesiodFS.py ]; then mv pyHesiodFS.py pyhesiodfs; fi
--- debathena-pyhesiodfs-0.0.r157.orig/debian/debathena-pyhesiodfs.install
+++ debathena-pyhesiodfs-0.0.r157/debian/debathena-pyhesiodfs.install
@@ -0,0 +1 @@
+debian/fuse.conf.debathena etc/
--- debathena-pyhesiodfs-0.0.r157.orig/debian/pycompat
+++ debathena-pyhesiodfs-0.0.r157/debian/pycompat
@@ -0,0 +1 @@
+2
--- debathena-pyhesiodfs-0.0.r157.orig/debian/patches/install-script-without-extension.patch
+++ debathena-pyhesiodfs-0.0.r157/debian/patches/install-script-without-extension.patch
@@ -0,0 +1,11 @@
+Index: debathena-pyhesiodfs/setup.py
+===================================================================
+--- debathena-pyhesiodfs.orig/setup.py
++++ debathena-pyhesiodfs/setup.py	
+@@ -11,5 +11,5 @@
+       author='Quentin Smith',
+       author_email='pyhesiodfs@mit.edu',
+-      scripts=['pyHesiodFS.py'],
++      scripts=['pyhesiodfs'],
+       requires=['PyHesiod (>=0.2.0)'],
+       **extra_options)
--- debathena-pyhesiodfs-0.0.r157.orig/debian/patches/no-hello.patch
+++ debathena-pyhesiodfs-0.0.r157/debian/patches/no-hello.patch
@@ -0,0 +1,75 @@
+
+Index: debathena-pyhesiodfs-0.0.r157/pyHesiodFS.py
+===================================================================
+--- debathena-pyhesiodfs-0.0.r157.orig/pyHesiodFS.py	2008-11-11 14:20:55.000000000 -0500
++++ debathena-pyhesiodfs-0.0.r157/pyHesiodFS.py	2008-11-11 14:21:15.000000000 -0500
+@@ -20,13 +20,6 @@
+ 
+ fuse.fuse_python_api = (0, 2)
+ 
+-hello_path = '/README.txt'
+-hello_str = """This is the pyhesiodfs FUSE autmounter. To access a Hesiod filsys, just access
+-%(mountpoint)s/name.
+-
+-If you're using the Finder, try pressing Cmd+Shift+G and then entering
+-%(mountpoint)s/name"""
+-
+ if not hasattr(fuse, 'Stat'):
+     fuse.Stat = object
+ 
+@@ -72,10 +65,6 @@
+         if path == '/':
+             st.st_mode = stat.S_IFDIR | 0755
+             st.st_nlink = 2
+-        elif path == hello_path:
+-            st.st_mode = stat.S_IFREG | 0444
+-            st.st_nlink = 1
+-            st.st_size = len(hello_str)
+         elif '/' not in path[1:]:
+             if self.findLocker(path[1:]):
+                 st.st_mode = stat.S_IFLNK | 0777
+@@ -121,7 +110,7 @@
+                 return None
+ 
+     def getdir(self, path):
+-        return [(i, 0) for i in (['.', '..', hello_path[1:]] + self.getCachedLockers())]
++        return [(i, 0) for i in (['.', '..'] + self.getCachedLockers())]
+ 
+     def readdir(self, path, offset):
+         for (r, zero) in self.getdir(path):
+@@ -130,27 +119,7 @@
+     def readlink(self, path):
+         return self.findLocker(path[1:])
+ 
+-    def open(self, path, flags):
+-        if path != hello_path:
+-            return -errno.ENOENT
+-        accmode = os.O_RDONLY | os.O_WRONLY | os.O_RDWR
+-        if (flags & accmode) != os.O_RDONLY:
+-            return -errno.EACCES
+-
+-    def read(self, path, size, offset):
+-        if path != hello_path:
+-            return -errno.ENOENT
+-        slen = len(hello_str)
+-        if offset < slen:
+-            if offset + size > slen:
+-                size = slen - offset
+-            buf = hello_str[offset:offset+size]
+-        else:
+-            buf = ''
+-        return buf
+-
+ def main():
+-    global hello_str
+     try:
+         usage = Fuse.fusage
+         server = PyHesiodFS(version="%prog " + fuse.__version__,
+@@ -166,7 +135,6 @@
+             sys.argv.pop(1)
+         server = PyHesiodFS()
+ 
+-    hello_str = hello_str % {'mountpoint': server.parse(errex=1).mountpoint}
+     server.main()
+ 
+ if __name__ == '__main__':
--- debathena-pyhesiodfs-0.0.r157.orig/debian/patches/series
+++ debathena-pyhesiodfs-0.0.r157/debian/patches/series
@@ -0,0 +1,2 @@
+install-script-without-extension.patch
+no-hello.patch
