diff -Nurwd orig/openssh-4.7p1/debian/control openssh-4.7p1/debian/control
--- orig/openssh-4.7p1/debian/control	2008-03-03 21:22:49.000000000 +0100
+++ openssh-4.7p1/debian/control	2008-03-03 15:50:27.000000000 +0100
@@ -2,7 +2,7 @@
 Section: net
 Priority: standard
 Maintainer: Debian OpenSSH Maintainers <debian-ssh@lists.debian.org>
-Build-Depends: libwrap0-dev | libwrap-dev, zlib1g-dev (>= 1:1.2.3-1), libssl-dev (>= 0.9.8-1), libpam0g-dev | libpam-dev, libgtk2.0-dev, libedit-dev, debhelper (>= 5.0.22), sharutils, libselinux1-dev [alpha amd64 arm armeb armel hppa i386 ia64 lpia m68k mips mipsel powerpc ppc64 s390 sparc], libkrb5-dev
+Build-Depends: libwrap0-dev | libwrap-dev, zlib1g-dev (>= 1:1.2.3-1), libssl-dev (>= 0.9.8-1), libpam0g-dev | libpam-dev, libgtk2.0-dev, libedit-dev, debhelper (>= 5.0.22), sharutils, libselinux1-dev [alpha amd64 arm armeb armel hppa i386 ia64 lpia m68k mips mipsel powerpc ppc64 s390 sparc], libkrb5-dev, libopensc2-dev
 Standards-Version: 3.7.3
 Uploaders: Colin Watson <cjwatson@debian.org>, Matthew Vernon <matthew@debian.org>
 
@@ -120,3 +120,14 @@
  This package provides the sshd server for use in debian-installer.
  Since it is expected to be used in specialized situations (e.g. S/390
  installs with no console), it does not provide any configuration.
+
+Package: libssh-dev
+Priority: optional
+Section: libdevel
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Secure shell library
+ Static library containing routines for openssh.  Currently the only
+ header file included are authfd.h, key.h and buffer.h which are used
+ by applications that communicate with ssh-agent.
+
diff -Nurwd orig/openssh-4.7p1/debian/libssh-dev.dirs openssh-4.7p1/debian/libssh-dev.dirs
--- orig/openssh-4.7p1/debian/libssh-dev.dirs	1970-01-01 00:00:00.000000000 +0000
+++ openssh-4.7p1/debian/libssh-dev.dirs	2008-03-03 16:03:15.000000000 +0100
@@ -0,0 +1,2 @@
+usr/include/ssh
+usr/lib
diff -Nurwd orig/openssh-4.7p1/debian/libssh-dev.links openssh-4.7p1/debian/libssh-dev.links
--- orig/openssh-4.7p1/debian/libssh-dev.links	1970-01-01 00:00:00.000000000 +0000
+++ openssh-4.7p1/debian/libssh-dev.links	2008-03-03 16:03:39.000000000 +0100
@@ -0,0 +1 @@
+usr/share/doc/openssh-client usr/share/doc/libssh-dev
diff -Nurwd orig/openssh-4.7p1/debian/rules openssh-4.7p1/debian/rules
--- orig/openssh-4.7p1/debian/rules	2008-03-03 21:22:49.000000000 +0100
+++ openssh-4.7p1/debian/rules	2008-03-03 20:20:44.000000000 +0100
@@ -66,6 +66,7 @@
 confflags += --with-4in6
 confflags += --with-privsep-path=/var/run/sshd
 confflags += --without-rand-helper
+confflags += --with-opensc=/usr

 # The Hurd needs libcrypt for res_query et al.
   ifeq ($(DEB_HOST_ARCH_OS),hurd)
@@ -207,6 +207,7 @@
 binary-arch: binary-openssh-client binary-openssh-server
 binary-arch: binary-ssh-askpass-gnome
 binary-arch: binary-openssh-client-udeb binary-openssh-server-udeb
+binary-arch: binary-libssh-dev
 
 binary-openssh-client: DH_OPTIONS=-popenssh-client
 binary-openssh-client: build install
@@ -328,6 +329,21 @@
 	dh_md5sums
 	dh_builddeb
 
+binary-libssh-dev: DH_OPTIONS=-plibssh-dev
+binary-libssh-dev: build install
+	dh_testdir
+	dh_testroot
+	dh_link
+	cp build-deb/libssh.a build-deb/openbsd-compat/libopenbsd-compat.a debian/libssh-dev/usr/lib
+	cp key.h buffer.h authfd.h debian/libssh-dev/usr/include/ssh
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
 binary: binary-indep binary-arch
 
 debian/faq.html:
@@ -344,4 +360,4 @@
 .PHONY: build-deb build-udeb
 .PHONY: binary-openssh-client binary-openssh-server binary-ssh
 .PHONY: binary-ssh-krb5 binary-ssh-askpass-gnome
-.PHONY: binary-openssh-client-udeb binary-openssh-server-udeb
+.PHONY: binary-openssh-client-udeb binary-openssh-server-udeb binary-libssh-dev
