diff -urN openssh/MESSAGE.lpk openssh-lpk/MESSAGE.lpk
--- openssh/MESSAGE.lpk	1970-01-01 01:00:00.000000000 +0100
+++ openssh-lpk/MESSAGE.lpk	2005-04-11 16:17:40.000000000 +0200
@@ -0,0 +1,12 @@
+===========================================================================
+$NetBSD$
+
+read the following README :
+	${PREFIX}/share/doc/${PKGBASE}/README.lpk
+
+then copy this ldap schema to openldap schemas directory :
+	${EGDIR}/openssh-lpk.schema
+
+user example :
+	${EGDIR}/lpk-user-example.txt
+===========================================================================
diff -urN openssh/Makefile openssh-lpk/Makefile
--- openssh/Makefile	2005-04-12 16:15:07.000000000 +0200
+++ openssh-lpk/Makefile	2005-04-11 17:49:34.000000000 +0200
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.148 2005/04/11 21:47:14 tv Exp $
+# $NetBSD: Makefile,v 1.147 2005/03/07 23:29:49 tv Exp $
 
 DISTNAME=		openssh-3.9p1
 PKGNAME=		openssh-3.9.1
@@ -54,6 +54,10 @@
 
 .endif
 
+.if !empty(PKG_OPTIONS:Mlpk)
+MESSAGE_SRC+=           ${.CURDIR}/MESSAGE.lpk
+.endif
+
 SSH_PID_DIR=		${VARBASE}/run	# default directory for PID files
 
 PKG_SYSCONFSUBDIR=	ssh
@@ -61,6 +65,7 @@
 
 PLIST_SUBST+=		MANDIR=${MANDIR}
 
+USE_BUILDLINK3=		yes
 USE_PKGINSTALL=		yes
 GNU_CONFIGURE=		yes
 CONFIGURE_ARGS+=	--with-mantype=man
@@ -149,6 +154,7 @@
 MESSAGE_SUBST+=		EGDIR=${EGDIR}
 MESSAGE_SUBST+=		OPENSSH_USER=${OPENSSH_USER}
 MESSAGE_SUBST+=		OPENSSH_GROUP=${OPENSSH_GROUP}
+MESSAGE_SUBST+=		PKGBASE=${PKGBASE}
 
 INSTALL_EXTRA_TMPL+=	${.CURDIR}/INSTALL
 
@@ -156,6 +162,13 @@
 .include "../../security/openssl/buildlink3.mk"
 .include "../../security/tcp_wrappers/buildlink3.mk"
 
