--- debathena-moira-4.0.0+cvs20090618.orig/debian/compat
+++ debathena-moira-4.0.0+cvs20090618/debian/compat
@@ -0,0 +1 @@
+4
--- debathena-moira-4.0.0+cvs20090618.orig/debian/debathena-moira-clients.install
+++ debathena-moira-4.0.0+cvs20090618/debian/debathena-moira-clients.install
@@ -0,0 +1,18 @@
+usr/bin/addusr
+usr/bin/blanche
+usr/bin/chfn.moira
+usr/bin/chpobox
+usr/bin/chsh.moira
+usr/bin/mitch
+usr/bin/namespace
+usr/bin/moira
+usr/bin/mrcheck
+usr/bin/mrtest
+usr/bin/stanley
+usr/bin/stella
+usr/bin/mailmaint
+usr/bin/listmaint
+usr/bin/dcmmaint
+usr/bin/usermaint
+usr/share/man/man1/*
+usr/share/man/man8/mrtest.8
--- debathena-moira-4.0.0+cvs20090618.orig/debian/control.in
+++ debathena-moira-4.0.0+cvs20090618/debian/control.in
@@ -0,0 +1,62 @@
+Source: debathena-moira
+Section: debathena/net
+Priority: extra
+Maintainer: Debathena Project <debathena@mit.edu>
+Build-Depends: @cdbs@, comerr-dev, libkrb5-dev, libhesiod-dev, libzephyr-dev, libzephyr3-krb, libreadline-dev, libncurses-dev
+Standards-Version: 3.7.2
+
+Package: debathena-moira-clients
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Clients for the Moira database
+ Moira is the Athena Service Management system.  It serves as the 
+ central repository for information about users, groups hosts, print 
+ queues, and several other aspects of the Athena environment.
+ .
+ This package contains clients such as moira, stella, blanche, etc.
+
+Package: debathena-moira-update-server
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Athena update_server
+ Moira is the Athena Service Management system.  It serves as the 
+ central repository for information about users, groups hosts, print 
+ queues, and several other aspects of the Athena environment.
+ .
+ This package contains the update_server daemon, which is used for
+ servers that automatically receive information dumps from moira.
+
+Package: debathena-libmoira0
+Section: debathena/lib
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: The Moira library
+ Moira is the Athena Service Management system.  It serves as the 
+ central repository for information about users, groups hosts, print 
+ queues, and several other aspects of the Athena environment.
+ .
+ This package contains the shared Moira library.
+
+Package: debathena-libmoira0-dbg
+Section: debathena/libdevel
+Architecture: any
+Depends: debathena-libmoira0 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Description: The Moira library - library with debugging symbols
+ Moira is the Athena Service Management system.  It serves as the 
+ central repository for information about users, groups hosts, print 
+ queues, and several other aspects of the Athena environment.
+ .
+ This package contains an unstripped shared library. It will be used
+ automatically by gdb for debugging libmoira-related issues.
+
+Package: debathena-libmoira-dev
+Section: debathena/libdevel
+Architecture: any
+Provides: libmoira-dev
+Depends: debathena-libmoira0 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, comerr-dev, libkrb5-dev, libhesiod-dev, libzephyr-dev, libzephyr3-krb
+Description: Development files for Moira library
+ Moira is the Athena Service Management system.  It serves as the 
+ central repository for information about users, groups hosts, print 
+ queues, and several other aspects of the Athena environment.
+ .
+ This package contains headers and static libraries for development.
--- debathena-moira-4.0.0+cvs20090618.orig/debian/debathena-moira-update-server.init
+++ debathena-moira-4.0.0+cvs20090618/debian/debathena-moira-update-server.init
@@ -0,0 +1,126 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          debathena-moira-update-server
+# Required-Start:    $local_fs $remote_fs
+# Required-Stop:     $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Moira update_server
+# Description:       The moira update_server program for taking updates from
+#                    moira
+### END INIT INFO
+
+# Author: Evan Broder <broder@mit.edu>
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+DESC="Moira update_server"
+NAME=debathena-moira-update-server
+DAEMON=/usr/sbin/update_server
+DAEMON_ARGS=""
+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
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+
+# 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
+	start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
+		|| return 1
+	start-stop-daemon --start --quiet --exec $DAEMON -- \
+		$DAEMON_ARGS \
+		|| return 2
+	# Add code here, if necessary, that waits for the process to be ready
+	# to handle requests from services started subsequently which depend
+	# on this one.  As a last resort, sleep for some time.
+}
+
+#
+# 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
+	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
+	RETVAL="$?"
+	[ "$RETVAL" = 2 ] && return 2
+	# Wait for children to finish too if this is a daemon that forks
+	# and if the daemon is only ever run from this initscript.
+	# If the above conditions are not satisfied then add some other code
+	# that waits for the process to drop all resources that could be
+	# needed by services started subsequently.  A last resort is to
+	# sleep for some time.
+	start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+	[ "$?" = 2 ] && return 2
+	return "$RETVAL"
+}
+
+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)
+	#
+	# If the "reload" option is implemented then remove the
+	# 'force-reload' alias
+	#
+	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-moira-4.0.0+cvs20090618.orig/debian/changelog
+++ debathena-moira-4.0.0+cvs20090618/debian/changelog
@@ -0,0 +1,79 @@
+debathena-moira (4.0.0+cvs20090618-0debathena1) unstable; urgency=low
+
+  * New upstream release
+  * Build and install libmoira as a shared library. (Trac: #70)
+  * Drop most of the krb4 patch - it's been incorporated upstream.
+  * Install the Moira development headers by patching the relevant
+    Makefiles, instead of in the debian/rules file.
+
+ -- Evan Broder <broder@mit.edu>  Sat, 20 Jun 2009 14:45:32 -0400
+
+debathena-moira (4.0.0+cvs20090409-0debathena1) unstable; urgency=low
+
+  * New CVS snapshot (Trac: #195)
+  * Drop patches that have been incorporated upstream.
+  * Add patch to allow building on systems without krb4. (Trac: #198)
+
+ -- Evan Broder <broder@mit.edu>  Sun, 12 Apr 2009 14:03:22 -0400
+
+debathena-moira (4.0.0+cvs20080830-0debathena2) unstable; urgency=low
+
+  * Remove DEB_AUTO_UPDATE_DEBIAN_CONTROL.
+  * Change "Debian-Athena Project" to "Debathena Project".
+  * Remove debian/control from version control.
+
+ -- Tim Abbott <tabbott@mit.edu>  Sat, 24 Jan 2009 15:32:35 -0500
+
+debathena-moira (4.0.0+cvs20080830-0debathena1) unstable; urgency=low
+
+  * New CVS snapshot
+  * Add a debathena-moira-update-server package that installs
+    update_server
+
+ -- Evan Broder <broder@mit.edu>  Fri, 01 Aug 2008 10:54:26 -0400
+
+debathena-moira (4.0.0+cvs20080701-0debathena1) unstable; urgency=low
+
+  * New CVS snapshot
+  * Move Moira header files from /usr/share/include to /usr/include/moira
+
+ -- Evan Broder <broder@mit.edu>  Tue, 01 Jul 2008 20:38:13 -0400
+
+debathena-moira (4.0.0+cvs20080304-0debathena1) unstable; urgency=low
+
+  * New CVS snapshot to fix chsh.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 04 Mar 2008 15:50:31 -0500
+
+debathena-moira (4.0.0+cvs20080301-0debathena1) unstable; urgency=low
+
+  * New CVS snapshot.
+  * Remove mrtest segfault patch from last release (fixed in upstream)
+
+ -- Tim Abbott <tabbott@mit.edu>  Sat,  1 Mar 2008 18:51:40 -0500
+
+debathena-moira (4.0.0+cvs20070817-0debathena1) unstable; urgency=low
+
+  * New CVS snapshot.
+  * Patch an mrtest segfault with too many command line arguments.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Fri, 24 Aug 2007 19:53:49 -0400
+
+debathena-moira (4.0.0+cvs20070129-0debathena3) unstable; urgency=low
+
+  * Move chsh.debathena to chsh.moira and chfn.debathena to chfn.moira.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Mon, 06 Aug 2007 03:17:10 -0400
+
+debathena-moira (4.0.0+cvs20070129-0debathena2) unstable; urgency=low
+
+  * Add missing build dependencies to libmoira-dev.
+  * Section: debathena/net.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 17 Jul 2007 06:34:07 -0400
+
+debathena-moira (4.0.0+cvs20070129-0debathena1) unstable; urgency=low
+
+  * Initial release.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Wed, 14 Feb 2007 00:53:24 -0500
--- debathena-moira-4.0.0+cvs20090618.orig/debian/copyright
+++ debathena-moira-4.0.0+cvs20090618/debian/copyright
@@ -0,0 +1,23 @@
+This package was debianized as part of the Debathena Project
+<http://debathena.mit.edu/> of the MIT Student Information Processing
+Board.
+
+The Moria source code was obtained from the Moira CVS repository at 
+/afs/athena.mit.edu/astaff/project/moiradev, and is licensed as follows:
+
+  Copyright © 1987-1998 by the Massachusetts Institute of Technology
+  
+  Permission to use, copy, modify, and distribute this
+  software and its documentation for any purpose and without
+  fee is hereby granted, provided that the above copyright
+  notice appear in all copies and that both that copyright
+  notice and this permission notice appear in supporting
+  documentation, and that the name of M.I.T. not be used in
+  advertising or publicity pertaining to distribution of the
+  software without specific, written prior permission.
+  M.I.T. makes no representations about the suitability of
+  this software for any purpose.  It is provided "as is"
+  without express or implied warranty.
+
+The Debian packaging is Copyright © 2007-2008 Tim Abbott and Anders
+Kaseorg, and has the same license as the original software.
--- debathena-moira-4.0.0+cvs20090618.orig/debian/debathena-libmoira-dev.install
+++ debathena-moira-4.0.0+cvs20090618/debian/debathena-libmoira-dev.install
@@ -0,0 +1,4 @@
+usr/share/man/man3/*
+usr/lib/libmoira.so
+usr/lib/libmoira.la
+usr/lib/libmoira.a
--- debathena-moira-4.0.0+cvs20090618.orig/debian/debathena-moira-update-server.install
+++ debathena-moira-4.0.0+cvs20090618/debian/debathena-moira-update-server.install
@@ -0,0 +1,4 @@
+usr/bin/update_test
+usr/sbin/update_server
+usr/share/man/man8/update_server.8
+etc/athena/moira.conf
--- debathena-moira-4.0.0+cvs20090618.orig/debian/rules
+++ debathena-moira-4.0.0+cvs20090618/debian/rules
@@ -0,0 +1,27 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
+
+KRB5_VERSION=$(shell dpkg-query -W -f '$${Version}\n' libkrb5-dev)
+ifeq (yes,$(shell dpkg --compare-versions '$(KRB5_VERSION)' lt '1.6.dfsg.4~beta1-7' && echo yes))
+    DEB_CONFIGURE_EXTRA_FLAGS += --with-krb4=$(shell krb5-config --prefix krb4)
+else
+    DEB_CONFIGURE_EXTRA_FLAGS += --without-krb4
+endif
+
+DEB_CONFIGURE_EXTRA_FLAGS += --with-krb5 --with-hesiod --with-zephyr --with-com_err=/usr --without-oracle --without-afs --disable-rpath
+DEB_DH_INSTALL_SOURCEDIR = $(DEB_DESTDIR)
+DEB_DH_STRIP_ARGS += --dbg-package=debathena-libmoira0
+
+common-install-impl::
+	mv $(DEB_DESTDIR)/usr/bin/chfn $(DEB_DESTDIR)/usr/bin/chfn.moira
+	mv $(DEB_DESTDIR)/usr/bin/chsh $(DEB_DESTDIR)/usr/bin/chsh.moira
+	mv $(DEB_DESTDIR)/usr/share/man/man1/chsh.1 \
+		$(DEB_DESTDIR)/usr/share/man/man1/chsh.moira.1
+	mv $(DEB_DESTDIR)/usr/share/man/man1/chfn.1 \
+		$(DEB_DESTDIR)/usr/share/man/man1/chfn.moira.1
+
+clean::
+	rm -f util/rsaref/Makefile
--- debathena-moira-4.0.0+cvs20090618.orig/debian/debathena-libmoira0.install
+++ debathena-moira-4.0.0+cvs20090618/debian/debathena-libmoira0.install
@@ -0,0 +1 @@
+usr/lib/libmoira.so.*
--- debathena-moira-4.0.0+cvs20090618.orig/debian/control
+++ debathena-moira-4.0.0+cvs20090618/debian/control
@@ -0,0 +1,62 @@
+Source: debathena-moira
+Section: debathena/net
+Priority: extra
+Maintainer: Debathena Project <debathena@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), autotools-dev, debhelper (>= 4.2.0), quilt, patchutils (>= 0.2.25), cdbs (>= 0.4.27), comerr-dev, libkrb5-dev, libhesiod-dev, libzephyr-dev, libzephyr3-krb, libreadline-dev, libncurses-dev
+Standards-Version: 3.7.2
+
+Package: debathena-moira-clients
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Clients for the Moira database
+ Moira is the Athena Service Management system.  It serves as the 
+ central repository for information about users, groups hosts, print 
+ queues, and several other aspects of the Athena environment.
+ .
+ This package contains clients such as moira, stella, blanche, etc.
+
+Package: debathena-moira-update-server
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Athena update_server
+ Moira is the Athena Service Management system.  It serves as the 
+ central repository for information about users, groups hosts, print 
+ queues, and several other aspects of the Athena environment.
+ .
+ This package contains the update_server daemon, which is used for
+ servers that automatically receive information dumps from moira.
+
+Package: debathena-libmoira0
+Section: debathena/lib
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: The Moira library
+ Moira is the Athena Service Management system.  It serves as the 
+ central repository for information about users, groups hosts, print 
+ queues, and several other aspects of the Athena environment.
+ .
+ This package contains the shared Moira library.
+
+Package: debathena-libmoira0-dbg
+Section: debathena/libdevel
+Architecture: any
+Depends: debathena-libmoira0 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Description: The Moira library - library with debugging symbols
+ Moira is the Athena Service Management system.  It serves as the 
+ central repository for information about users, groups hosts, print 
+ queues, and several other aspects of the Athena environment.
+ .
+ This package contains an unstripped shared library. It will be used
+ automatically by gdb for debugging libmoira-related issues.
+
+Package: debathena-libmoira-dev
+Section: debathena/libdevel
+Architecture: any
+Provides: libmoira-dev
+Depends: debathena-libmoira0 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, comerr-dev, libkrb5-dev, libhesiod-dev, libzephyr-dev, libzephyr3-krb
+Description: Development files for Moira library
+ Moira is the Athena Service Management system.  It serves as the 
+ central repository for information about users, groups hosts, print 
+ queues, and several other aspects of the Athena environment.
+ .
+ This package contains headers and static libraries for development.
--- debathena-moira-4.0.0+cvs20090618.orig/debian/patches/install-headers
+++ debathena-moira-4.0.0+cvs20090618/debian/patches/install-headers
@@ -0,0 +1,41 @@
+Index: debathena-moira_4.0.0+cvs20090618.bak/include/Makefile.in
+===================================================================
+--- debathena-moira_4.0.0+cvs20090618.bak.orig/include/Makefile.in	2009-06-20 15:31:33.000000000 -0400
++++ debathena-moira_4.0.0+cvs20090618.bak/include/Makefile.in	2009-06-20 15:35:06.000000000 -0400
+@@ -7,6 +7,9 @@
+ SRCTOP=@top_srcdir@
+ BUILDTOP=../..
+ 
++includedir=@includedir@
++INSTALL=@INSTALL@
++
+ all:
+ 
+ clean:
+@@ -17,3 +20,5 @@
+ depend:
+ 
+ install:
++	$(SRCTOP)/mkinstalldirs $(DESTDIR)$(includedir)/moira
++	$(INSTALL) moira.h $(DESTDIR)$(includedir)/moira
+Index: debathena-moira_4.0.0+cvs20090618.bak/lib/Makefile.in
+===================================================================
+--- debathena-moira_4.0.0+cvs20090618.bak.orig/lib/Makefile.in	2009-06-20 15:31:33.000000000 -0400
++++ debathena-moira_4.0.0+cvs20090618.bak/lib/Makefile.in	2009-06-20 15:35:03.000000000 -0400
+@@ -25,6 +25,7 @@
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ libdir=@libdir@
++includedir=@includedir@
+ 
+ OBJS=	critical.lo fixhost.lo fixname.lo \
+ 	hash.lo kname_unparse.lo kname_parse.lo krb_et.lo mr_access.lo mr_auth.lo \
+@@ -54,6 +55,8 @@
+ 
+ install: all
+ 	$(LIBTOOL) --mode=install  $(INSTALL) libmoira.la $(DESTDIR)$(libdir)/libmoira.la
++	$(SRCTOP)/mkinstalldirs $(DESTDIR)$(includedir)/moira
++	$(INSTALL) mr_et.h krb_et.h ureg_err.h $(DESTDIR)$(includedir)/moira
+ 
+ libmoira.la: $(OBJS)
+ 	$(LIBTOOL) --mode=link $(CC) $(ALL_LDFLAGS) -o $@ $(OBJS) -rpath $(libdir) -version-info 0:0:0
--- debathena-moira-4.0.0+cvs20090618.orig/debian/patches/series
+++ debathena-moira-4.0.0+cvs20090618/debian/patches/series
@@ -0,0 +1,2 @@
+krb4less-fix
+install-headers
--- debathena-moira-4.0.0+cvs20090618.orig/debian/patches/krb4less-fix
+++ debathena-moira-4.0.0+cvs20090618/debian/patches/krb4less-fix
@@ -0,0 +1,13 @@
+Index: debathena-moira_4.0.0+cvs20090618.bak/lib/kname_unparse.c
+===================================================================
+--- debathena-moira_4.0.0+cvs20090618.bak.orig/lib/kname_unparse.c	2009-06-20 18:09:57.000000000 -0400
++++ debathena-moira_4.0.0+cvs20090618.bak/lib/kname_unparse.c	2009-06-20 18:10:18.000000000 -0400
+@@ -13,7 +13,7 @@
+ 
+ #include <stdio.h>
+ 
+-#ifdef HAVE_KRB5
++#ifdef HAVE_KRB4
+ #include <krb.h>
+ #else
+ #include <mr_krb.h>
