--- /dev/null
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="DirMngr is a daemon to handle CRL and certificate requests for GnuPG"
+HOMEPAGE="http://www.gnupg.org/download/index.en.html#dirmngr"
+SRC_URI="mirror://gnupg/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ~ia64 ppc ppc64 sparc x86"
+IUSE="nls"
+
+RDEPEND=">=net-nds/openldap-2.1.26
+ >=dev-libs/libgpg-error-1.4
+ >=dev-libs/libgcrypt-1.4.0:0
+ >=dev-libs/libksba-1.0.2
+ >=dev-libs/pth-1.3.7
+ nls? ( virtual/libintl )"
+
+DEPEND="${RDEPEND}
+ >=dev-libs/libassuan-2
+ nls? ( >=sys-devel/gettext-0.12.1 )"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-pth.patch"
+}
+
+src_configure() {
+ econf --docdir="/usr/share/doc/${PF}" $(use_enable nls) \
+ LDAPLIBS="-lldap -llber"
+}
+
+src_install() {
+ default
+ dodoc AUTHORS ChangeLog NEWS README THANKS TODO
+}
--- /dev/null
+Index: src/dirmngr.c
+===================================================================
+--- src/dirmngr.c (revision 348)
++++ src/dirmngr.c (working copy)
+@@ -665,8 +665,11 @@
+ the option parsing may need services of the libraries. */
+
+ /* Libgcrypt requires us to register the threading model first.
+- Note that this will also do the pth_init. */
++ Note that this will also do the pth_init for libgcrypt < 1.6 */
+
++#if GCRYPT_VERSION_NUMBER >= 0x010600
++ pth_init ();
++#endif
+ /* Init Libgcrypt. */
+ rc = gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pth);
+ if (rc)
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>crypto@gentoo.org</email>
+ <name>Crypto</name>
+</maintainer>
+</pkgmetadata>