$NetBSD: patch-aa,v 1.2 2004/02/21 14:43:16 jlam Exp $

--- authlib/Makefile.in.orig	Sat Nov 15 12:54:45 2003
+++ authlib/Makefile.in
@@ -54,7 +54,7 @@ AUTHUSERDB = @AUTHUSERDB@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 
-AUTOMAKE = srcdir=${srcdir} @SHELL@ ${srcdir}/../automake.fix @AUTOMAKE@
+AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
@@ -1281,7 +1281,7 @@ info-am:
 
 install-data-am: install-data-local
 
-install-exec-am:
+install-exec-am: install-exec-local
 
 install-info: install-info-am
 
@@ -1489,9 +1489,36 @@ authinfodaemondlist.c: authdaemondstatic
 authdaemondstaticlist.c: config.status
 	@SHELL@ $(srcdir)/mkmodulelist.sh @DAEMON_STATIC_LIST@ >authdaemondstaticlist.c
 
+# This target installs the authlib daemons and password programs and is
+# largely copied from the install-exec-hook target in ../courier/Makefile.in.
+#
+install-exec-local:
+	for d in $(sbindir) $(libexecdir) $(libexecdir)/authlib ; do \
+			$(mkinstalldirs) $(DESTDIR)$$d || exit 1; done
+	for f in `cat ../authlib/installlist`; do test -z "$$f" && continue; \
+		test -f ../authlib/$$f || continue; \
+		$(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) ../authlib/$$f \
+			$(DESTDIR)$(libexecdir)/authlib/$$f ; done
+	for f in `cat ../authlib/installlist.sh`; do test -z "$$f" && continue; \
+		test -f ../authlib/$$f || continue; \
+		$(INSTALL_SCRIPT) ../authlib/$$f \
+			$(DESTDIR)$(libexecdir)/authlib/$$f ; done
+	$(mkinstalldirs) $(DESTDIR)@authchangepwdir@
+	. ../authlib/authpwdprogs ; for f in `echo $$PWPROGS dummy` ; do \
+		test "$$f" = "dummy" && continue ; \
+		$(INSTALL_PROGRAM) ../authlib/$$f \
+			$(DESTDIR)@authchangepwdir@/$$f ; done
+	. ../authlib/authpwdprogs ; for f in `echo $$PWSCRIPTS dummy` ; do \
+		test "$$f" = "dummy" && continue ; \
+		$(INSTALL_SCRIPT) ../authlib/$$f \
+			$(DESTDIR)$(datadir)/$$f ; \
+		rm -f $(DESTDIR)@authchangepwdir@/$$f ; \
+		$(LN_S) $(datadir)/$$f \
+			$(DESTDIR)@authchangepwdir@/$$f ; done
+
 # automake still a bit stupid...
 
-install-data-local: install-authldaprc install-authdaemonrc install-authmysqlrc install-authpgsqlrc
+install-data-local: install-authldaprc install-authmysqlrc install-authpgsqlrc
 	test "$(man_LINKS)" = "" && exit 0; \
 	$(mkinstalldirs) $(DESTDIR)$(man7dir) ; \
 	for f in $(man_MANS) "" ; do \
@@ -1501,7 +1528,6 @@ install-data-local: install-authldaprc i
 		for f in $(man_LINKS) "" ; do \
 			test "$$f" = "" && continue ; \
 			rm -f $$f; $(LN_S) authlib.7 $$f ; \
-			test -w /etc && chown bin $$f && chgrp bin $$f ; \
 			done ; exit 0
 
 uninstall-local: uninstall-authldaprc uninstall-authdaemonrc uninstall-authmysqlrc uninstall-authpgsqlrc