+post-patch:
+.if !empty(PKG_OPTIONS:Mlpk)
+	${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/no-privsep-lpk-patch
+.else
+	${PATCH} ${PATCH_ARGS} < ${PATCHDIR}/no-privsep-patch
+.endif
+
 post-install:
 	${INSTALL_DATA_DIR} ${EGDIR}
 	cd ${WRKSRC}; for file in ${CONFS} ${SUPPS}; do			\
@@ -164,5 +177,11 @@
 .if !empty(PKG_OPTIONS:MPAM) && ${OPSYS} == "Linux"
 	${INSTALL_DATA} ${WRKSRC}/contrib/sshd.pam.generic ${EGDIR}/sshd.pam
 .endif
+.if !empty(PKG_OPTIONS:Mlpk)
+	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/${PKGBASE}
+	${INSTALL_DATA} ${WRKSRC}/README.lpk ${PREFIX}/share/doc/${PKGBASE}
+	${INSTALL_DATA} ${WRKSRC}/lpk-user-example.txt ${EGDIR}
+	${INSTALL_DATA} ${WRKSRC}/openssh-lpk.schema ${EGDIR}
+.endif
 
 .include "../../mk/bsd.pkg.mk"
diff -urN openssh/distinfo openssh-lpk/distinfo
--- openssh/distinfo	2005-04-12 16:15:07.000000000 +0200
+++ openssh-lpk/distinfo	2005-04-11 15:56:17.000000000 +0200
@@ -3,8 +3,9 @@
 SHA1 (openssh-3.9p1.tar.gz) = 80b19d83a9d4717f5c38b2d950501e1471f60afc
 RMD160 (openssh-3.9p1.tar.gz) = e4abf280a18e3ae046d0dee19dab919bba8e5568
 Size (openssh-3.9p1.tar.gz) = 854027 bytes
-SHA1 (openssh-3.9p1-hpn.diff) = 1821c590b9b5effa3750ebf0166fe3f22d00faad
-Size (openssh-3.9p1-hpn.diff) = 8387 bytes
+SHA1 (openssh-lpk-3.9p1-0.3.3.patch) = 6a60958dc5cee86b12ee53665b1160d4b5ea6846
+RMD160 (openssh-lpk-3.9p1-0.3.3.patch) = ddd6a1d516e59f9fda753e86ba0ff483c2a4849d
+Size (openssh-lpk-3.9p1-0.3.3.patch) = 45225 bytes
 SHA1 (patch-aa) = 6bceb5b0480727c6c4e0cf662fa85cffebf91bdb
 SHA1 (patch-ab) = f43a6b627a4f2b8ecd74b016ce29b5f8091d877e
 SHA1 (patch-ac) = d851513c2a115358671bf9efafab1e3ee9166088
diff -urN openssh/options.mk openssh-lpk/options.mk
--- openssh/options.mk	2005-04-12 16:15:07.000000000 +0200
+++ openssh-lpk/options.mk	2005-04-11 17:47:39.000000000 +0200
@@ -3,7 +3,7 @@
 .include "../../mk/bsd.prefs.mk"
 
 PKG_OPTIONS_VAR=	PKG_OPTIONS.openssh
-PKG_SUPPORTED_OPTIONS=	kerberos hpn-patch
+PKG_SUPPORTED_OPTIONS=	kerberos hpn-patch lpk
 
 .if !empty(OPSYS:MLinux)
 PKG_SUPPORTED_OPTIONS+= PAM
@@ -30,3 +30,14 @@
 PLIST_SRC+=		${.CURDIR}/PLIST.pam
 MESSAGE_SRC+=		${.CURDIR}/MESSAGE.pam
 .endif
+
+.if !empty(PKG_OPTIONS:Mlpk)
+.include "../../databases/openldap/buildlink3.mk"
+PATCH_SITES=		http://www.opendarwin.org/projects/openssh-lpk/files/
+PATCHFILES=		openssh-lpk-3.9p1-0.3.3.patch
+PATCH_DIST_STRIP=	-p1
+CONFIGURE_ARGS+=--with-libs="-lldap"					\
+		--with-ldflags="-L${BUILDLINK_PREFIX.openldap}/lib"	\
+		--with-cppflags="-I${BUILDLINK_PREFIX.openldap}/include	\
+		-DWITH_LDAP_PUBKEY"
+.endif
diff -urN openssh/patches/CVS/Entries openssh-lpk/patches/CVS/Entries
--- openssh/patches/CVS/Entries	2005-04-12 16:16:14.000000000 +0200
+++ openssh-lpk/patches/CVS/Entries	2005-04-10 05:33:38.000000000 +0200
@@ -1,23 +1,23 @@
-/patch-aa/1.37/Tue Apr 12 14:16:13 2005//
-/patch-ab/1.20/Tue Apr 12 14:16:13 2005//
-/patch-ac/1.12/Tue Apr 12 14:16:13 2005//
-/patch-ad/1.9/Tue Apr 12 14:16:14 2005//
-/patch-ae/1.9/Tue Apr 12 14:16:14 2005//
-/patch-af/1.7/Tue Apr 12 14:16:14 2005//
-/patch-ag/1.6/Tue Apr 12 14:16:14 2005//
-/patch-ah/1.21/Tue Apr 12 14:16:14 2005//
-/patch-ai/1.7/Tue Apr 12 14:16:14 2005//
-/patch-aj/1.6/Tue Apr 12 14:16:14 2005//
-/patch-ak/1.6/Tue Apr 12 14:16:14 2005//
-/patch-al/1.5/Tue Apr 12 14:16:14 2005//
-/patch-am/1.4/Tue Apr 12 14:16:14 2005//
-/patch-an/1.5/Tue Apr 12 14:16:14 2005//
-/patch-ao/1.6/Tue Apr 12 14:16:14 2005//
-/patch-ap/1.5/Tue Apr 12 14:16:14 2005//
-/patch-aq/1.5/Tue Apr 12 14:16:14 2005//
-/patch-ar/1.4/Tue Apr 12 14:16:14 2005//
-/patch-as/1.3/Tue Apr 12 14:16:14 2005//
-/patch-at/1.1/Tue Apr 12 14:16:14 2005//
-/patch-au/1.1/Tue Apr 12 14:16:14 2005//
-/patch-av/1.1/Tue Apr 12 14:16:14 2005//
+/patch-ah/1.21/Tue Aug 31 11:27:12 2004//
+/patch-aa/1.37/Tue Mar  8 04:35:22 2005//
+/patch-ab/1.20/Tue Mar  8 04:35:22 2005//
+/patch-ac/1.12/Tue Mar  8 04:35:22 2005//
+/patch-ad/1.9/Tue Mar  8 04:35:22 2005//
+/patch-ae/1.9/Tue Mar  8 04:35:22 2005//
+/patch-af/1.7/Tue Mar  8 04:35:22 2005//
+/patch-ag/1.6/Tue Mar  8 04:35:22 2005//
+/patch-ai/1.7/Tue Mar  8 04:35:22 2005//
+/patch-aj/1.6/Tue Mar  8 04:35:22 2005//
+/patch-ak/1.6/Tue Mar  8 04:35:22 2005//
+/patch-al/1.5/Tue Mar  8 04:35:22 2005//
+/patch-am/1.4/Tue Mar  8 04:35:22 2005//
+/patch-an/1.5/Tue Mar  8 04:35:22 2005//
+/patch-ao/1.6/Tue Mar  8 04:35:22 2005//
+/patch-ap/1.5/Tue Mar  8 04:35:22 2005//
+/patch-aq/1.5/Tue Mar  8 04:35:22 2005//
+/patch-ar/1.4/Tue Mar  8 04:35:22 2005//
+/patch-as/1.3/Mon Mar  7 23:29:50 2005//
+/patch-au/1.1/Mon Mar  7 23:29:50 2005//
+/patch-av/1.1/Mon Mar  7 23:29:50 2005//
+/patch-at/1.1/Sun Apr 10 03:33:38 2005//
 D
diff -urN openssh/patches/no-privsep-lpk-patch openssh-lpk/patches/no-privsep-lpk-patch
--- openssh/patches/no-privsep-lpk-patch	1970-01-01 01:00:00.000000000 +0100
+++ openssh-lpk/patches/no-privsep-lpk-patch	2005-04-08 18:35:40.000000000 +0200
@@ -0,0 +1,15 @@
+--- servconf.c.orig	2005-04-08 18:33:34.000000000 +0200
++++ servconf.c	2005-04-08 18:33:50.000000000 +0200
+@@ -265,7 +265,11 @@
+ #endif
+ 	/* Turn privilege separation on by default */
+ 	if (use_privsep == -1)
+-		use_privsep = 1;
++#ifdef HAVE_INTERIX
++               use_privsep = 0;
++#else
++               use_privsep = 1;
++#endif
+ 
+ #ifndef HAVE_MMAP
+ 	if (use_privsep && options->compression == 1) {
diff -urN openssh/patches/no-privsep-patch openssh-lpk/patches/no-privsep-patch
--- openssh/patches/no-privsep-patch	1970-01-01 01:00:00.000000000 +0100
+++ openssh-lpk/patches/no-privsep-patch	2005-03-08 00:29:50.000000000 +0100
@@ -0,0 +1,16 @@
+$NetBSD: patch-at,v 1.1 2005/03/07 23:29:50 tv Exp $
+
+--- servconf.c.orig	2004-08-13 07:30:24.000000000 -0400
++++ servconf.c
+@@ -233,7 +233,11 @@ fill_default_server_options(ServerOption
+ 
+ 	/* Turn privilege separation on by default */
+ 	if (use_privsep == -1)
++#ifdef HAVE_INTERIX
++		use_privsep = 0;
++#else
+ 		use_privsep = 1;
++#endif
+ 
+ #ifndef HAVE_MMAP
+ 	if (use_privsep && options->compression == 1) {
diff -urN openssh/patches/patch-at openssh-lpk/patches/patch-at
--- openssh/patches/patch-at	2005-04-12 16:16:14.000000000 +0200
+++ openssh-lpk/patches/patch-at	1970-01-01 01:00:00.000000000 +0100
@@ -1,16 +0,0 @@
-$NetBSD: patch-at,v 1.1 2005/03/07 23:29:50 tv Exp $
-
---- servconf.c.orig	2004-08-13 07:30:24.000000000 -0400
-+++ servconf.c
-@@ -233,7 +233,11 @@ fill_default_server_options(ServerOption
- 
- 	/* Turn privilege separation on by default */
- 	if (use_privsep == -1)
-+#ifdef HAVE_INTERIX
-+		use_privsep = 0;
-+#else
- 		use_privsep = 1;
-+#endif
- 
- #ifndef HAVE_MMAP
- 	if (use_privsep && options->compression == 1) {