--- debathena-grenew-10.0.0.orig/aclocal.m4
+++ debathena-grenew-10.0.0/aclocal.m4
@@ -194,7 +194,8 @@
 dnl ----- Kerberos 4 -----
 
 AC_DEFUN([ATHENA_KRB4_CHECK],
-[AC_CHECK_FUNC(gethostbyname, :, AC_CHECK_LIB(nsl, gethostbyname))
+[AC_REQUIRE([AC_CANONICAL_TARGET])
+AC_CHECK_FUNC(gethostbyname, :, AC_CHECK_LIB(nsl, gethostbyname))
 AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket))
 AC_CHECK_LIB(gen, compile)
 if test "$krb4" != yes; then
@@ -210,7 +211,12 @@
 			   [KRB4_LIBS="-lkrb -ldes"],
 			   [AC_MSG_ERROR(Kerberos 4 libraries not found)],
 			   -ldes)],
-	     -ldes425 -lkrb5 -lk5crypto -lcom_err)])
+	     -ldes425 -lkrb5 -lk5crypto -lcom_err)
+if test "$KRB4_LIBS" != "" ; then
+	case "$target_os" in
+	darwin*) KRB4_LIBS="$KRB4_LIBS -framework Kerberos"
+	esac
+fi])
 
 AC_DEFUN([ATHENA_KRB4],
 [AC_ARG_WITH(krb4,
@@ -236,7 +242,8 @@
 dnl ----- Kerberos 5 -----
 
 AC_DEFUN([ATHENA_KRB5_CHECK],
-[AC_SEARCH_LIBS(gethostbyname, nsl)
+[AC_REQUIRE([AC_CANONICAL_TARGET])
+AC_SEARCH_LIBS(gethostbyname, nsl)
 AC_SEARCH_LIBS(socket, socket)
 AC_CHECK_LIB(gen, compile)
 if test "$krb5" != yes; then
@@ -254,6 +261,11 @@
 if test "$krb5" != no; then
 	ATHENA_KRB5_CHECK
 	KRB5_LIBS="-lkrb5 -lk5crypto -lcom_err"
+	if test "$KRB5_LIBS" != "" ; then
+		case "$target_os" in
+		darwin*) KRB5_LIBS="$KRB5_LIBS -framework Kerberos"
+		esac
+	fi
 	AC_DEFINE(HAVE_KRB5)
 fi
 AC_SUBST(KRB5_LIBS)])
--- debathena-grenew-10.0.0.orig/debian/copyright
+++ debathena-grenew-10.0.0/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 Athena source code was obtained from the Athena SVN repository at
+<svn://debathena.mit.edu/athena/trunk>, and is licensed as follows:
+
+  Copyright © 1996 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-grenew-10.0.0.orig/debian/changelog
+++ debathena-grenew-10.0.0/debian/changelog
@@ -0,0 +1,22 @@
+debathena-grenew (10.0.0-0debathena2) unstable; urgency=low
+
+  * Change DEB_AUTO_UPDATE_AUTOCONF to 2.50, not 1.
+  * Remove DEB_AUTO_UPDATE_DEBIAN_CONTROL.
+  * Change "Debian-Athena Project" to "Debathena Project".
+  * Remove debian/control from version control.
+  * Clean up debian/copyright.
+
+ -- Tim Abbott <tabbott@mit.edu>  Sat, 24 Jan 2009 15:20:43 -0500
+
+debathena-grenew (10.0.0-0debathena1) unstable; urgency=low
+
+  * Add a desktop item.
+  * Describe the package correctly.
+
+ -- Greg Hudson <ghudson@mit.edu>  Thu, 19 Jun 2008 16:41:37 -0400
+
+debathena-grenew (9.4.0+cvs20060726-0debathena1) unstable; urgency=low
+
+  * Initial release.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Wed, 15 Aug 2007 22:48:22 -0400
--- debathena-grenew-10.0.0.orig/debian/compat
+++ debathena-grenew-10.0.0/debian/compat
@@ -0,0 +1 @@
+4
--- debathena-grenew-10.0.0.orig/debian/debathena-grenew.install
+++ debathena-grenew-10.0.0/debian/debathena-grenew.install
@@ -0,0 +1 @@
+debian/grenew.desktop usr/share/applications
--- debathena-grenew-10.0.0.orig/debian/rules
+++ debathena-grenew-10.0.0/debian/rules
@@ -0,0 +1,10 @@
+#!/usr/bin/make -f
+
+DEB_AUTO_UPDATE_AUTOCONF = 2.50
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk
+
+DEB_CONFIGURE_EXTRA_FLAGS += --with-krb4=$(shell krb5-config --prefix krb4) --with-krb5
+
+clean::
+	rm -f configure
--- debathena-grenew-10.0.0.orig/debian/control
+++ debathena-grenew-10.0.0/debian/control
@@ -0,0 +1,13 @@
+Source: debathena-grenew
+Section: debathena/gnome
+Priority: extra
+Maintainer: Debathena Project <debathena@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), autotools-dev, debhelper (>= 4.2.0), autoconf, libkrb5-dev, libgtk2.0-dev
+Standards-Version: 3.7.2
+
+Package: debathena-grenew
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Graphical dialog to renew Athena credentials
+ The grenew program prompts the user for his or her Kerberos password
+ and uses it to renew credentials for the Athena environment.
--- debathena-grenew-10.0.0.orig/debian/control.in
+++ debathena-grenew-10.0.0/debian/control.in
@@ -0,0 +1,13 @@
+Source: debathena-grenew
+Section: debathena/gnome
+Priority: extra
+Maintainer: Debathena Project <debathena@mit.edu>
+Build-Depends: @cdbs@, libkrb5-dev, libgtk2.0-dev
+Standards-Version: 3.7.2
+
+Package: debathena-grenew
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Graphical dialog to renew Athena credentials
+ The grenew program prompts the user for his or her Kerberos password
+ and uses it to renew credentials for the Athena environment.
--- debathena-grenew-10.0.0.orig/debian/grenew.desktop
+++ debathena-grenew-10.0.0/debian/grenew.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Name=Renew Authentication
+Comment=You will need to renew every 10 hours of a login session.
+Exec=grenew
+Terminal=false
+Type=Application
+Icon=gnome-run
+Categories=System;
