summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /app-crypt/gnupg
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'app-crypt/gnupg')
-rw-r--r--app-crypt/gnupg/Manifest5
-rw-r--r--app-crypt/gnupg/files/gnupg-2.0.17-gpgsm-gencert.patch34
-rw-r--r--app-crypt/gnupg/files/gnupg-2.0.26-Need-to-init-the-trustdb-for-import.patch35
-rw-r--r--app-crypt/gnupg/files/gnupg-2.0.26-misc-cve.patch118
-rw-r--r--app-crypt/gnupg/gnupg-1.4.19.ebuild115
-rw-r--r--app-crypt/gnupg/gnupg-2.0.26-r3.ebuild165
-rw-r--r--app-crypt/gnupg/gnupg-2.0.27-r1.ebuild167
-rw-r--r--app-crypt/gnupg/gnupg-2.0.27.ebuild163
-rw-r--r--app-crypt/gnupg/gnupg-2.0.28.ebuild167
-rw-r--r--app-crypt/gnupg/gnupg-2.1.6.ebuild170
-rw-r--r--app-crypt/gnupg/metadata.xml31
11 files changed, 1170 insertions, 0 deletions
diff --git a/app-crypt/gnupg/Manifest b/app-crypt/gnupg/Manifest
new file mode 100644
index 000000000000..b9858aeb6788
--- /dev/null
+++ b/app-crypt/gnupg/Manifest
@@ -0,0 +1,5 @@
+DIST gnupg-1.4.19.tar.bz2 3713811 SHA256 7f09319d044b0f6ee71fe3587bb873be701723ac0952cff5069046a78de8fd86 SHA512 cce2a83efb05f963ad0f8afd04999cc852889d46b4cad4cf399a37fd6e69f0911a5ccaa0192cb891a941cfa93125349b481efa789a127e3c0aa2c5ba53672741 WHIRLPOOL 14eaddca0981f05757aa0751b9563837efd3f5943a422d5f29e0de94eb6233b85b8848a1f4816ab7e897d6e656c7c08705115d53ed89f554604ffd2009c3c39f
+DIST gnupg-2.0.26.tar.bz2 4303384 SHA256 7758e30dc382ae7a7167ed41b7f936aa50af5ea2d6fccdef663b5b750b65b8e0 SHA512 5dd23baaac764fd48abd235ed52a85a2c7fd68b98fcde45c0f294ddb3b5629e8b1bd894585fbed4e6a6cb2bc4a5552c098c3cf1a849fffa469424fd0a4fee726 WHIRLPOOL 8d9b30337957f6bfeddea29116d862ef0c0ddd06d59bc2799db236b91b2c6767aad6f37f2166fc431c5d9454eb41f49f3e261bc38d0e89361f0c467f4591cd5a
+DIST gnupg-2.0.27.tar.bz2 4424679 SHA256 57646d3e4b919fa1e5c8f1c0cf5fe1215333041c493a5ebc4b8f2978dbe930f2 SHA512 b05e75f5ef9881df9472818743c175cfe3254088086f36dc0fcf3d34e61f648f1775d90d404f6c622561df5066d972aadbf99ea8ec1290e5d7f7310f4ef2989e WHIRLPOOL abb353b20655002a0957e38d2b889fb5e6a47ba7b7546e1c70fc1f97cf42deeca8f2b061678983f3a160210f4eaf7529441246df1f9f1d875f5cc090456fdfb7
+DIST gnupg-2.0.28.tar.bz2 4435779 SHA256 ce092ee4ab58fd19b9fb34a460c07b06c348f4360dd5dd4886d041eb521a534c SHA512 7e786fe0648d5ea453f9c7524fec4bd7d5eec26d28f723acf3cb2f7ec9c400c339f0926a179411876c3f8e08b06942dcec643dc930caf58239bbd4932f4bd3c1 WHIRLPOOL ccf7427e54a545914e89677618055a114b4c9dc4db48669a2fc726fced98475df4ed27c93bd180f1250d147111ee663c736cdf4e1d8afdc40ed967cdffd0eb66
+DIST gnupg-2.1.6.tar.bz2 4917722 SHA256 5e599ad542199f3bd733eed2b88a539d1b4c3beda2dbab0ff69f1896f52e92fd SHA512 ae8aafe770336c83badf5610fe37f4ddc488786e3604780627893b636161d8407f3fd782538799e2b2a02e31c97468464372017fa52b5d9ed1bd31c85d9b3763 WHIRLPOOL 2136c526242a4e741c0cbc9aec102ba634234efd679d62db9aae3b2ab8fe9f8ad9b8fdb7d1f2d43982e6a072d5f5072d0744d8bb434d61f49ff24e868c902f80
diff --git a/app-crypt/gnupg/files/gnupg-2.0.17-gpgsm-gencert.patch b/app-crypt/gnupg/files/gnupg-2.0.17-gpgsm-gencert.patch
new file mode 100644
index 000000000000..9506f814378d
--- /dev/null
+++ b/app-crypt/gnupg/files/gnupg-2.0.17-gpgsm-gencert.patch
@@ -0,0 +1,34 @@
+From c34486a64c223bcbfbb57d9abcf107d684b815b6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= <flameeyes@gmail.com>
+Date: Sun, 17 Apr 2011 01:34:39 +0200
+Subject: [PATCH] gpgsm-gencert.sh: make sure not to abort after creating temp
+ file.
+
+https://bugs.g10code.com/gnupg/issue1466
+
+---
+ tools/gpgsm-gencert.sh | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tools/gpgsm-gencert.sh b/tools/gpgsm-gencert.sh
+index b209c8e..e7c812f 100755
+--- a/tools/gpgsm-gencert.sh
++++ b/tools/gpgsm-gencert.sh
+@@ -178,10 +178,10 @@ Key-Length: $KEY_LENGTH
+ Key-Usage: $KEY_USAGE
+ Name-DN: $NAME
+ EOF
+-[ -n "$KEY_GRIP" ] && echo "Key-Grip: $KEY_GRIP"
+-[ -n "$EMAIL_ADDRESSES" ] && echo "$EMAIL_ADDRESSES"
+-[ -n "$DNS_ADDRESSES" ] && echo "$DNS_ADDRESSES"
+-[ -n "$URI_ADDRESSES" ] && echo "$URI_ADDRESSES"
++[ -n "$KEY_GRIP" ] && echo "Key-Grip: $KEY_GRIP" || true
++[ -n "$EMAIL_ADDRESSES" ] && echo "$EMAIL_ADDRESSES" || true
++[ -n "$DNS_ADDRESSES" ] && echo "$DNS_ADDRESSES" || true
++[ -n "$URI_ADDRESSES" ] && echo "$URI_ADDRESSES" || true
+ ) > "$file_parameter"
+
+
+--
+1.7.5.rc1
+
diff --git a/app-crypt/gnupg/files/gnupg-2.0.26-Need-to-init-the-trustdb-for-import.patch b/app-crypt/gnupg/files/gnupg-2.0.26-Need-to-init-the-trustdb-for-import.patch
new file mode 100644
index 000000000000..4c9eff26fd58
--- /dev/null
+++ b/app-crypt/gnupg/files/gnupg-2.0.26-Need-to-init-the-trustdb-for-import.patch
@@ -0,0 +1,35 @@
+From a2dcc5cc49c3e79d64bd1a2ad7a5bc4df5b073ee Mon Sep 17 00:00:00 2001
+From: Kristian Fiskerstrand <kf@sumptuouscapital.com>
+Date: Wed, 13 Aug 2014 11:13:34 +0200
+Subject: [PATCH] gpg: Need to init the trustdb for import.
+
+* g10/trustdb.c (clear_ownertrusts): Init trustdb.
+
+--
+
+This was fixed in 1.4 branch in commit
+23191d7851eae2217ecdac6484349849a24fd94a but was not applied to the
+2.0 branch that exhibits the same problem. This is actually a hack
+to fix a bug introduced with commit 2528178.
+
+GnuPG-bug-id: 1622
+---
+ g10/trustdb.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/g10/trustdb.c b/g10/trustdb.c
+index f96701a..7bfef25 100644
+--- a/g10/trustdb.c
++++ b/g10/trustdb.c
+@@ -923,6 +923,8 @@ clear_ownertrusts (PKT_public_key *pk)
+ TRUSTREC rec;
+ int rc;
+
++ init_trustdb();
++
+ if (trustdb_args.no_trustdb && opt.trust_model == TM_ALWAYS)
+ return 0;
+
+--
+1.8.5.5
+
diff --git a/app-crypt/gnupg/files/gnupg-2.0.26-misc-cve.patch b/app-crypt/gnupg/files/gnupg-2.0.26-misc-cve.patch
new file mode 100644
index 000000000000..734a04abd553
--- /dev/null
+++ b/app-crypt/gnupg/files/gnupg-2.0.26-misc-cve.patch
@@ -0,0 +1,118 @@
+From ed8383c618e124cfa708c9ee87563fcdf2f4649c Mon Sep 17 00:00:00 2001
+From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+Date: Fri, 19 Dec 2014 18:53:34 -0500
+Subject: [PATCH] sm: Avoid double-free on iconv failure
+
+* sm/minip12.c: (p12_build) if jnlib_iconv_open fails, avoid
+double-free of pwbuf.
+
+--
+
+Observed by Joshua Rogers <honey@internot.info>, who proposed a
+slightly different fix.
+
+Debian-Bug-Id: 773472
+
+Added fix at a second place - wk.
+---
+ sm/minip12.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/agent/minip12.c b/agent/minip12.c
+index 01b91b7..ca4d248 100644
+--- a/agent/minip12.c
++++ b/agent/minip12.c
+@@ -2422,6 +2422,7 @@ p12_build (gcry_mpi_t *kparms, const void *cert, size_t certlen,
+ " requested charset '%s': %s\n",
+ charset, strerror (errno));
+ gcry_free (pwbuf);
++ pwbuf = NULL;
+ goto failure;
+ }
+
+@@ -2436,6 +2437,7 @@ p12_build (gcry_mpi_t *kparms, const void *cert, size_t certlen,
+ " requested charset '%s': %s\n",
+ charset, strerror (errno));
+ gcry_free (pwbuf);
++ pwbuf = NULL;
+ jnlib_iconv_close (cd);
+ goto failure;
+ }
+--
+1.7.10.4
+
+From b0b3803e8c2959dd67ca96debc54b5c6464f0d41 Mon Sep 17 00:00:00 2001
+From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
+Date: Fri, 19 Dec 2014 18:07:55 -0500
+Subject: [PATCH] scd: Avoid double-free on error condition in scd
+
+* scd/command.c (cmd_readkey): avoid double-free of cert
+
+--
+
+When ksba_cert_new() fails, cert will be double-freed.
+
+Debian-Bug-Id: 773471
+
+Original patch changed by wk to do the free only at leave.
+---
+ scd/command.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/scd/command.c b/scd/command.c
+index dd4191f..1cc580a 100644
+--- a/scd/command.c
++++ b/scd/command.c
+@@ -804,10 +804,8 @@ cmd_readkey (assuan_context_t ctx, char *line)
+
+ rc = ksba_cert_new (&kc);
+ if (rc)
+- {
+- xfree (cert);
+- goto leave;
+- }
++ goto leave;
++
+ rc = ksba_cert_init_from_mem (kc, cert, ncert);
+ if (rc)
+ {
+--
+1.7.10.4
+
+From abd5f6752d693b7f313c19604f0723ecec4d39a6 Mon Sep 17 00:00:00 2001
+From: Werner Koch <wk@gnupg.org>
+Date: Mon, 22 Dec 2014 12:16:46 +0100
+Subject: [PATCH] dirmngr,gpgsm: Return NULL on fail
+
+* dirmngr/ldapserver.c (ldapserver_parse_one): Set SERVER to NULL.
+* sm/gpgsm.c (parse_keyserver_line): Ditto.
+--
+
+Reported-by: Joshua Rogers <git@internot.info>
+
+ "If something inside the ldapserver_parse_one function failed,
+ 'server' would be freed, then returned, leading to a
+ use-after-free. This code is likely copied from sm/gpgsm.c, which
+ was also susceptible to this bug."
+
+Signed-off-by: Werner Koch <wk@gnupg.org>
+---
+ dirmngr/ldapserver.c | 1 +
+ sm/gpgsm.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/sm/gpgsm.c b/sm/gpgsm.c
+index 3398d17..72bceb4 100644
+--- a/sm/gpgsm.c
++++ b/sm/gpgsm.c
+@@ -862,6 +862,7 @@ parse_keyserver_line (char *line,
+ {
+ log_info (_("%s:%u: skipping this line\n"), filename, lineno);
+ keyserver_list_free (server);
++ server = NULL;
+ }
+
+ return server;
+--
+1.7.10.4
+
diff --git a/app-crypt/gnupg/gnupg-1.4.19.ebuild b/app-crypt/gnupg/gnupg-1.4.19.ebuild
new file mode 100644
index 000000000000..b31f8a443d5a
--- /dev/null
+++ b/app-crypt/gnupg/gnupg-1.4.19.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+ECCVER="0.2.0"
+ECCVER_GNUPG="1.4.9"
+ECC_PATCH="${PN}-${ECCVER_GNUPG}-ecc${ECCVER}.diff"
+MY_P=${P/_/}
+
+DESCRIPTION="The GNU Privacy Guard, a GPL pgp replacement"
+HOMEPAGE="http://www.gnupg.org/"
+SRC_URI="mirror://gnupg/gnupg/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-macos"
+IUSE="bzip2 curl ldap mta nls readline selinux smartcard static usb zlib"
+
+COMMON_DEPEND="
+ ldap? ( net-nds/openldap )
+ bzip2? ( app-arch/bzip2 )
+ zlib? ( sys-libs/zlib )
+ curl? ( net-misc/curl )
+ mta? ( virtual/mta )
+ readline? ( sys-libs/readline )
+ smartcard? ( =virtual/libusb-0* )
+ usb? ( =virtual/libusb-0* )"
+
+RDEPEND="!static? ( ${COMMON_DEPEND} )
+ selinux? ( sec-policy/selinux-gpg )
+ nls? ( virtual/libintl )"
+
+DEPEND="${COMMON_DEPEND}
+ dev-lang/perl
+ nls? ( sys-devel/gettext )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ # bug#469388
+ sed -i -e 's/--batch --dearmor/--homedir . --batch --dearmor/' checks/Makefile.in
+
+ # Fix PIC definitions
+ sed -i -e 's:PIC:__PIC__:' mpi/i386/mpih-{add,sub}1.S intl/relocatable.c \
+ || die "sed PIC failed"
+ sed -i -e 's:if PIC:ifdef __PIC__:' mpi/sparc32v8/mpih-mul{1,2}.S || \
+ die "sed PIC failed"
+}
+
+src_configure() {
+ # Certain sparc32 machines seem to have trouble building correctly with
+ # -mcpu enabled. While this is not a gnupg problem, it is a temporary
+ # fix until the gcc problem can be tracked down.
+ if [ "${ARCH}" == "sparc" ] && [ "${PROFILE_ARCH}" == "sparc" ]; then
+ filter-flags -mcpu=supersparc -mcpu=v8 -mcpu=v7
+ fi
+
+ # 'USE=static' support was requested in #29299
+ use static && append-ldflags -static
+
+ econf \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ $(use_enable ldap) \
+ $(use_enable mta mailto) \
+ --enable-hkp \
+ --enable-finger \
+ $(use_with !zlib included-zlib) \
+ $(use_with curl libcurl /usr) \
+ $(use_enable nls) \
+ $(use_enable bzip2) \
+ $(use_enable smartcard card-support) \
+ $(use_enable selinux selinux-support) \
+ --without-capabilities \
+ $(use_with readline) \
+ $(use_with usb libusb /usr) \
+ --enable-static-rnd=linux \
+ --libexecdir="${EPREFIX}/usr/libexec" \
+ --enable-noexecstack \
+ CC_FOR_BUILD=$(tc-getBUILD_CC) \
+ ${myconf}
+}
+
+src_install() {
+ default
+
+ # keep the documentation in /usr/share/doc/...
+ rm -rf "${ED}usr/share/gnupg/FAQ" "${ED}usr/share/gnupg/faq.html" || die
+
+ dodoc AUTHORS BUGS ChangeLog NEWS PROJECTS README THANKS \
+ TODO VERSION doc/{FAQ,HACKING,DETAILS,OpenPGP}
+
+ exeinto /usr/libexec/gnupg
+ doexe tools/make-dns-cert
+}
+
+pkg_postinst() {
+ ewarn "If you are using a non-Linux system, or a kernel older than 2.6.9,"
+ ewarn "you MUST make the gpg binary setuid."
+ echo
+# if use !bindist && use ecc; then
+# ewarn
+# ewarn "The elliptical curves patch is experimental"
+# ewarn "Further info available at http://alumnes.eps.udl.es/%7Ed4372211/index.en.html"
+# fi
+ elog
+ elog "See http://www.gentoo.org/doc/en/gnupg-user.xml for documentation on gnupg"
+ elog
+ elog "If you wish to view images emerge:"
+ elog "media-gfx/xloadimage, media-gfx/xli or any other viewer"
+ elog "Remember to use photo-viewer option in configuration file to activate the right viewer"
+}
diff --git a/app-crypt/gnupg/gnupg-2.0.26-r3.ebuild b/app-crypt/gnupg/gnupg-2.0.26-r3.ebuild
new file mode 100644
index 000000000000..055584d032f5
--- /dev/null
+++ b/app-crypt/gnupg/gnupg-2.0.26-r3.ebuild
@@ -0,0 +1,165 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="The GNU Privacy Guard, a GPL pgp replacement"
+HOMEPAGE="http://www.gnupg.org/"
+SRC_URI="mirror://gnupg/gnupg/${P}.tar.bz2"
+# SRC_URI="ftp://ftp.gnupg.org/gcrypt/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="bzip2 doc ldap nls mta readline static selinux smartcard tools usb"
+
+COMMON_DEPEND_LIBS="
+ >=dev-libs/libassuan-2
+ >=dev-libs/libgcrypt-1.4:0=
+ >=dev-libs/libgpg-error-1.11
+ >=dev-libs/libksba-1.0.7
+ >=dev-libs/pth-1.3.7
+ >=net-misc/curl-7.10
+ sys-libs/zlib
+ bzip2? ( app-arch/bzip2 )
+ readline? ( sys-libs/readline )
+ smartcard? ( usb? ( virtual/libusb:0 ) )
+ ldap? ( net-nds/openldap )"
+COMMON_DEPEND_BINS="app-crypt/pinentry"
+
+# Existence of executables is checked during configuration.
+DEPEND="${COMMON_DEPEND_LIBS}
+ ${COMMON_DEPEND_BINS}
+ static? (
+ >=dev-libs/libassuan-2[static-libs]
+ >=dev-libs/libgcrypt-1.4:0=[static-libs]
+ >=dev-libs/libgpg-error-1.11[static-libs]
+ >=dev-libs/libksba-1.0.7[static-libs]
+ >=dev-libs/pth-1.3.7[static-libs]
+ >=net-misc/curl-7.10[static-libs]
+ sys-libs/zlib[static-libs]
+ bzip2? ( app-arch/bzip2[static-libs] )
+ )
+ nls? ( sys-devel/gettext )
+ doc? ( sys-apps/texinfo )"
+
+RDEPEND="!static? ( ${COMMON_DEPEND_LIBS} )
+ ${COMMON_DEPEND_BINS}
+ mta? ( virtual/mta )
+ !<=app-crypt/gnupg-2.0.1
+ selinux? ( sec-policy/selinux-gpg )
+ nls? ( virtual/libintl )"
+
+REQUIRED_USE="smartcard? ( !static )"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-2.0.17-gpgsm-gencert.patch"
+ epatch "${FILESDIR}/${P}-Need-to-init-the-trustdb-for-import.patch"
+ epatch "${FILESDIR}/${P}-misc-cve.patch"
+ epatch_user
+}
+
+src_configure() {
+ local myconf=()
+
+ # 'USE=static' support was requested:
+ # gnupg1: bug #29299
+ # gnupg2: bug #159623
+ use static && append-ldflags -static
+
+ if use smartcard; then
+ myconf+=(
+ --enable-scdaemon
+ $(use_enable usb ccid-driver)
+ )
+ else
+ myconf+=( --disable-scdaemon )
+ fi
+
+ if use elibc_SunOS || use elibc_AIX; then
+ myconf+=( --disable-symcryptrun )
+ else
+ myconf+=( --enable-symcryptrun )
+ fi
+
+ econf \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --enable-gpg \
+ --enable-gpgsm \
+ --enable-agent \
+ --without-adns \
+ "${myconf[@]}" \
+ $(use_enable bzip2) \
+ $(use_enable nls) \
+ $(use_enable mta mailto) \
+ $(use_enable ldap) \
+ $(use_with readline) \
+ CC_FOR_BUILD="$(tc-getBUILD_CC)"
+}
+
+src_compile() {
+ default
+
+ if use doc; then
+ cd doc
+ emake html
+ fi
+}
+
+src_install() {
+ default
+
+ use tools && dobin tools/{convert-from-106,gpg-check-pattern} \
+ tools/{gpg-zip,gpgconf,gpgsplit,lspgpot,mail-signed-keys,make-dns-cert}
+
+ emake DESTDIR="${D}" -f doc/Makefile uninstall-nobase_dist_docDATA
+ rm "${ED}"/usr/share/gnupg/help* || die
+
+ dodoc ChangeLog NEWS README THANKS TODO VERSION doc/FAQ doc/DETAILS \
+ doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER doc/help*
+
+ dosym gpg2 /usr/bin/gpg
+ dosym gpgv2 /usr/bin/gpgv
+ dosym gpg2keys_hkp /usr/libexec/gpgkeys_hkp
+ dosym gpg2keys_finger /usr/libexec/gpgkeys_finger
+ dosym gpg2keys_curl /usr/libexec/gpgkeys_curl
+ if use ldap; then
+ dosym gpg2keys_ldap /usr/libexec/gpgkeys_ldap
+ fi
+ echo ".so man1/gpg2.1" > "${ED}"/usr/share/man/man1/gpg.1
+ echo ".so man1/gpgv2.1" > "${ED}"/usr/share/man/man1/gpgv.1
+
+ dodir /etc/env.d
+ echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg
+
+ if use doc; then
+ dohtml doc/gnupg.html/* doc/*.png
+ fi
+}
+
+pkg_postinst() {
+ elog "If you wish to view images emerge:"
+ elog "media-gfx/xloadimage, media-gfx/xli or any other viewer"
+ elog "Remember to use photo-viewer option in configuration file to activate"
+ elog "the right viewer."
+ elog
+
+ if use smartcard; then
+ elog "To use your OpenPGP smartcard (or token) with GnuPG you need one of"
+ use usb && elog " - a CCID-compatible reader, used directly through libusb;"
+ elog " - sys-apps/pcsc-lite and a compatible reader device;"
+ elog " - dev-libs/openct and a compatible reader device;"
+ elog " - a reader device and drivers exporting either PC/SC or CT-API interfaces."
+ elog ""
+ elog "General hint: you probably want to try installing sys-apps/pcsc-lite and"
+ elog "app-crypt/ccid first."
+ fi
+
+ ewarn "Please remember to restart gpg-agent if a different version"
+ ewarn "of the agent is currently used. If you are unsure of the gpg"
+ ewarn "agent you are using please run 'killall gpg-agent',"
+ ewarn "and to start a fresh daemon just run 'gpg-agent --daemon'."
+}
diff --git a/app-crypt/gnupg/gnupg-2.0.27-r1.ebuild b/app-crypt/gnupg/gnupg-2.0.27-r1.ebuild
new file mode 100644
index 000000000000..4e5e91e25b3d
--- /dev/null
+++ b/app-crypt/gnupg/gnupg-2.0.27-r1.ebuild
@@ -0,0 +1,167 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="The GNU Privacy Guard, a GPL pgp replacement"
+HOMEPAGE="http://www.gnupg.org/"
+SRC_URI="mirror://gnupg/gnupg/${P}.tar.bz2"
+# SRC_URI="ftp://ftp.gnupg.org/gcrypt/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="bzip2 doc ldap nls mta readline static selinux smartcard tools usb"
+
+COMMON_DEPEND_LIBS="
+ >=dev-libs/libassuan-2
+ >=dev-libs/libgcrypt-1.4:0=
+ >=dev-libs/libgpg-error-1.11
+ >=dev-libs/libksba-1.0.7
+ >=dev-libs/pth-1.3.7
+ >=net-misc/curl-7.10
+ sys-libs/zlib
+ bzip2? ( app-arch/bzip2 )
+ readline? ( sys-libs/readline )
+ smartcard? ( usb? ( virtual/libusb:0 ) )
+ ldap? ( net-nds/openldap )"
+COMMON_DEPEND_BINS="app-crypt/pinentry"
+
+# Existence of executables is checked during configuration.
+DEPEND="${COMMON_DEPEND_LIBS}
+ ${COMMON_DEPEND_BINS}
+ static? (
+ >=dev-libs/libassuan-2[static-libs]
+ >=dev-libs/libgcrypt-1.4:0=[static-libs]
+ >=dev-libs/libgpg-error-1.11[static-libs]
+ >=dev-libs/libksba-1.0.7[static-libs]
+ >=dev-libs/pth-1.3.7[static-libs]
+ >=net-misc/curl-7.10[static-libs]
+ sys-libs/zlib[static-libs]
+ bzip2? ( app-arch/bzip2[static-libs] )
+ )
+ nls? ( sys-devel/gettext )
+ doc? ( sys-apps/texinfo )"
+
+RDEPEND="!static? ( ${COMMON_DEPEND_LIBS} )
+ ${COMMON_DEPEND_BINS}
+ mta? ( virtual/mta )
+ !<=app-crypt/gnupg-2.0.1
+ selinux? ( sec-policy/selinux-gpg )
+ nls? ( virtual/libintl )"
+
+REQUIRED_USE="smartcard? ( !static )"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-2.0.17-gpgsm-gencert.patch"
+ epatch_user
+}
+
+src_configure() {
+ local myconf=()
+
+ # 'USE=static' support was requested:
+ # gnupg1: bug #29299
+ # gnupg2: bug #159623
+ use static && append-ldflags -static
+
+ if use smartcard; then
+ myconf+=(
+ --enable-scdaemon
+ $(use_enable usb ccid-driver)
+ )
+ else
+ myconf+=( --disable-scdaemon )
+ fi
+
+ if use elibc_SunOS || use elibc_AIX; then
+ myconf+=( --disable-symcryptrun )
+ else
+ myconf+=( --enable-symcryptrun )
+ fi
+
+ # glib fails and picks up clang's internal stdint.h causing weird errors
+ [[ ${CC} == clang ]] && export gl_cv_absolute_stdint_h=/usr/include/stdint.h
+
+ econf \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --enable-gpg \
+ --enable-gpgsm \
+ --enable-agent \
+ --enable-large-secmem \
+ --without-adns \
+ "${myconf[@]}" \
+ $(use_enable bzip2) \
+ $(use_enable nls) \
+ $(use_enable mta mailto) \
+ $(use_enable ldap) \
+ $(use_with readline) \
+ CC_FOR_BUILD="$(tc-getBUILD_CC)"
+}
+
+src_compile() {
+ default
+
+ if use doc; then
+ cd doc
+ emake html
+ fi
+}
+
+src_install() {
+ default
+
+ use tools && dobin tools/{convert-from-106,gpg-check-pattern} \
+ tools/{gpg-zip,gpgconf,gpgsplit,lspgpot,mail-signed-keys,make-dns-cert}
+
+ emake DESTDIR="${D}" -f doc/Makefile uninstall-nobase_dist_docDATA
+ rm "${ED}"/usr/share/gnupg/help* || die
+
+ dodoc ChangeLog NEWS README THANKS TODO VERSION doc/FAQ doc/DETAILS \
+ doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER doc/help*
+
+ dosym gpg2 /usr/bin/gpg
+ dosym gpgv2 /usr/bin/gpgv
+ dosym gpg2keys_hkp /usr/libexec/gpgkeys_hkp
+ dosym gpg2keys_finger /usr/libexec/gpgkeys_finger
+ dosym gpg2keys_curl /usr/libexec/gpgkeys_curl
+ if use ldap; then
+ dosym gpg2keys_ldap /usr/libexec/gpgkeys_ldap
+ fi
+ echo ".so man1/gpg2.1" > "${ED}"/usr/share/man/man1/gpg.1
+ echo ".so man1/gpgv2.1" > "${ED}"/usr/share/man/man1/gpgv.1
+
+ dodir /etc/env.d
+ echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg
+
+ if use doc; then
+ dohtml doc/gnupg.html/* doc/*.png
+ fi
+}
+
+pkg_postinst() {
+ elog "If you wish to view images emerge:"
+ elog "media-gfx/xloadimage, media-gfx/xli or any other viewer"
+ elog "Remember to use photo-viewer option in configuration file to activate"
+ elog "the right viewer."
+ elog
+
+ if use smartcard; then
+ elog "To use your OpenPGP smartcard (or token) with GnuPG you need one of"
+ use usb && elog " - a CCID-compatible reader, used directly through libusb;"
+ elog " - sys-apps/pcsc-lite and a compatible reader device;"
+ elog " - dev-libs/openct and a compatible reader device;"
+ elog " - a reader device and drivers exporting either PC/SC or CT-API interfaces."
+ elog ""
+ elog "General hint: you probably want to try installing sys-apps/pcsc-lite and"
+ elog "app-crypt/ccid first."
+ fi
+
+ ewarn "Please remember to restart gpg-agent if a different version"
+ ewarn "of the agent is currently used. If you are unsure of the gpg"
+ ewarn "agent you are using please run 'killall gpg-agent',"
+ ewarn "and to start a fresh daemon just run 'gpg-agent --daemon'."
+}
diff --git a/app-crypt/gnupg/gnupg-2.0.27.ebuild b/app-crypt/gnupg/gnupg-2.0.27.ebuild
new file mode 100644
index 000000000000..ffb48b43721d
--- /dev/null
+++ b/app-crypt/gnupg/gnupg-2.0.27.ebuild
@@ -0,0 +1,163 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="The GNU Privacy Guard, a GPL pgp replacement"
+HOMEPAGE="http://www.gnupg.org/"
+SRC_URI="mirror://gnupg/gnupg/${P}.tar.bz2"
+# SRC_URI="ftp://ftp.gnupg.org/gcrypt/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="bzip2 doc ldap nls mta readline static selinux smartcard tools usb"
+
+COMMON_DEPEND_LIBS="
+ >=dev-libs/libassuan-2
+ >=dev-libs/libgcrypt-1.4:0=
+ >=dev-libs/libgpg-error-1.11
+ >=dev-libs/libksba-1.0.7
+ >=dev-libs/pth-1.3.7
+ >=net-misc/curl-7.10
+ sys-libs/zlib
+ bzip2? ( app-arch/bzip2 )
+ readline? ( sys-libs/readline )
+ smartcard? ( usb? ( virtual/libusb:0 ) )
+ ldap? ( net-nds/openldap )"
+COMMON_DEPEND_BINS="app-crypt/pinentry"
+
+# Existence of executables is checked during configuration.
+DEPEND="${COMMON_DEPEND_LIBS}
+ ${COMMON_DEPEND_BINS}
+ static? (
+ >=dev-libs/libassuan-2[static-libs]
+ >=dev-libs/libgcrypt-1.4:0=[static-libs]
+ >=dev-libs/libgpg-error-1.11[static-libs]
+ >=dev-libs/libksba-1.0.7[static-libs]
+ >=dev-libs/pth-1.3.7[static-libs]
+ >=net-misc/curl-7.10[static-libs]
+ sys-libs/zlib[static-libs]
+ bzip2? ( app-arch/bzip2[static-libs] )
+ )
+ nls? ( sys-devel/gettext )
+ doc? ( sys-apps/texinfo )"
+
+RDEPEND="!static? ( ${COMMON_DEPEND_LIBS} )
+ ${COMMON_DEPEND_BINS}
+ mta? ( virtual/mta )
+ !<=app-crypt/gnupg-2.0.1
+ selinux? ( sec-policy/selinux-gpg )
+ nls? ( virtual/libintl )"
+
+REQUIRED_USE="smartcard? ( !static )"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-2.0.17-gpgsm-gencert.patch"
+ epatch_user
+}
+
+src_configure() {
+ local myconf=()
+
+ # 'USE=static' support was requested:
+ # gnupg1: bug #29299
+ # gnupg2: bug #159623
+ use static && append-ldflags -static
+
+ if use smartcard; then
+ myconf+=(
+ --enable-scdaemon
+ $(use_enable usb ccid-driver)
+ )
+ else
+ myconf+=( --disable-scdaemon )
+ fi
+
+ if use elibc_SunOS || use elibc_AIX; then
+ myconf+=( --disable-symcryptrun )
+ else
+ myconf+=( --enable-symcryptrun )
+ fi
+
+ econf \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --enable-gpg \
+ --enable-gpgsm \
+ --enable-agent \
+ --without-adns \
+ "${myconf[@]}" \
+ $(use_enable bzip2) \
+ $(use_enable nls) \
+ $(use_enable mta mailto) \
+ $(use_enable ldap) \
+ $(use_with readline) \
+ CC_FOR_BUILD="$(tc-getBUILD_CC)"
+}
+
+src_compile() {
+ default
+
+ if use doc; then
+ cd doc
+ emake html
+ fi
+}
+
+src_install() {
+ default
+
+ use tools && dobin tools/{convert-from-106,gpg-check-pattern} \
+ tools/{gpg-zip,gpgconf,gpgsplit,lspgpot,mail-signed-keys,make-dns-cert}
+
+ emake DESTDIR="${D}" -f doc/Makefile uninstall-nobase_dist_docDATA
+ rm "${ED}"/usr/share/gnupg/help* || die
+
+ dodoc ChangeLog NEWS README THANKS TODO VERSION doc/FAQ doc/DETAILS \
+ doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER doc/help*
+
+ dosym gpg2 /usr/bin/gpg
+ dosym gpgv2 /usr/bin/gpgv
+ dosym gpg2keys_hkp /usr/libexec/gpgkeys_hkp
+ dosym gpg2keys_finger /usr/libexec/gpgkeys_finger
+ dosym gpg2keys_curl /usr/libexec/gpgkeys_curl
+ if use ldap; then
+ dosym gpg2keys_ldap /usr/libexec/gpgkeys_ldap
+ fi
+ echo ".so man1/gpg2.1" > "${ED}"/usr/share/man/man1/gpg.1
+ echo ".so man1/gpgv2.1" > "${ED}"/usr/share/man/man1/gpgv.1
+
+ dodir /etc/env.d
+ echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg
+
+ if use doc; then
+ dohtml doc/gnupg.html/* doc/*.png
+ fi
+}
+
+pkg_postinst() {
+ elog "If you wish to view images emerge:"
+ elog "media-gfx/xloadimage, media-gfx/xli or any other viewer"
+ elog "Remember to use photo-viewer option in configuration file to activate"
+ elog "the right viewer."
+ elog
+
+ if use smartcard; then
+ elog "To use your OpenPGP smartcard (or token) with GnuPG you need one of"
+ use usb && elog " - a CCID-compatible reader, used directly through libusb;"
+ elog " - sys-apps/pcsc-lite and a compatible reader device;"
+ elog " - dev-libs/openct and a compatible reader device;"
+ elog " - a reader device and drivers exporting either PC/SC or CT-API interfaces."
+ elog ""
+ elog "General hint: you probably want to try installing sys-apps/pcsc-lite and"
+ elog "app-crypt/ccid first."
+ fi
+
+ ewarn "Please remember to restart gpg-agent if a different version"
+ ewarn "of the agent is currently used. If you are unsure of the gpg"
+ ewarn "agent you are using please run 'killall gpg-agent',"
+ ewarn "and to start a fresh daemon just run 'gpg-agent --daemon'."
+}
diff --git a/app-crypt/gnupg/gnupg-2.0.28.ebuild b/app-crypt/gnupg/gnupg-2.0.28.ebuild
new file mode 100644
index 000000000000..4e5e91e25b3d
--- /dev/null
+++ b/app-crypt/gnupg/gnupg-2.0.28.ebuild
@@ -0,0 +1,167 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="The GNU Privacy Guard, a GPL pgp replacement"
+HOMEPAGE="http://www.gnupg.org/"
+SRC_URI="mirror://gnupg/gnupg/${P}.tar.bz2"
+# SRC_URI="ftp://ftp.gnupg.org/gcrypt/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="bzip2 doc ldap nls mta readline static selinux smartcard tools usb"
+
+COMMON_DEPEND_LIBS="
+ >=dev-libs/libassuan-2
+ >=dev-libs/libgcrypt-1.4:0=
+ >=dev-libs/libgpg-error-1.11
+ >=dev-libs/libksba-1.0.7
+ >=dev-libs/pth-1.3.7
+ >=net-misc/curl-7.10
+ sys-libs/zlib
+ bzip2? ( app-arch/bzip2 )
+ readline? ( sys-libs/readline )
+ smartcard? ( usb? ( virtual/libusb:0 ) )
+ ldap? ( net-nds/openldap )"
+COMMON_DEPEND_BINS="app-crypt/pinentry"
+
+# Existence of executables is checked during configuration.
+DEPEND="${COMMON_DEPEND_LIBS}
+ ${COMMON_DEPEND_BINS}
+ static? (
+ >=dev-libs/libassuan-2[static-libs]
+ >=dev-libs/libgcrypt-1.4:0=[static-libs]
+ >=dev-libs/libgpg-error-1.11[static-libs]
+ >=dev-libs/libksba-1.0.7[static-libs]
+ >=dev-libs/pth-1.3.7[static-libs]
+ >=net-misc/curl-7.10[static-libs]
+ sys-libs/zlib[static-libs]
+ bzip2? ( app-arch/bzip2[static-libs] )
+ )
+ nls? ( sys-devel/gettext )
+ doc? ( sys-apps/texinfo )"
+
+RDEPEND="!static? ( ${COMMON_DEPEND_LIBS} )
+ ${COMMON_DEPEND_BINS}
+ mta? ( virtual/mta )
+ !<=app-crypt/gnupg-2.0.1
+ selinux? ( sec-policy/selinux-gpg )
+ nls? ( virtual/libintl )"
+
+REQUIRED_USE="smartcard? ( !static )"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-2.0.17-gpgsm-gencert.patch"
+ epatch_user
+}
+
+src_configure() {
+ local myconf=()
+
+ # 'USE=static' support was requested:
+ # gnupg1: bug #29299
+ # gnupg2: bug #159623
+ use static && append-ldflags -static
+
+ if use smartcard; then
+ myconf+=(
+ --enable-scdaemon
+ $(use_enable usb ccid-driver)
+ )
+ else
+ myconf+=( --disable-scdaemon )
+ fi
+
+ if use elibc_SunOS || use elibc_AIX; then
+ myconf+=( --disable-symcryptrun )
+ else
+ myconf+=( --enable-symcryptrun )
+ fi
+
+ # glib fails and picks up clang's internal stdint.h causing weird errors
+ [[ ${CC} == clang ]] && export gl_cv_absolute_stdint_h=/usr/include/stdint.h
+
+ econf \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --enable-gpg \
+ --enable-gpgsm \
+ --enable-agent \
+ --enable-large-secmem \
+ --without-adns \
+ "${myconf[@]}" \
+ $(use_enable bzip2) \
+ $(use_enable nls) \
+ $(use_enable mta mailto) \
+ $(use_enable ldap) \
+ $(use_with readline) \
+ CC_FOR_BUILD="$(tc-getBUILD_CC)"
+}
+
+src_compile() {
+ default
+
+ if use doc; then
+ cd doc
+ emake html
+ fi
+}
+
+src_install() {
+ default
+
+ use tools && dobin tools/{convert-from-106,gpg-check-pattern} \
+ tools/{gpg-zip,gpgconf,gpgsplit,lspgpot,mail-signed-keys,make-dns-cert}
+
+ emake DESTDIR="${D}" -f doc/Makefile uninstall-nobase_dist_docDATA
+ rm "${ED}"/usr/share/gnupg/help* || die
+
+ dodoc ChangeLog NEWS README THANKS TODO VERSION doc/FAQ doc/DETAILS \
+ doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER doc/help*
+
+ dosym gpg2 /usr/bin/gpg
+ dosym gpgv2 /usr/bin/gpgv
+ dosym gpg2keys_hkp /usr/libexec/gpgkeys_hkp
+ dosym gpg2keys_finger /usr/libexec/gpgkeys_finger
+ dosym gpg2keys_curl /usr/libexec/gpgkeys_curl
+ if use ldap; then
+ dosym gpg2keys_ldap /usr/libexec/gpgkeys_ldap
+ fi
+ echo ".so man1/gpg2.1" > "${ED}"/usr/share/man/man1/gpg.1
+ echo ".so man1/gpgv2.1" > "${ED}"/usr/share/man/man1/gpgv.1
+
+ dodir /etc/env.d
+ echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg
+
+ if use doc; then
+ dohtml doc/gnupg.html/* doc/*.png
+ fi
+}
+
+pkg_postinst() {
+ elog "If you wish to view images emerge:"
+ elog "media-gfx/xloadimage, media-gfx/xli or any other viewer"
+ elog "Remember to use photo-viewer option in configuration file to activate"
+ elog "the right viewer."
+ elog
+
+ if use smartcard; then
+ elog "To use your OpenPGP smartcard (or token) with GnuPG you need one of"
+ use usb && elog " - a CCID-compatible reader, used directly through libusb;"
+ elog " - sys-apps/pcsc-lite and a compatible reader device;"
+ elog " - dev-libs/openct and a compatible reader device;"
+ elog " - a reader device and drivers exporting either PC/SC or CT-API interfaces."
+ elog ""
+ elog "General hint: you probably want to try installing sys-apps/pcsc-lite and"
+ elog "app-crypt/ccid first."
+ fi
+
+ ewarn "Please remember to restart gpg-agent if a different version"
+ ewarn "of the agent is currently used. If you are unsure of the gpg"
+ ewarn "agent you are using please run 'killall gpg-agent',"
+ ewarn "and to start a fresh daemon just run 'gpg-agent --daemon'."
+}
diff --git a/app-crypt/gnupg/gnupg-2.1.6.ebuild b/app-crypt/gnupg/gnupg-2.1.6.ebuild
new file mode 100644
index 000000000000..2f40259fd38b
--- /dev/null
+++ b/app-crypt/gnupg/gnupg-2.1.6.ebuild
@@ -0,0 +1,170 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="The GNU Privacy Guard, a GPL OpenPGP implementation"
+HOMEPAGE="http://www.gnupg.org/"
+MY_P="${P/_/-}"
+SRC_URI="mirror://gnupg/gnupg/${MY_P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~x86"
+IUSE="bzip2 doc +gnutls ldap nls readline static selinux smartcard tools usb"
+
+COMMON_DEPEND_LIBS="
+ dev-libs/npth
+ >=dev-libs/libassuan-2
+ >=dev-libs/libgcrypt-1.6.2
+ >=dev-libs/libgpg-error-1.17
+ >=dev-libs/libksba-1.0.7
+ >=net-misc/curl-7.10
+ gnutls? ( >=net-libs/gnutls-3.0 )
+ sys-libs/zlib
+ ldap? ( net-nds/openldap )
+ bzip2? ( app-arch/bzip2 )
+ readline? ( sys-libs/readline:= )
+ smartcard? ( usb? ( virtual/libusb:0 ) )
+ "
+COMMON_DEPEND_BINS="app-crypt/pinentry
+ !app-crypt/dirmngr"
+
+# Existence of executables is checked during configuration.
+DEPEND="${COMMON_DEPEND_LIBS}
+ ${COMMON_DEPEND_BINS}
+ static? (
+ >=dev-libs/libassuan-2[static-libs]
+ >=dev-libs/libgcrypt-1.6.2[static-libs]
+ >=dev-libs/libgpg-error-1.17[static-libs]
+ >=dev-libs/libksba-1.0.7[static-libs]
+ dev-libs/npth[static-libs]
+ >=net-misc/curl-7.10[static-libs]
+ sys-libs/zlib[static-libs]
+ bzip2? ( app-arch/bzip2[static-libs] )
+ )
+ nls? ( sys-devel/gettext )
+ doc? ( sys-apps/texinfo )"
+
+RDEPEND="!static? ( ${COMMON_DEPEND_LIBS} )
+ ${COMMON_DEPEND_BINS}
+ selinux? ( sec-policy/selinux-gpg )
+ nls? ( virtual/libintl )"
+
+REQUIRED_USE="smartcard? ( !static )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-2.0.17-gpgsm-gencert.patch"
+ epatch_user
+}
+
+src_configure() {
+ local myconf=()
+
+ # 'USE=static' support was requested:
+ # gnupg1: bug #29299
+ # gnupg2: bug #159623
+ use static && append-ldflags -static
+
+ if use smartcard; then
+ myconf+=(
+ --enable-scdaemon
+ $(use_enable usb ccid-driver)
+ )
+ else
+ myconf+=( --disable-scdaemon )
+ fi
+
+ if use elibc_SunOS || use elibc_AIX; then
+ myconf+=( --disable-symcryptrun )
+ else
+ myconf+=( --enable-symcryptrun )
+ fi
+
+ # glib fails and picks up clang's internal stdint.h causing weird errors
+ [[ ${CC} == clang ]] && export gl_cv_absolute_stdint_h=/usr/include/stdint.h
+
+ econf \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" \
+ --enable-gpg \
+ --enable-gpgsm \
+ --enable-large-secmem \
+ --without-adns \
+ "${myconf[@]}" \
+ $(use_enable bzip2) \
+ $(use_enable gnutls) \
+ $(use_with ldap) \
+ $(use_enable nls) \
+ $(use_with readline) \
+ CC_FOR_BUILD="$(tc-getBUILD_CC)"
+}
+
+src_compile() {
+ default
+
+ if use doc; then
+ cd doc
+ emake html
+ fi
+}
+
+src_install() {
+ default
+
+ use tools && dobin tools/{convert-from-106,gpg-check-pattern} \
+ tools/{gpg-zip,gpgconf,gpgsplit,lspgpot,mail-signed-keys,make-dns-cert}
+
+ emake DESTDIR="${D}" -f doc/Makefile uninstall-nobase_dist_docDATA
+ rm "${ED}"/usr/share/gnupg/help* || die
+
+ dodoc ChangeLog NEWS README THANKS TODO VERSION doc/FAQ doc/DETAILS \
+ doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER doc/help*
+
+ dosym gpg2 /usr/bin/gpg
+ dosym gpgv2 /usr/bin/gpgv
+ echo ".so man1/gpg2.1" > "${ED}"/usr/share/man/man1/gpg.1
+ echo ".so man1/gpgv2.1" > "${ED}"/usr/share/man/man1/gpgv.1
+
+ dodir /etc/env.d
+ echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg
+
+ if use doc; then
+ dohtml doc/gnupg.html/* doc/*.png
+ fi
+}
+
+pkg_postinst() {
+ elog "If you wish to view images emerge:"
+ elog "media-gfx/xloadimage, media-gfx/xli or any other viewer"
+ elog "Remember to use photo-viewer option in configuration file to activate"
+ elog "the right viewer."
+ elog
+
+ if use smartcard; then
+ elog "To use your OpenPGP smartcard (or token) with GnuPG you need one of"
+ use usb && elog " - a CCID-compatible reader, used directly through libusb;"
+ elog " - sys-apps/pcsc-lite and a compatible reader device;"
+ elog " - dev-libs/openct and a compatible reader device;"
+ elog " - a reader device and drivers exporting either PC/SC or CT-API interfaces."
+ elog ""
+ elog "General hint: you probably want to try installing sys-apps/pcsc-lite and"
+ elog "app-crypt/ccid first."
+ fi
+
+ ewarn "Please remember to restart gpg-agent if a different version"
+ ewarn "of the agent is currently used. If you are unsure of the gpg"
+ ewarn "agent you are using please run 'killall gpg-agent',"
+ ewarn "and to start a fresh daemon just run 'gpg-agent --daemon'."
+
+ if [[ -n ${REPLACING_VERSIONS} ]]; then
+ elog "If upgrading from a version prior than 2.1 you might have to re-import"
+ elog "secret keys after restarting the gpg-agent as the new version is using"
+ elog "a new storage mechanism."
+ elog "You can migrate the keys using gpg --import \$HOME/.gnupg/secring.gpg"
+ fi
+}
diff --git a/app-crypt/gnupg/metadata.xml b/app-crypt/gnupg/metadata.xml
new file mode 100644
index 000000000000..de969bccd57d
--- /dev/null
+++ b/app-crypt/gnupg/metadata.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>crypto</herd>
+ <longdescription>
+ GnuPG is a complete and free implementation of the OpenPGP standard as
+ defined by RFC4880.
+ </longdescription>
+ <use>
+ <flag name='smartcard' restrict='&lt;app-crypt/gnupg-2.0.17-r1'>
+ Bring in <pkg>dev-libs/libusb</pkg> as a dependency; enable
+ scdaemon.
+ </flag>
+ <flag name='smartcard' restrict='&gt;=app-crypt/gnupg-2.0.17-r1'>
+ Build scdaemon software. Enables usage of OpenPGP cards. For
+ other type of smartcards, try
+ <pkg>app-crypt/gnupg-pkcs11-scd</pkg>.
+ </flag>
+ <flag name='usb' restrict='&gt;=app-crypt/gnupg-2.0.17-r1'>
+ Build direct CCID access for scdaemon; requires
+ <pkg>dev-libs/libusb</pkg>.
+ </flag>
+ <flag name='mta'>
+ Build mta support using
+ <pkg>virtual/mta</pkg>.
+ </flag>
+ <flag name='tools'>
+ Install extra tools.
+ </flag>
+ </use>
+</pkgmetadata>