summaryrefslogtreecommitdiff
path: root/security/PAM
diff options
context:
space:
mode:
authorjlam <jlam>2004-11-16 07:46:57 +0000
committerjlam <jlam>2004-11-16 07:46:57 +0000
commit4ba99a1e0c692e047c472338161370eae7c154f8 (patch)
treea66fff95b854bc51b090d95257e7cf782b651ae3 /security/PAM
parent0285583117a0540f98fa705125dfbc6bd1739cc0 (diff)
downloadpkgsrc-4ba99a1e0c692e047c472338161370eae7c154f8.tar.gz
Libtoolize security/PAM so that the appropriate options are passed to
the compiler to build shared modules, and so that it builds correctly across different platforms. Bump the PKGREVISION. In particular, this should fix problems building this package on NetBSD/amd64.
Diffstat (limited to 'security/PAM')
-rw-r--r--security/PAM/Makefile25
-rw-r--r--security/PAM/PLIST73
-rw-r--r--security/PAM/buildlink3.mk3
-rw-r--r--security/PAM/distinfo22
-rw-r--r--security/PAM/patches/patch-ab21
-rw-r--r--security/PAM/patches/patch-ac21
-rw-r--r--security/PAM/patches/patch-ad138
-rw-r--r--security/PAM/patches/patch-ae126
-rw-r--r--security/PAM/patches/patch-af117
-rw-r--r--security/PAM/patches/patch-ag69
-rw-r--r--security/PAM/patches/patch-ah96
-rw-r--r--security/PAM/patches/patch-at40
-rw-r--r--security/PAM/patches/patch-au95
-rw-r--r--security/PAM/patches/patch-av101
-rw-r--r--security/PAM/patches/patch-aw137
-rw-r--r--security/PAM/patches/patch-ax13
16 files changed, 929 insertions, 168 deletions
diff --git a/security/PAM/Makefile b/security/PAM/Makefile
index eea7460a5c2..c68f683467e 100644
--- a/security/PAM/Makefile
+++ b/security/PAM/Makefile
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.28 2004/10/03 00:18:07 tv Exp $
+# $NetBSD: Makefile,v 1.29 2004/11/16 07:46:57 jlam Exp $
#
DISTNAME= Linux-PAM-0.77
PKGNAME= ${DISTNAME:S/Linux-//}
-PKGREVISION= 2
+PKGREVISION= 3
CATEGORIES= security
MASTER_SITES= http://www.kernel.org/pub/linux/libs/pam/pre/library/ \
ftp://ftp.kernel.org/pub/linux/libs/pam/pre/library/ \
@@ -19,6 +19,7 @@ PKG_INSTALLATION_TYPES= overwrite pkgviews
USE_BUILDLINK3= yes
USE_PKGINSTALL= yes
USE_GNU_TOOLS+= make
+USE_LIBTOOL= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --enable-docdir=${PREFIX}/share/doc/PAM
@@ -58,16 +59,16 @@ CONFIGURE_ARGS+= --without-libcrack
PLIST_SUBST+= USE_LIBCRACK="@comment "
.endif
-.if defined(LDCONFIG) && !exists(${LDCONFIG})
-LDCONFIG=
-.endif
-MAKE_ENV+= PKG_LDCONFIG=${LDCONFIG}
-
.if !empty(OPSYS:M*BSD)
CFLAGS+= -DUSE_GETLOGIN=1
.endif
MAKE_FLAGS+= OS_CFLAGS="${CFLAGS}"
+# pam_userdb uses ndbm if it finds it, otherwise it will use Berkeley DB.
+.if !exists(/usr/include/ndbm.h)
+. include "../../mk/bdb.buildlink3.mk"
+.endif
+
PKG_SYSCONFSUBDIR?= pam
EGDIR= ${PREFIX}/share/examples/${PKGBASE}
@@ -84,10 +85,15 @@ CONF_FILES= ${EGDIR}/pam.conf ${PKG_SYSCONFBASEDIR}/pam.conf
.for FILE in ${CFILES}
CONF_FILES+= ${EGDIR}/${FILE} ${PKG_SYSCONFDIR}/${FILE}
.endfor
-
-.include "../../mk/bdb.buildlink3.mk"
+SPECIAL_PERMS= ${PREFIX}/sbin/unix_chkpwd ${SETUID_ROOT_PERMS}
post-configure:
+ cd ${WRKSRC}; for file in Make.Rules; do \
+ ${SED} -e "s|@LIBTOOL@|${LIBTOOL}|g" \
+ -e "s|@SHLIBTOOL@|${SHLIBTOOL}|g" \
+ $$file > $$file.new; \
+ ${MV} -f $$file.new $$file; \
+ done
cd ${WRKSRC}; for file in libpam/pam_private.h; do \
${SED} -e "s|/etc/|${PKG_SYSCONFBASEDIR}/|g" \
$$file > $$file.new; \
@@ -110,6 +116,5 @@ post-install:
${INSTALL_DATA} ${WRKSRC}/security/modules/pam_limits/limits.skel \
${EGDIR}/limits.conf
.endif
- ${INSTALL_DATA_DIR} ${DOCDIR}
.include "../../mk/bsd.pkg.mk"
diff --git a/security/PAM/PLIST b/security/PAM/PLIST
index 5713517f5b6..9ff54bce459 100644
--- a/security/PAM/PLIST
+++ b/security/PAM/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.5 2003/05/22 14:36:06 wiz Exp $
+@comment $NetBSD: PLIST,v 1.6 2004/11/16 07:46:57 jlam Exp $
include/security/_pam_aconf.h
include/security/_pam_compat.h
include/security/_pam_macros.h
@@ -8,51 +8,42 @@ include/security/pam_client.h
include/security/pam_filter.h
include/security/pam_misc.h
include/security/pam_modules.h
-lib/libpam.a
-lib/libpam.so
-lib/libpam.so.0
-lib/libpam.so.${PKGVERSION}
-lib/libpam_misc.a
-lib/libpam_misc.so
-lib/libpam_misc.so.0
-lib/libpam_misc.so.${PKGVERSION}
-lib/libpamc.a
-lib/libpamc.so
-lib/libpamc.so.0
-lib/libpamc.so.${PKGVERSION}
-lib/security/pam_access.so
-${USE_LIBCRACK}lib/security/pam_cracklib.so
-lib/security/pam_debug.so
-lib/security/pam_deny.so
-lib/security/pam_env.so
-lib/security/pam_filter.so
+lib/libpam.la
+lib/libpam_misc.la
+lib/libpamc.la
+lib/security/pam_access.la
+${USE_LIBCRACK}lib/security/pam_cracklib.la
+lib/security/pam_debug.la
+lib/security/pam_deny.la
+lib/security/pam_env.la
+lib/security/pam_filter.la
lib/security/pam_filter/upperLOWER
-lib/security/pam_ftp.so
-lib/security/pam_group.so
-lib/security/pam_issue.so
-lib/security/pam_lastlog.so
-${PAM_LIMITS}lib/security/pam_limits.so
-lib/security/pam_listfile.so
-lib/security/pam_mail.so
-lib/security/pam_mkhomedir.so
-lib/security/pam_motd.so
-lib/security/pam_nologin.so
-lib/security/pam_permit.so
-lib/security/pam_rhosts_auth.so
-lib/security/pam_rootok.so
-lib/security/pam_securetty.so
-lib/security/pam_shells.so
-lib/security/pam_stress.so
-lib/security/pam_tally.so
-lib/security/pam_time.so
-lib/security/pam_unix.so
+lib/security/pam_ftp.la
+lib/security/pam_group.la
+lib/security/pam_issue.la
+lib/security/pam_lastlog.la
+${PAM_LIMITS}lib/security/pam_limits.la
+lib/security/pam_listfile.la
+lib/security/pam_mail.la
+lib/security/pam_mkhomedir.la
+lib/security/pam_motd.la
+lib/security/pam_nologin.la
+lib/security/pam_permit.la
+lib/security/pam_rhosts_auth.la
+lib/security/pam_rootok.la
+lib/security/pam_securetty.la
+lib/security/pam_shells.la
+lib/security/pam_stress.la
+lib/security/pam_tally.la
+lib/security/pam_time.la
+lib/security/pam_unix.la
lib/security/pam_unix_acct.so
lib/security/pam_unix_auth.so
lib/security/pam_unix_passwd.so
lib/security/pam_unix_session.so
-lib/security/pam_userdb.so
-lib/security/pam_warn.so
-lib/security/pam_wheel.so
+lib/security/pam_userdb.la
+lib/security/pam_warn.la
+lib/security/pam_wheel.la
man/man3/pam_authenticate.3
man/man3/pam_chauthtok.3
man/man3/pam_close_session.3
diff --git a/security/PAM/buildlink3.mk b/security/PAM/buildlink3.mk
index 31bbec98354..60218ab87f0 100644
--- a/security/PAM/buildlink3.mk
+++ b/security/PAM/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.14 2004/05/17 21:32:34 seb Exp $
+# $NetBSD: buildlink3.mk,v 1.15 2004/11/16 07:46:57 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
PAM_BUILDLINK3_MK:= ${PAM_BUILDLINK3_MK}+
@@ -12,6 +12,7 @@ BUILDLINK_PACKAGES+= pam
.if !empty(PAM_BUILDLINK3_MK:M+)
BUILDLINK_DEPENDS.pam+= PAM>=0.75
+BUILDLINK_RECOMMENDED.pam+= PAM>=0.77nb3
BUILDLINK_PKGSRCDIR.pam?= ../../security/PAM
.endif # PAM_BUILDLINK3_MK
diff --git a/security/PAM/distinfo b/security/PAM/distinfo
index 752c9e7f3ed..ed8fe52da5b 100644
--- a/security/PAM/distinfo
+++ b/security/PAM/distinfo
@@ -1,15 +1,15 @@
-$NetBSD: distinfo,v 1.9 2004/01/08 00:07:26 jlam Exp $
+$NetBSD: distinfo,v 1.10 2004/11/16 07:46:57 jlam Exp $
SHA1 (Linux-PAM-0.77.tar.gz) = 58dff29aec3c0b6a9e9b53af6fb643056ce0f304
Size (Linux-PAM-0.77.tar.gz) = 442569 bytes
SHA1 (patch-aa) = 99f4889c24ff71a9e40e0e913d6071b78a326877
-SHA1 (patch-ab) = c0257ace9538c4cf623a476e602eac30d42301d6
-SHA1 (patch-ac) = 9153b5aa54c68dc07deb6325a9ea03dbc28e1624
-SHA1 (patch-ad) = 2f4a7f03d60a160ab89d772708c1b612e6c0dabf
-SHA1 (patch-ae) = 8cdf38fddfb3e30a2bd220f3c2a83cec26918a2b
-SHA1 (patch-af) = 966d42796a99d38dfa9bbdefb3daf7c48122fc88
-SHA1 (patch-ag) = f7673f80592466e1cdeb22645a620aaa3602903d
-SHA1 (patch-ah) = 30e13e82faa3b8978e28725b7c8cd8577aab8beb
+SHA1 (patch-ab) = 02fbb08bc8f74860eada3bdb23333ec5c191f124
+SHA1 (patch-ac) = dfd528bc187fcfeaedaee0418549ac6a65c644f4
+SHA1 (patch-ad) = 9e43f70d1b772727c0ef4e14e6cb12a15128c9a3
+SHA1 (patch-ae) = a630453cc887fabee3a52cceea1e2aa5cec3f9ca
+SHA1 (patch-af) = a6ca640f46457998146f4ea5efb06577b76fc57d
+SHA1 (patch-ag) = 6329935d62d0ff82b6bf12783a600ccee28032aa
+SHA1 (patch-ah) = 5fb98628d5fcec8a7a76f3743d5e960b3279ba18
SHA1 (patch-ai) = 950c9e949c72eaf904452d8afefc0f994101e5a8
SHA1 (patch-aj) = d47bc58c3dc810497290d6ec4a3646380b5fa4d7
SHA1 (patch-ak) = 491aa837ee756269d57d642aeba999d1f8cc8187
@@ -21,4 +21,8 @@ SHA1 (patch-ap) = 0a923b67a909dde6f72129b0c853088f9d48bd91
SHA1 (patch-aq) = 91587c5b9c6587221708247decb0e82f665ae2bf
SHA1 (patch-ar) = b8072ebbc1a38c26d44c0e087a2b8b93f1eb7768
SHA1 (patch-as) = e4fdfef53c097985c2aa8ff8225fed1caa812c10
-SHA1 (patch-at) = 9a4dff60d5ce77a1a0792cd98e847ce946b49765
+SHA1 (patch-at) = c4ec24d53daf467a05b7e5875625d4ba37288cb1
+SHA1 (patch-au) = 21000d628f7d1c99ea8914069f1db41fc37dcab0
+SHA1 (patch-av) = bc74f55d71f84abe3c3c80b970b049343c3716af
+SHA1 (patch-aw) = fe1ddef649a736459ff998b6abd96d7b3f522838
+SHA1 (patch-ax) = 16f4ef37306f05a9792684440a802bed727b03df
diff --git a/security/PAM/patches/patch-ab b/security/PAM/patches/patch-ab
index c622a83c854..3dca9947344 100644
--- a/security/PAM/patches/patch-ab
+++ b/security/PAM/patches/patch-ab
@@ -1,4 +1,4 @@
-$NetBSD: patch-ab,v 1.3 2002/12/23 21:23:58 jlam Exp $
+$NetBSD: patch-ab,v 1.4 2004/11/16 07:46:57 jlam Exp $
--- configure.in.orig Tue Jul 9 02:17:13 2002
+++ configure.in
@@ -34,22 +34,3 @@ $NetBSD: patch-ab,v 1.3 2002/12/23 21:23:58 jlam Exp $
/usr/local/lib /usr/local/share/lib"
DICT_FILE_CANDIDATES="pw_dict cracklib_dict"
CRACKLIB_DICTPATH=""
-@@ -305,6 +312,18 @@ if test "$GCC" = yes; then
- case $OS in
- linux)
- OS_CFLAGS="-ansi -D_POSIX_SOURCE -pedantic"
-+ LD_D="gcc -shared -Xlinker -x"
-+ WARNINGS="$GCC_WARNINGS"
-+ PIC="-fPIC"
-+ DYNTYPE=so
-+ LD=ld
-+ LD_L="$LD -x -shared"
-+ RANLIB=ranlib
-+ STRIP=strip
-+ CC_STATIC="-Xlinker -export-dynamic"
-+ ;;
-+ netbsd)
-+ OS_CFLAGS=""
- LD_D="gcc -shared -Xlinker -x"
- WARNINGS="$GCC_WARNINGS"
- PIC="-fPIC"
diff --git a/security/PAM/patches/patch-ac b/security/PAM/patches/patch-ac
index ec194130fc6..881e5d4df87 100644
--- a/security/PAM/patches/patch-ac
+++ b/security/PAM/patches/patch-ac
@@ -1,4 +1,4 @@
-$NetBSD: patch-ac,v 1.3 2002/12/23 21:23:58 jlam Exp $
+$NetBSD: patch-ac,v 1.4 2004/11/16 07:46:57 jlam Exp $
--- configure.orig Tue Jul 9 02:17:13 2002
+++ configure
@@ -201,22 +201,3 @@ $NetBSD: patch-ac,v 1.3 2002/12/23 21:23:58 jlam Exp $
/usr/local/lib /usr/local/share/lib"
DICT_FILE_CANDIDATES="pw_dict cracklib_dict"
CRACKLIB_DICTPATH=""
-@@ -2475,6 +2612,18 @@ if test "$GCC" = yes; then
- case $OS in
- linux)
- OS_CFLAGS="-ansi -D_POSIX_SOURCE -pedantic"
-+ LD_D="gcc -shared -Xlinker -x"
-+ WARNINGS="$GCC_WARNINGS"
-+ PIC="-fPIC"
-+ DYNTYPE=so
-+ LD=ld
-+ LD_L="$LD -x -shared"
-+ RANLIB=ranlib
-+ STRIP=strip
-+ CC_STATIC="-Xlinker -export-dynamic"
-+ ;;
-+ netbsd)
-+ OS_CFLAGS=""
- LD_D="gcc -shared -Xlinker -x"
- WARNINGS="$GCC_WARNINGS"
- PIC="-fPIC"
diff --git a/security/PAM/patches/patch-ad b/security/PAM/patches/patch-ad
index 77377e93698..215a838e2a0 100644
--- a/security/PAM/patches/patch-ad
+++ b/security/PAM/patches/patch-ad
@@ -1,7 +1,7 @@
-$NetBSD: patch-ad,v 1.4 2004/01/08 00:07:26 jlam Exp $
+$NetBSD: patch-ad,v 1.5 2004/11/16 07:46:57 jlam Exp $
---- libpam/Makefile.orig Sun Dec 9 16:44:58 2001
-+++ libpam/Makefile Thu Sep 11 19:50:44 2003
+--- libpam/Makefile.orig 2001-12-09 16:44:58.000000000 -0500
++++ libpam/Makefile
@@ -6,7 +6,7 @@
include ../Make.Rules
@@ -11,15 +11,133 @@ $NetBSD: patch-ad,v 1.4 2004/01/08 00:07:26 jlam Exp $
ifeq ($(WITH_LIBDEBUG),yes)
LIBNAME=libpamd
-@@ -125,8 +125,9 @@
+@@ -36,6 +36,10 @@ LIBPAMFULL = $(LIBPAMNAME)$(MODIFICATION
+
+ LIBPAMSTATIC = $(LIBNAME).a
+
++# libtool library name
++
++LIBPAMLIBTOOL = $(LIBNAME).la
++
+ ifdef STATIC
+ @echo Did you mean to set STATIC\?
+ MODULES = $(shell cat ../modules/_static_module_objects)
+@@ -56,7 +60,7 @@ LIBOBJECTS = pam_item.o pam_strerror.o p
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+ # libpam.so needs -ldl, too.
+ DLIBOBJECTS = $(addprefix dynamic/,$(LIBOBJECTS) $(STATICOBJ))
+-ifeq ($(STATICOBJ),yes)
++ifdef STATICOBJ
+ dynamic/pam_static.o: pam_static.c ../modules/_static_module_objects
+ $(CC) $(CFLAGS) -c pam_static.c -o $@
+ endif
+@@ -70,10 +74,28 @@ static/pam_static.o: pam_static.c ../mod
+ endif
+ endif
+
++ifeq ($(LIBTOOL_LIBPAM),yes)
++LALIBOBJECTS = $(LIBOBJECTS:.o=.lo) $(STATICOBJ:.o=.lo)
++ifdef STATICOBJ
++pam_static.lo: pam_static.c ../modules/_static_module_objects
++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c pam_static.c
++endif
++endif
++
+ # ---------------------------------------------
+ ## rules
+
+-all: dirs $(LIBPAM) $(LIBPAMSTATIC) ../Make.Rules
++ifeq ($(DYNAMIC_LIBPAM),yes)
++LIBS_TO_BUILD+= $(LIBPAM)
++endif
++ifeq ($(STATIC_LIBPAM),yes)
++LIBS_TO_BUILD+= $(LIBPAMSTATIC)
++endif
++ifeq ($(LIBTOOL_LIBPAM),yes)
++LIBS_TO_BUILD+= $(LIBPAMLIBTOOL)
++endif
++
++all: dirs $(LIBS_TO_BUILD) ../Make.Rules
+
+ dirs:
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+@@ -89,6 +111,9 @@ dynamic/%.o : %.c
+ static/%.o : %.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+
++%.lo : %.c
++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
++
+ $(LIBPAM): $(DLIBOBJECTS)
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+ ifeq ($(USESONAME),yes)
+@@ -111,7 +136,26 @@ ifeq ($(STATIC_LIBPAM),yes)
+ $(RANLIB) $@
+ endif
+
+-install: all
++$(LIBPAMLIBTOOL): $(LALIBOBJECTS)
++ifeq ($(LIBTOOL_LIBPAM),yes)
++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LALIBOBJECTS) -o $@ \
++ $(MODULES) $(LINKLIBS) \
++ -rpath $(libdir) -version-info $(MAJOR_REL):$(MINOR_REL)
++endif
++
++install: all install-headers
++
++ifeq ($(DYNAMIC_LIBPAM),yes)
++install: install-dynamic
++endif
++ifeq ($(STATIC_LIBPAM),yes)
++install: install-static
++endif
++ifeq ($(LIBTOOL_LIBPAM),yes)
++install: install-libtool
++endif
++
++install-headers:
+ $(MKDIR) $(FAKEROOT)$(INCLUDED) $(FAKEROOT)$(libdir)
+ $(INSTALL) -m 644 include/security/pam_appl.h $(FAKEROOT)$(INCLUDED)
+ $(INSTALL) -m 644 include/security/pam_modules.h $(FAKEROOT)$(INCLUDED)
+@@ -121,6 +165,8 @@ install: all
+ ifdef MEMORY_DEBUG
+ $(INSTALL) -m 644 include/security/pam_malloc.h $(FAKEROOT)$(INCLUDED)
+ endif
++
++install-dynamic:
+ ifeq ($(DYNAMIC_LIBPAM),yes)
$(INSTALL) -m $(SHLIBMODE) $(LIBPAM) $(FAKEROOT)$(libdir)/$(LIBPAMFULL)
$(LDCONFIG)
- ifneq ($(DYNTYPE),"sl")
-- ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBPAM) ; \
-- ln -sf $(LIBPAMNAME) $(LIBPAM) )
-+ ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBPAM) $(LIBPAMNAME); \
-+ ln -sf $(LIBPAMFULL) $(LIBPAMNAME); \
-+ ln -sf $(LIBPAMFULL) $(LIBPAM) )
+@@ -129,10 +175,17 @@ ifeq ($(DYNAMIC_LIBPAM),yes)
+ ln -sf $(LIBPAMNAME) $(LIBPAM) )
endif
endif
++
++install-static:
ifeq ($(STATIC_LIBPAM),yes)
+ $(INSTALL) -m 644 $(LIBPAMSTATIC) $(FAKEROOT)$(libdir)
+ endif
+
++install-libtool:
++ifeq ($(LIBTOOL_LIBPAM),yes)
++ $(LIBTOOL) --mode=install $(INSTALL) -c $(LIBPAMLIBTOOL) $(FAKEROOT)$(libdir)
++endif
++
+ remove:
+ rm -f $(FAKEROOT)$(INCLUDED)/_pam_types.h
+ rm -f $(FAKEROOT)$(INCLUDED)/_pam_macros.h
+@@ -143,9 +196,13 @@ remove:
+ rm -f $(FAKEROOT)$(libdir)/$(LIBPAM)
+ $(LDCONFIG)
+ rm -f $(FAKEROOT)$(libdir)/$(LIBPAMSTATIC)
++ifeq ($(LIBTOOL_LIBPAM),yes)
++ $(LIBTOOL) --mode=uninstall rm $(FAKEROOT)$(libdir)$(LIBPAMLIBTOOL)
++endif
+
+ clean:
+ rm -f a.out core *~ static/*.o dynamic/*.o
+- rm -f *.a *.o *.so ./include/security/*~
++ rm -f *.a *.la *.lo *.o *.so .libs/* ./include/security/*~
+ if [ -d dynamic ]; then rmdir dynamic ; fi
+ if [ -d static ]; then rmdir static ; fi
++ if [ -d .libs ]; then rmdir .libs ; fi
diff --git a/security/PAM/patches/patch-ae b/security/PAM/patches/patch-ae
index 34af2839d09..bce44d12cb9 100644
--- a/security/PAM/patches/patch-ae
+++ b/security/PAM/patches/patch-ae
@@ -1,22 +1,128 @@
-$NetBSD: patch-ae,v 1.4 2003/01/13 14:18:08 grant Exp $
+$NetBSD: patch-ae,v 1.5 2004/11/16 07:46:57 jlam Exp $
---- libpam_misc/Makefile.orig Thu Jun 27 14:04:54 2002
+--- libpam_misc/Makefile.orig 2002-06-27 00:04:54.000000000 -0400
+++ libpam_misc/Makefile
-@@ -16,7 +16,7 @@ VERSION=.$(MAJOR_REL)
+@@ -16,7 +16,12 @@ VERSION=.$(MAJOR_REL)
MODIFICATION=.$(MINOR_REL)
CFLAGS += $(MOREFLAGS) $(DYNAMIC) $(STATIC)
--LINKLIBS += -L$(absolute_objdir)/libpam -lpam
-+LINKLIBS += -L$(absolute_objdir)/libpam -lpam $(LDFLAGS)
++ifeq ($(DYNAMIC_LIBPAM),yes)
+ LINKLIBS += -L$(absolute_objdir)/libpam -lpam
++endif
++ifeq ($(LIBTOOL_LIBPAM),yes)
++LINKLIBS += $(absolute_objdir)/libpam/libpam.la
++endif
# dynamic library names
-@@ -86,7 +86,7 @@ ifeq ($(DYNAMIC_LIBPAM),yes)
+@@ -28,6 +33,10 @@ LIBNAMEDFULL = $(LIBNAMEDNAME)$(MODIFICA
+
+ LIBNAMEDSTATIC = $(LIBNAME).a
+
++# libtool library name
++
++LIBNAMEDLIBTOOL = $(LIBNAME).la
++
+ LIBOBJECTS = help_env.o misc_conv.o
+
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+@@ -38,10 +47,24 @@ ifeq ($(STATIC_LIBPAM),yes)
+ SLIBOBJECTS = $(addprefix static/,$(LIBOBJECTS))
+ endif
+
++ifeq ($(LIBTOOL_LIBPAM),yes)
++LALIBOBJECTS = $(LIBOBJECTS:.o=.lo)
++endif
++
+ # ---------------------------------------------
+ ## rules
+
+-all: dirs $(LIBNAMED) $(LIBNAMEDSTATIC)
++ifeq ($(DYNAMIC_LIBPAM),yes)
++LIBS_TO_BUILD+= $(LIBNAMED)
++endif
++ifeq ($(STATIC_LIBPAM),yes)
++LIBS_TO_BUILD+= $(LIBNAMEDSTATIC)
++endif
++ifeq ($(LIBTOOL_LIBPAM),yes)
++LIBS_TO_BUILD+= $(LIBNAMEDLIBTOOL)
++endif
++
++all: dirs $(LIBS_TO_BUILD)
+
+ dirs:
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+@@ -57,6 +80,9 @@ dynamic/%.o : %.c
+ static/%.o : %.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+
++%.lo : %.c
++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
++
+ $(LIBNAMED): $(DLIBOBJECTS)
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+ ifeq ($(USESONAME),yes)
+@@ -78,9 +104,30 @@ ifeq ($(STATIC_LIBPAM),yes)
+ $(RANLIB) $@
+ endif
+
+-install: all
++$(LIBNAMEDLIBTOOL): $(LALIBOBJECTS)
++ifeq ($(LIBTOOL_LIBPAM),yes)
++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LALIBOBJECTS) -o $@ \
++ $(MODULES) $(LINKLIBS) \
++ -rpath $(libdir) -version-info $(MAJOR_REL):$(MINOR_REL)
++endif
++
++install: all install-headers
++
++ifeq ($(DYNAMIC_LIBPAM),yes)
++install: install-dynamic
++endif
++ifeq ($(STATIC_LIBPAM),yes)
++install: install-static
++endif
++ifeq ($(LIBTOOL_LIBPAM),yes)
++install: install-libtool
++endif
++
++install-headers:
+ $(MKDIR) $(FAKEROOT)$(INCLUDED)
+ $(INSTALL) -m 644 include/security/pam_misc.h $(FAKEROOT)$(INCLUDED)
++
++install-dynamic:
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+ $(MKDIR) $(FAKEROOT)$(libdir)
$(INSTALL) -m $(SHLIBMODE) $(LIBNAMED) $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL)
- $(LDCONFIG)
- ifneq ($(DYNTYPE),"sl")
-- ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) ; ln -s $(LIBNAMEDNAME) $(LIBNAMED) )
-+ ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) $(LIBNAMEDNAME); ln -s $(LIBNAMEDFULL) $(LIBNAMED); ln -s $(LIBNAMEDFULL) $(LIBNAMEDNAME) )
+@@ -89,19 +136,30 @@ ifeq ($(DYNAMIC_LIBPAM),yes)
+ ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) ; ln -s $(LIBNAMEDNAME) $(LIBNAMED) )
endif
endif
++
++install-static:
ifeq ($(STATIC_LIBPAM),yes)
+ $(INSTALL) -m 644 $(LIBNAMEDSTATIC) $(FAKEROOT)$(libdir)
+ endif
+
++install-libtool:
++ifeq ($(LIBTOOL_LIBPAM),yes)
++ $(LIBTOOL) --mode=install $(INSTALL) -c $(LIBNAMEDLIBTOOL) $(FAKEROOT)$(libdir)
++endif
++
+ remove:
+ rm -f $(FAKEROOT)$(INCLUDED)/pam_misc.h
+ rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL)
+ rm -f $(FAKEROOT)$(libdir)/$(LIBNAMED)
+ $(LDCONFIG)
+ rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDSTATIC)
++ifeq ($(LIBTOOL_LIBPAM),yes)
++ $(LIBTOOL) --mode=uninstall rm $(FAKEROOT)$(libdir)/$(LIBNAMEDLIBTOOL)
++endif
+
+ clean:
+ rm -f a.out core *~ static/*.o dynamic/*.o
+- rm -f *.a *.out *.o *.so ./include/security/*~
++ rm -f *.a *.la *.lo *.out *.o *.so .libs/* ./include/security/*~
+ if [ -d dynamic ]; then rmdir dynamic ; fi
+ if [ -d static ]; then rmdir static ; fi
++ if [ -d .libs ]; then rmdir .libs ; fi
diff --git a/security/PAM/patches/patch-af b/security/PAM/patches/patch-af
index 2a61cae0783..367a2ebe616 100644
--- a/security/PAM/patches/patch-af
+++ b/security/PAM/patches/patch-af
@@ -1,13 +1,116 @@
-$NetBSD: patch-af,v 1.3 2002/12/23 21:23:58 jlam Exp $
+$NetBSD: patch-af,v 1.4 2004/11/16 07:46:57 jlam Exp $
---- libpamc/Makefile.orig Sat Feb 10 02:17:53 2001
+--- libpamc/Makefile.orig 2001-02-10 02:17:53.000000000 -0500
+++ libpamc/Makefile
-@@ -85,7 +85,7 @@ ifeq ($(DYNAMIC_LIBPAM),yes)
+@@ -27,6 +27,10 @@ LIBNAMEDFULL = $(LIBNAMEDNAME)$(MODIFICA
+
+ LIBNAMEDSTATIC = $(LIBNAME).a
+
++# libtool library name
++
++LIBNAMEDLIBTOOL = $(LIBNAME).la
++
+ LIBOBJECTS = pamc_client.o pamc_converse.o pamc_load.o
+
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+@@ -37,10 +41,24 @@ ifeq ($(STATIC_LIBPAM),yes)
+ SLIBOBJECTS = $(addprefix static/,$(LIBOBJECTS))
+ endif
+
++ifeq ($(LIBTOOL_LIBPAM),yes)
++LALIBOBJECTS = $(LIBOBJECTS:.o=.lo)
++endif
++
+ # ---------------------------------------------
+ ## rules
+
+-all: dirs $(LIBNAMED) $(LIBNAMEDSTATIC)
++ifeq ($(DYNAMIC_LIBPAM),yes)
++LIBS_TO_BUILD+= $(LIBNAMED)
++endif
++ifeq ($(STATIC_LIBPAM),yes)
++LIBS_TO_BUILD+= $(LIBNAMEDSTATIC)
++endif
++ifeq ($(LIBTOOL_LIBPAM),yes)
++LIBS_TO_BUILD+= $(LIBNAMEDLIBTOOL)
++endif
++
++all: dirs $(LIBS_TO_BUILD)
+
+ dirs:
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+@@ -56,6 +74,9 @@ dynamic/%.o : %.c
+ static/%.o : %.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+
++%.lo : %.c
++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
++
+ $(LIBNAMED): $(DLIBOBJECTS)
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+ ifeq ($(USESONAME),yes)
+@@ -77,9 +98,30 @@ ifeq ($(STATIC_LIBPAM),yes)
+ $(RANLIB) $@
+ endif
+
+-install: all
++$(LIBNAMEDLIBTOOL): $(LALIBOBJECTS)
++ifeq ($(LIBTOOL_LIBPAM),yes)
++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LALIBOBJECTS) -o $@ \
++ $(MODULES) $(LINKLIBS) \
++ -rpath $(libdir) -version-info $(MAJOR_REL):$(MINOR_REL)
++endif
++
++install: all install-headers
++
++ifeq ($(DYNAMIC_LIBPAM),yes)
++install: install-dynamic
++endif
++ifeq ($(STATIC_LIBPAM),yes)
++install: install-static
++endif
++ifeq ($(LIBTOOL_LIBPAM),yes)
++install: install-libtool
++endif
++
++install-headers:
+ $(MKDIR) $(FAKEROOT)$(INCLUDED)
+ $(INSTALL) -m 644 include/security/pam_client.h $(FAKEROOT)$(INCLUDED)
++
++install-dynamic:
+ ifeq ($(DYNAMIC_LIBPAM),yes)
+ $(MKDIR) $(FAKEROOT)$(libdir)
$(INSTALL) -m $(SHLIBMODE) $(LIBNAMED) $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL)
- $(LDCONFIG)
- ifneq ($(DYNTYPE),"sl")
-- ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) ; ln -s $(LIBNAMEDNAME) $(LIBNAMED) )
-+ ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) $(LIBNAMEDNAME); ln -s $(LIBNAMEDFULL) $(LIBNAMED); ln -s $(LIBNAMEDFULL) $(LIBNAMEDNAME) )
+@@ -88,20 +130,30 @@ ifeq ($(DYNAMIC_LIBPAM),yes)
+ ( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) ; ln -s $(LIBNAMEDNAME) $(LIBNAMED) )
endif
endif
++
++install-static:
ifeq ($(STATIC_LIBPAM),yes)
+ $(INSTALL) -m 644 $(LIBNAMEDSTATIC) $(FAKEROOT)$(libdir)
+ endif
+
++install-libtool:
++ifeq ($(LIBTOOL_LIBPAM),yes)
++ $(LIBTOOL) --mode=install $(INSTALL) -c $(LIBNAMEDLIBTOOL) $(FAKEROOT)$(libdir)
++endif
++
+ remove:
+ rm -f $(FAKEROOT)$(INCLUDED)/pam_client.h
+ rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL)
+ rm -f $(FAKEROOT)$(libdir)/$(LIBNAMED)
+ $(LDCONFIG)
+ rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDSTATIC)
++ifeq ($(LIBTOOL_LIBPAM),yes)
++ $(LIBTOOL) --mode=uninstall rm $(FAKEROOT)$(libdir)/$(LIBNAMEDLIBTOOL)
++endif
+
+ clean:
+ rm -f a.out core *~ static/*.o dynamic/*.o
+- rm -f *.a *.out *.o *.so ./include/security/*~
++ rm -f *.a *.la *.lo *.out *.o *.so .libs/* ./include/security/*~
+ if [ -d dynamic ]; then rmdir dynamic ; fi
+ if [ -d static ]; then rmdir static ; fi
+-
++ if [ -d .libs ]; then rmdir .libs ; fi
diff --git a/security/PAM/patches/patch-ag b/security/PAM/patches/patch-ag
index 4de2339b78f..a6c80f3703b 100644
--- a/security/PAM/patches/patch-ag
+++ b/security/PAM/patches/patch-ag
@@ -1,19 +1,52 @@
-$NetBSD: patch-ag,v 1.3 2002/12/23 21:23:58 jlam Exp $
+$NetBSD: patch-ag,v 1.4 2004/11/16 07:46:57 jlam Exp $
---- modules/Makefile.orig Sun Dec 9 17:15:11 2001
-+++ modules/Makefile
-@@ -12,7 +12,7 @@ MODDIRS=$(shell /bin/ls -d pam_*)
-
- all:
- @echo building the static modutil library
-- make -C pammodutil all
-+ $(MAKE) -C pammodutil all
- @echo modules sources available are:
- @ls -d $(MODDIRS) 2>/dev/null ; echo :--------
- @echo
-@@ -55,4 +55,4 @@ clean: lclean
- $(MAKE) -C $$i clean ; \
- } fi ; \
- done
-- make -C pammodutil clean
-+ $(MAKE) -C pammodutil clean
+--- modules/pammodutil/Makefile.orig 2001-12-09 17:15:12.000000000 -0500
++++ modules/pammodutil/Makefile
+@@ -25,10 +25,15 @@ LIBSTATIC = $(LIBNAME).a
+
+ SLIBOBJECTS = $(addprefix static/,$(LIBOBJECTS) $(STATICOBJ))
+
++# libtool library name
++LIBLIBTOOL = $(LIBNAME).la
++
++LALIBOBJECTS = $(LIBOBJECTS:.o=.lo)
++
+ # ---------------------------------------------
+ ## rules
+
+-all: dirs $(LIBSTATIC) ../../Make.Rules
++all: dirs $(LIBLIBTOOL) ../../Make.Rules
+
+ dirs:
+ $(MKDIR) static
+@@ -36,10 +41,19 @@ dirs:
+ static/%.o : %.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+
++%.lo: %.c
++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $<
++
+ $(LIBSTATIC): $(SLIBOBJECTS)
+ ar cr $@ $(SLIBOBJECTS)
+ $(RANLIB) $@
+
++# This is a libtool convenience library that may be linked into shared
++# libraries and modules.
++#
++$(LIBLIBTOOL): $(LALIBOBJECTS)
++ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LALIBOBJECTS) -o $@
++
+ install:
+ @echo "at this time, we're not installing $(LIBSTATIC)"
+
+@@ -47,7 +61,8 @@ remove:
+ @echo "at this time, there is nothing to remove"
+
+ clean:
+- rm -f a.out core *~ static/*.o
+- rm -f *.a *.o
++ rm -f a.out core *~ static/*.o .libs/*
++ rm -f *.a *.la *.la *.o
+ if [ -d dynamic ]; then rmdir dynamic ; fi
+ if [ -d static ]; then rmdir static ; fi
++ if [ -d libs ]; then rmdir .libs; fi
diff --git a/security/PAM/patches/patch-ah b/security/PAM/patches/patch-ah
index de584276bd5..c985965900e 100644
--- a/security/PAM/patches/patch-ah
+++ b/security/PAM/patches/patch-ah
@@ -1,22 +1,94 @@
-$NetBSD: patch-ah,v 1.4 2002/12/23 21:23:59 jlam Exp $
+$NetBSD: patch-ah,v 1.5 2004/11/16 07:46:57 jlam Exp $
---- modules/Simple.Rules.orig Sun Dec 9 17:15:11 2001
+--- modules/Simple.Rules.orig 2001-12-09 17:15:11.000000000 -0500
+++ modules/Simple.Rules
-@@ -59,7 +59,7 @@ endif
+@@ -18,8 +18,13 @@ LIBSRC = $(addsuffix .c,$(LIBFILES))
+ LIBOBJ = $(addsuffix .o,$(LIBFILES))
+ LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
+ LIBOBJS = $(addprefix static/,$(LIBOBJ))
++LIBOBJLA = $(LIBOBJ:.o=.lo)
- ifdef DYNAMIC
- $(LIBSHARED): $(LIBOBJD)
-- $(LD_D) -o $@ $(LIBOBJD) $(MODULE_SIMPLE_EXTRALIBS) $(NEED_LINK_LIB_C) $(LINK_PAMMODUTILS)
-+ $(LD_D) $(LDFLAGS) -o $@ $(LIBOBJD) $(MODULE_SIMPLE_EXTRALIBS) $(NEED_LINK_LIB_C) $(LINK_PAMMODUTILS)
++ifdef LIBTOOL
++LINK_PAMMODUTILS = ../pammodutil/libpammodutil.la
++else
+ LINK_PAMMODUTILS = -L../pammodutil -lpammodutil
++endif
+ INCLUDE_PAMMODUTILS = -I../pammodutil/include
+ ifdef DYNAMIC
+@@ -30,9 +35,23 @@ ifdef STATIC
+ LIBSTATIC = lib$(TITLE).o
endif
-@@ -69,7 +69,7 @@ endif
++ifdef LIBTOOL
++LIBLIBTOOL = $(TITLE).la
++endif
++
+ ####################### don't edit below #######################
+
+-all: dirs $(LIBSHARED) $(LIBSTATIC) register
++ifdef DYNAMIC
++MODULES_TO_BUILD+= $(LIBSHARED)
++endif
++ifdef STATIC
++MODULES_TO_BUILD+= $(LIBSTATIC)
++endif
++ifdef LIBTOOL
++MODULES_TO_BUILD+= $(LIBLIBTOOL)
++endif
++
++all: dirs $(MODULES_TO_BUILD) register
- ifdef STATIC
- $(LIBSTATIC): $(LIBOBJS)
-- $(LD) -r -o $@ $(LIBOBJS) $(MODULE_SIMPLE_EXTRALIBS) $(LINK_PAMMODUTILS)
-+ $(LD) $(LDFLAGS) -r -o $@ $(LIBOBJS) $(MODULE_SIMPLE_EXTRALIBS) $(LINK_PAMMODUTILS)
+ dynamic/%.o : %.c
+ $(CC) $(CFLAGS) $(INCLUDE_PAMMODUTILS) $(DYNAMIC) $(TARGET_ARCH) -c $< -o $@
+@@ -40,6 +59,9 @@ dynamic/%.o : %.c
+ static/%.o : %.c
+ $(CC) $(CFLAGS) $(INCLUDE_PAMMODUTILS) $(STATIC) $(TARGET_ARCH) -c $< -o $@
+
++%.lo : %.c
++ $(SHLIBTOOL) --mode=compile $(CC) $(CFLAGS) $(INCLUDE_PAMMODUTILS) -DPAM_DYNAMIC $(TARGET_ARCH) -c $<
++
+ dirs:
+ ifdef DYNAMIC
+ $(MKDIR) ./dynamic
+@@ -72,22 +94,37 @@ $(LIBSTATIC): $(LIBOBJS)
+ $(LD) -r -o $@ $(LIBOBJS) $(MODULE_SIMPLE_EXTRALIBS) $(LINK_PAMMODUTILS)
endif
++ifdef LIBTOOL
++$(LIBOBJLA): $(LIBSRC)
++endif
++
++ifdef LIBTOOL
++$(LIBLIBTOOL): $(LIBOBJLA)
++ $(SHLIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LIBOBJLA) -o $@ $(MODULE_SIMPLE_EXTRALIBS) $(NEED_LINK_LIB_C) $(LINK_PAMMODUTILS) -module -avoid-version -rpath $(FAKEROOT)$(SECUREDIR)
++endif
++
install: all
+ $(MKDIR) $(FAKEROOT)$(SECUREDIR)
+ ifdef DYNAMIC
+ $(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
+ endif
++ifdef LIBTOOL
++ $(SHLIBTOOL) --mode=install $(INSTALL) -c $(LIBLIBTOOL) $(FAKEROOT)$(SECUREDIR)
++endif
+ $(MODULE_SIMPLE_INSTALL)
+
+ remove:
+ rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
++ifdef LIBTOOL
++ $(SHLIBTOOL) --mode=uninstall rm $(FAKEROOT)$(SECUREDIR)/$(TITLE).la
++endif
+ $(MODULE_SIMPLE_REMOVE)
+
+ clean:
+- rm -f $(LIBOBJD) $(LIBOBJS) core *~
++ rm -f $(LIBOBJD) $(LIBOBJS) $(LIBOBJLA) core *~
+ $(MODULE_SIMPLE_CLEAN)
+- rm -f *.a *.o *.so *.bak
+- rm -rf dynamic static
++ rm -f *.a *.la *.lo *.o *.so *.bak
++ rm -rf dynamic static .libs
+ $(MODULE_SIMPLE_EXTRACLEAN)
+
+ .c.o:
diff --git a/security/PAM/patches/patch-at b/security/PAM/patches/patch-at
index 21758e6c0f0..4582abcda5a 100644
--- a/security/PAM/patches/patch-at
+++ b/security/PAM/patches/patch-at
@@ -1,11 +1,31 @@
-$NetBSD: patch-at,v 1.3 2003/02/09 16:16:57 dmcmahill Exp $
+$NetBSD: patch-at,v 1.4 2004/11/16 07:46:57 jlam Exp $
---- Make.Rules.in.orig Thu Jun 27 00:04:54 2002
-+++ Make.Rules.in Sun Feb 9 11:02:40 2003
-@@ -96,5 +96,5 @@
- LD_D=@LD_D@
- LD_L=@LD_L@
--LDCONFIG=@LDCONFIG@
-+LDCONFIG=${PKG_LDCONFIG}
- DYNTYPE=@DYNTYPE@
- USESONAME=@USESONAME@
+--- Make.Rules.in.orig 2002-06-27 00:04:54.000000000 -0400
++++ Make.Rules.in
+@@ -75,10 +75,13 @@ WITH_MEMORY_DEBUG=@WITH_MEMORY_DEBUG@
+ WITH_LIBDEBUG=@WITH_LIBDEBUG@
+ WITH_PAMLOCKING=@WITH_PAMLOCKING@
+ WITH_LCKPWDF=@WITH_LCKPWDF@
+-STATIC_LIBPAM=@STATIC_LIBPAM@
+-DYNAMIC_LIBPAM=@DYNAMIC_LIBPAM@
+-STATIC=@STATIC@
+-DYNAMIC=@DYNAMIC@
++STATIC_LIBPAM=no
++DYNAMIC_LIBPAM=no
++LIBTOOL_LIBPAM=yes
++STATIC=
++DYNAMIC=
++LIBTOOL=@LIBTOOL@
++SHLIBTOOL=@SHLIBTOOL@
+
+ # Location of libraries when installed on the system
+ FAKEROOT=@FAKEROOT@
+@@ -104,7 +107,7 @@ LIBDL=@LIBDL@
+ MKDIR=@MKDIR@
+ INSTALL=@INSTALL@
+ RANLIB=@RANLIB@
+-STRIP=@STRIP@
++STRIP=:
+ CC_STATIC=@CC_STATIC@
+
+ LINKLIBS = $(NEED_LINK_LIB_C) $(LIBDL)
diff --git a/security/PAM/patches/patch-au b/security/PAM/patches/patch-au
new file mode 100644
index 00000000000..b57338d7339
--- /dev/null
+++ b/security/PAM/patches/patch-au
@@ -0,0 +1,95 @@
+$NetBSD: patch-au,v 1.4 2004/11/16 07:46:57 jlam Exp $
+
+--- modules/pam_filter/Makefile.orig 2001-11-11 02:43:54.000000000 -0500
++++ modules/pam_filter/Makefile
+@@ -27,6 +27,7 @@ LIBSRC = $(TITLE).c
+ LIBOBJ = $(TITLE).o
+ LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
+ LIBOBJS = $(addprefix static/,$(LIBOBJ))
++LIBOBJLA = $(LIBOBJ:.o=.lo)
+
+ dynamic/%.o : %.c
+ $(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+@@ -34,6 +35,9 @@ dynamic/%.o : %.c
+ static/%.o : %.c
+ $(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+
++%.lo : %.c
++ $(SHLIBTOOL) --mode=compile $(CC) $(CFLAGS) $(INCLUDE_PAMMODUTILS) -DPAM_DYNAMIC $(TARGET_ARCH) -c $<
++
+ ifdef DYNAMIC
+ LIBSHARED = $(TITLE).so
+ endif
+@@ -42,13 +46,27 @@ ifdef STATIC
+ LIBSTATIC = lib$(TITLE).o
+ endif
+
++ifdef LIBTOOL
++LIBLIBTOOL = $(TITLE).la
++endif
++
+ ####################### don't edit below #######################
+
+ #
+ # this is where we compile this module
+ #
+
+-all: dirs $(LIBSHARED) $(LIBSTATIC) register filters
++ifdef DYNAMIC
++MODULES_TO_BUILD+= $(LIBSHARED)
++endif
++ifdef STATIC
++MODULES_TO_BUILD+= $(LIBSTATIC)
++endif
++ifdef LIBTOOL
++MODULES_TO_BUILD+= $(LIBLIBTOOL)
++endif
++
++all: dirs $(MODULES_TO_BUILD) register filters
+
+ dirs:
+ if [ ! -r include/security ]; then ln -sf . include/security ; fi
+@@ -90,8 +108,20 @@ $(LIBSTATIC): $(LIBOBJS)
+ $(LD) -r -o $@ $(LIBOBJS)
+ endif
+
++ifdef LIBTOOL
++$(LIBOBJLA): $(LIBSRC)
++endif
++
++ifdef LIBTOOL
++$(LIBLIBTOOL): $(LIBOBJLA)
++ $(SHLIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LIBOBJLA) -o $@ -module -avoid-version -rpath $(FAKEROOT)$(SECUREDIR)
++endif
++
+ remove:
+ rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
++ifdef LIBTOOL
++ $(LIBTOOL) --mode-uninstall rm $(FAKEROOT)$(SECUREDIR)/$(TITLE).la
++endif
+ rm -f $(FAKEROOT)$(INCLUDED)/pam_filter.h
+ @for i in $(FILTERS) ; do \
+ if [ -d $$i ]; then \
+@@ -109,6 +139,9 @@ install: all
+ ifdef DYNAMIC
+ $(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
+ endif
++ifdef LIBTOOL
++ $(LIBTOOL) --mode=install $(INSTALL) $(LIBLIBTOOL) $(FAKEROOT)$(SECUREDIR)
++endif
+ $(MKDIR) $(FAKEROOT)$(INCLUDED)
+ $(INSTALL) -m 644 include/pam_filter.h $(FAKEROOT)$(INCLUDED)
+
+@@ -118,9 +151,9 @@ clean:
+ $(MAKE) -C $$i clean ; \
+ fi ; \
+ done
+- rm -f $(LIBSHARED) $(LIBOBJD) $(LIBOBJS) core *~
++ rm -f $(LIBSHARED) $(LIBLIBTOOL) $(LIBOBJD) $(LIBOBJS) $(LIBOBJSLA) core *~
+ rm -f include/security
+- rm -fr dynamic static
+- rm -f *.a *.o *.so *.bak
++ rm -fr dynamic static .libs
++ rm -f *.a *.la *.lo *.o *.so *.bak
+
+ endif
diff --git a/security/PAM/patches/patch-av b/security/PAM/patches/patch-av
new file mode 100644
index 00000000000..76afc559bcc
--- /dev/null
+++ b/security/PAM/patches/patch-av
@@ -0,0 +1,101 @@
+$NetBSD: patch-av,v 1.4 2004/11/16 07:46:58 jlam Exp $
+
+--- modules/pam_tally/Makefile.orig 2001-06-27 02:20:43.000000000 -0400
++++ modules/pam_tally/Makefile
+@@ -20,6 +20,7 @@ LIBSRC = $(TITLE).c
+ LIBOBJ = $(TITLE).o
+ LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
+ LIBOBJS = $(addprefix static/,$(LIBOBJ))
++LIBOBJLA = $(LIBOBJ:.o=.lo)
+
+ APPSRC = $(TITLE)_app.c
+ APPOBJ = $(TITLE)_app.o
+@@ -32,6 +33,8 @@ dynamic/%.o : %.c
+ static/%.o : %.c
+ $(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+
++%.lo : %.c
++ $(SHLIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) -DPAM_DYNAMIC $(TARGET_ARCH) -c $<
+
+ ifdef DYNAMIC
+ LIBSHARED = $(TITLE).so
+@@ -41,12 +44,26 @@ ifdef STATIC
+ LIBSTATIC = lib$(TITLE).o
+ endif
+
++ifdef LIBTOOL
++LIBLIBTOOL = $(TITLE).la
++endif
++
+ APPLICATION = $(TITLE)
+ APPMODE = 755
+
+ ####################### don't edit below #######################
+
+-all: dirs $(LIBSHARED) $(LIBSTATIC) register $(APPLICATION)
++ifdef DYNAMIC
++MODULES_TO_BUILD+= $(LIBSHARED)
++endif
++ifdef STATIC
++MODULES_TO_BUILD+= $(LIBSTATIC)
++endif
++ifdef LIBTOOL
++MODULES_TO_BUILD+= $(LIBLIBTOOL)
++endif
++
++all: dirs $(MODULES_TO_BUILD) register $(APPLICATION)
+
+ dirs:
+ ifdef DYNAMIC
+@@ -55,6 +72,9 @@ endif
+ ifdef STATIC
+ $(MKDIR) ./static
+ endif
++ifdef LIBTOOL
++ $(MKDIR) ./static
++endif
+
+ register:
+ ifdef STATIC
+@@ -82,22 +102,38 @@ $(APPLICATION): $(APPOBJS) $(TITLE).c
+ $(CC) $(CFLAGS) -o $@ $(APPOBJS) $(LOADLIBES)
+ endif
+
++ifdef LIBTOOL
++$(LIBOBJLA): $(LIBSRC)
++
++$(LIBLIBTOOL): $(LIBOBJLA)
++ $(SHLIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LIBOBJLA) -o $@ -module -avoid-version -rpath $(FAKEROOT)$(SECUREDIR)
++
++$(APPLICATION): $(APPOBJS) $(TITLE).c
++ $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS) -o $@ $(APPOBJS) $(LOADLIBES)
++endif
++
+ install: all
+ $(MKDIR) $(FAKEROOT)$(SECUREDIR)
+ ifdef DYNAMIC
+ $(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
+ endif
++ifdef LIBTOOL
++ $(SHLIBTOOL) --mode=install $(INSTALL) $(LIBLIBTOOL) $(FAKEROOT)$(SECUREDIR)
++endif
+ $(MKDIR) $(FAKEROOT)$(SUPLEMENTED)
+ $(INSTALL) -m $(APPMODE) $(APPLICATION) $(FAKEROOT)$(SUPLEMENTED)
+
+ remove:
+ rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so
++ifdef LIBTOOL
++ $(SHLIBTOOL) --mode=uninstall rm $(FAKEROOT)$(SECUREDIR)/$(TITLE).la
++endif
+ rm -f $(FAKEROOT)$(SUPLEMENTED)/$(TITLE)
+
+ clean:
+- rm -f $(LIBOBJD) $(LIBOBJS) $(APPOBJD) $(APPOBJS) core *~
+- rm -f *.a *.o *.so *.bak dynamic/* static/* $(APPLICATION)
+- rm -rf dynamic static
++ rm -f $(LIBOBJD) $(LIBOBJS) $(LIBOBJLA) $(APPOBJD) $(APPOBJS) core *~
++ rm -f *.a *.la *.lo *.o *.so *.bak dynamic/* static/* $(APPLICATION)
++ rm -rf dynamic static .libs
+
+ .c.o:
+ $(CC) $(CFLAGS) -c $<
diff --git a/security/PAM/patches/patch-aw b/security/PAM/patches/patch-aw
new file mode 100644
index 00000000000..eed6738364b
--- /dev/null
+++ b/security/PAM/patches/patch-aw
@@ -0,0 +1,137 @@
+$NetBSD: patch-aw,v 1.4 2004/11/16 07:46:58 jlam Exp $
+
+--- modules/pam_unix/Makefile.orig 2001-02-11 01:33:53.000000000 -0500
++++ modules/pam_unix/Makefile
+@@ -55,6 +55,7 @@ LIBSRC = pam_unix_auth.c pam_unix_acct.c
+ support.c
+ LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
+ LIBOBJS = $(addprefix static/,$(LIBOBJ))
++LIBOBJLA = $(LIBOBJ:.o=.lo)
+
+ PLUS = md5_good.o md5_broken.o md5_crypt_good.o md5_crypt_broken.o \
+ yppasswd_xdr.o bigcrypt.o
+@@ -65,11 +66,24 @@ endif
+ ifdef STATIC
+ LIBSTATIC = libpam_unix.o
+ endif
++ifdef LIBTOOL
++LIBLIBTOOL = pam_unix.la
++endif
+
+
+ ########################### don't edit below #######################
+
+-all: dirs info $(PLUS) $(LIBSHARED) $(LIBSTATIC) $(CHKPWD) register
++ifdef DYNAMIC
++MODULES_TO_BUILD+= $(LIBSHARED)
++endif
++ifdef STATIC
++MODULES_TO_BUILD+= $(LIBSTATIC)
++endif
++ifdef LIBTOOL
++MODULES_TO_BUILD+= $(LIBLIBTOOL)
++endif
++
++all: dirs info $(MODULES_TO_BUILD) $(CHKPWD) register
+
+ dynamic/%.o : %.c
+ $(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+@@ -77,6 +91,9 @@ dynamic/%.o : %.c
+ static/%.o: %.c
+ $(CC) $(CFLAGS) $(STATIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+
++%.lo : %.c
++ $(SHLIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) -DPAM_DYNAMIC $(TARGET_ARCH) -c $<
++
+ dummy:
+ @echo "**** This is not a top-level Makefile "
+ exit
+@@ -117,10 +134,17 @@ $(LIBSTATIC): $(LIBOBJS)
+ $(LD) -r -o $@ $(LIBOBJS) $(PLUS) $(CRACKLIB) $(LDLIBS) $(LIBNSL) $(LIBCRYPT)
+ endif
+
++ifdef LIBTOOL
++$(LIBOBJLA): $(LIBSRC)
++
++$(LIBLIBTOOL): $(LIBOBJLA) $(PLUS:.o=.lo)
++ $(SHLIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LIBOBJLA) -o $@ $(PLUS:.o=.lo) $(CRACKLIB) $(LDLIBS) $(LIBNSL) $(LIBCRYPT) -module -avoid-version -rpath $(FAKEROOT)$(SECUREDIR)
++endif
++
+ $(CHKPWD): unix_chkpwd.o md5_good.o md5_broken.o \
+ md5_crypt_good.o md5_crypt_broken.o \
+ bigcrypt.o
+- $(CC) -o $(CHKPWD) $^ $(LDLIBS) $(LIBCRYPT)
++ $(CC) $(LDFLAGS) -o $(CHKPWD) $^ $(LDLIBS) $(LIBCRYPT)
+
+ unix_chkpwd.o: unix_chkpwd.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+@@ -129,18 +153,38 @@ md5_good.o: md5.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -DHIGHFIRST -D'MD5Name(x)=Good##x' \
+ $(TARGET_ARCH) -c $< -o $@
+
++md5_good.lo: md5.c
++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) \
++ -DHIGHFIRST -D'MD5Name(x)=Good##x' \
++ $(TARGET_ARCH) -c $< -o $@
++
+ md5_broken.o: md5.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -D'MD5Name(x)=Broken##x' \
+ $(TARGET_ARCH) -c $< -o $@
+
++md5_broken.lo: md5.c
++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) \
++ -D'MD5Name(x)=Broken##x' \
++ $(TARGET_ARCH) -c $< -o $@
++
+ md5_crypt_good.o: md5_crypt.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -D'MD5Name(x)=Good##x' \
+ $(TARGET_ARCH) -c $< -o $@
+
++md5_crypt_good.lo: md5_crypt.c
++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) \
++ -D'MD5Name(x)=Good##x' \
++ $(TARGET_ARCH) -c $< -o $@
++
+ md5_crypt_broken.o: md5_crypt.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -D'MD5Name(x)=Broken##x' \
+ $(TARGET_ARCH) -c $< -o $@
+
++md5_crypt_broken.lo: md5_crypt.c
++ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(CPPFLAGS) \
++ -D'MD5Name(x)=Broken##x' \
++ $(TARGET_ARCH) -c $< -o $@
++
+ install: all
+ mkdir -p $(FAKEROOT)$(SECUREDIR)
+ ifdef DYNAMIC
+@@ -148,19 +192,28 @@ ifdef DYNAMIC
+ for x in pam_unix_auth pam_unix_acct pam_unix_passwd pam_unix_session;\
+ do ln -sf $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)/$$x.so ; done
+ endif
++ifdef LIBTOOL
++ $(SHLIBTOOL) --mode=install install $(LIBLIBTOOL) $(FAKEROOT)$(SECUREDIR)
++ . $(FAKEROOT)$(SECUREDIR)/$(LIBLIBTOOL); \
++ for x in pam_unix_auth pam_unix_acct pam_unix_passwd pam_unix_session;\
++ do ln -sf $$dlname $(FAKEROOT)$(SECUREDIR)/$$x.so ; done
++endif
+ $(MKDIR) $(FAKEROOT)$(SUPLEMENTED)
+ install -m 4555 $(CHKPWD) $(FAKEROOT)$(SUPLEMENTED)
+
+ remove:
+ rm -f $(FAKEROOT)$(SECUREDIR)/$(LIBSHARED)
++ifdef LIBTOOL
++ $(SHLIBTOOL) --mode=uninstall rm $(FAKEROOT)$(SECUREDIR)/$(LIBLIBTOOL)
++endif
+ for x in pam_unix_auth pam_unix_acct pam_unix_passwd pam_unix_session;\
+ do rm -f $(FAKEROOT)$(SECUREDIR)/$$x.so ; done
+ rm -f $(FAKEROOT)$(SUPLEMENTED)/$(CHKPWD)
+
+ clean:
+- rm -f $(LIBOBJD) $(LIBOBJS) $(CHKPWD) *.o *.so core
++ rm -f $(LIBOBJD) $(LIBOBJS) $(LIBOBJLA) $(CHKPWD) *.la *.lo *.o *.so core
+ rm -f *~ *.a *.out *.bak
+- rm -rf dynamic static
++ rm -rf dynamic static .libs
+
+ .c.o:
+ $(CC) -c $(CFLAGS) $<
diff --git a/security/PAM/patches/patch-ax b/security/PAM/patches/patch-ax
new file mode 100644
index 00000000000..0f74493a216
--- /dev/null
+++ b/security/PAM/patches/patch-ax
@@ -0,0 +1,13 @@
+$NetBSD: patch-ax,v 1.3 2004/11/16 07:46:58 jlam Exp $
+
+--- Makefile.orig 2001-05-08 00:14:20.000000000 -0400
++++ Makefile
+@@ -15,7 +15,7 @@ ifeq ($(shell test \! -f Make.Rules || e
+ include Make.Rules
+ endif
+
+-THINGSTOMAKE = modules libpam libpamc libpam_misc doc examples
++THINGSTOMAKE = modules libpam libpamc libpam_misc doc
+
+ all: $(THINGSTOMAKE)
+