summaryrefslogtreecommitdiff
path: root/app-crypt/gnupg
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-crypt/gnupg
reinit the tree, so we can have metadata
Diffstat (limited to 'app-crypt/gnupg')
-rw-r--r--app-crypt/gnupg/Manifest17
-rw-r--r--app-crypt/gnupg/files/gnupg-2.1.20-gpg-Fix-typo.patch27
-rw-r--r--app-crypt/gnupg/files/gnupg-2.1.20-gpg-Properly-account-for-ring-trust-packets.patch86
-rw-r--r--app-crypt/gnupg/files/gnupg-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch33
-rw-r--r--app-crypt/gnupg/files/gnupg-2.2.1-fix-gnupg-wait.patch85
-rw-r--r--app-crypt/gnupg/gnupg-1.4.21.ebuild114
-rw-r--r--app-crypt/gnupg/gnupg-2.1.15.ebuild157
-rw-r--r--app-crypt/gnupg/gnupg-2.1.20-r1.ebuild122
-rw-r--r--app-crypt/gnupg/gnupg-2.2.0.ebuild123
-rw-r--r--app-crypt/gnupg/gnupg-2.2.1.ebuild129
-rw-r--r--app-crypt/gnupg/metadata.xml38
11 files changed, 931 insertions, 0 deletions
diff --git a/app-crypt/gnupg/Manifest b/app-crypt/gnupg/Manifest
new file mode 100644
index 000000000000..5d74585ffe30
--- /dev/null
+++ b/app-crypt/gnupg/Manifest
@@ -0,0 +1,17 @@
+AUX gnupg-2.1.20-gpg-Fix-typo.patch 843 SHA256 bd465cb0a40e83825b5e95ba0d9886be433e1b3dc85e78558c8abf103801ba59 SHA512 eb451eedb3e0282f3b7d10d0b12753a55b6bd92b2cdfc1dce5a9ffe1f0015cc598193193a8c8292371fb285517016d69ec70b7820f9dc0047e33b2e3f16214ed WHIRLPOOL 507a2206694a77dab35482e4701be13a062f7f983f80e3b632a10939d3229f756014f7d9f0b85b2214bf44e0d6ded16580bf4c4946682c5eeaa1c13731f2c29b
+AUX gnupg-2.1.20-gpg-Properly-account-for-ring-trust-packets.patch 2987 SHA256 55e997ebfb0cb49e8ad5b10fdbbb742986a6ee51f41f8a42334fdb30cec49de9 SHA512 2cf3147638c69f49b4d792a01321b5892f882fc67a1aee8f51f9b35761e6961e9c46d9abc92b0e5250a85b7145e69ba9583b3ce2323943587feb52a029e95deb WHIRLPOOL 06a9fb5a569fe8adfde5168f5f4c604ba4b80351870c3a595b8711ef5a1ecc3076a1ac5f297e593a3e35aac27565dd2d092a8c9729c6f3ce9b98f2fc507d975d
+AUX gnupg-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch 1048 SHA256 cc24f9fdccbeab4d7101b982e39d6df69e4d7da677bd580c0cc8447d23421eec SHA512 fd12827150e96cd7979ea9611d64ed4ab9e6c61cfecdd697b8fb4d162f20985b734c2bfc365a921809b9029e86a85a9b36c10ec472b3dd49c25ea18f5aef56ce WHIRLPOOL 7fae3a8805b279b5120a975728cc34bc026a3e1f83aaaa7b9b410f62daf2681bb05a3daf5ca4f7b1d28c85d91d5ab4209203eb95da7a48062efa2120d1af78d8
+AUX gnupg-2.2.1-fix-gnupg-wait.patch 2881 SHA256 c831b1eb578e60defb0a8a71def67b450b17f9f4cb614798c9ae2d062c681c04 SHA512 3622c1667c3f0b0acb28fd3ac440af76c0f2757e1d654fbd85344a1193a088db087861f7410e249ece5c99fd7afd7d7a24c43f58e88f5c21949195714be4cbf6 WHIRLPOOL 77825329ed39e583dc7084a8213f67b5adaba2e6e24bcc5d9d13e095821fef3505cf61c67cc89d8c0f5ba04f7d976b976d24b607f8b17201a02cffcc136fed87
+DIST gnupg-1.4.21.tar.bz2 3689305 SHA256 6b47a3100c857dcab3c60e6152e56a997f2c7862c1b8b2b25adf3884a1ae2276 SHA512 619e0fbc10310c7e55d129027e2945791fe91a0884b1d6f53acb4b2e380d1c6e71d1a516a59876182c5c70a4227d44a74ceda018c343b5291fa9a5d6de77c984 WHIRLPOOL eb596be347dd90be93d381fe405e50f5808160b546705493bc9d817d521ea236a2374648e6c2cab396f54bba74de4caf2b92e894df3a17aa339f014ef8cc8802
+DIST gnupg-2.1.15.tar.bz2 5723689 SHA256 c28c1a208f1b8ad63bdb6b88d252f6734ff4d33de6b54e38494b11d49e00ffdd SHA512 69c943e853e1a37e8b17b3bc34e1503f14bc8f189fa9f3ac6644bcc98ccce6eaef64da20ff9dd1c8de3a7789ea577167984ccf3ac286cac50752e6f7c2f42ab1 WHIRLPOOL 4c5a8cd4e8b7196f4a355ce7739cf6e23c43817414e10bbba219117e4e51c4c618ffb5dbce27cb836a2171eda58e003d5ddf78d4af09a813c2a1729963413151
+DIST gnupg-2.1.20.tar.bz2 6456128 SHA256 24cf9a69369be64a9f6f8cc11a1be33ab7780ad77a6a1b93719438f49f69960d SHA512 14a9890bc64e143f87cff121dd298d490d78dbd34e36883e0f25763ff9064e5706a7632893d7c5d0e8e9b8cf9cdb0d378b4ce1715348729f0fc080455b61eca9 WHIRLPOOL fa6cbd66031cac41db308b10bebec87e37a19d3c63219d22fb874d7d016bcad057b93eeece7a64001718ee1f881199e3d3eebc8ef6625691f553b0d2dbc92624
+DIST gnupg-2.2.0.tar.bz2 6532475 SHA256 d4514a0be0f7a1ff263193330019eb4b53c82f0f5e230af3c14df371271a45e6 SHA512 8ab7c4183d2ec2e6b62066e3cbcba95babaa0ae22da47feab716698792d26495f072d50e8ec612b8d26147636bb316320c78940184373b3f4cb6ec411933361b WHIRLPOOL c918b6a7e40ff170e1ff3b77978cb7f0d9298a3410204677955dc167b114a1f85d32deaca4f006c2bd621f532379ca9631b96913bf660394a82ab4ee0bbbaecb
+DIST gnupg-2.2.1.tar.bz2 6537959 SHA256 34d70cd65b9c95f3f2f90a9f5c1e0b6a0fe039a8d685e2d66d69c33d1cbf62fb SHA512 fcda7ea360d9928bf9e410afe3806ee0692dd533443b0c0e050605a9e2e37ec16f3c60a30b30ab137155327bc1f5d2107f1e792582e3ad245b47bf39a1a61a8f WHIRLPOOL 032d26c79aebcda3529f7cfcdec467e1058d19fa939eae48fd086e7c9f585a7b02dc9e6fb04a342fab845b9eb0d51c3bc2cca4a4d9677683a23bdd5c479b4eba
+EBUILD gnupg-1.4.21.ebuild 3345 SHA256 6b441756eae4e86f212092330acea93ef31e82be0903df125e3060746726eecb SHA512 14a708c00e98c76fa6ef1f2d878f84f63d8e110f85b35b9c40b6da80525af685df09ea83eb1dd1fce1fe3016b9e12a46c02c91f11ea78496c12301acbf04d257 WHIRLPOOL afc261211aa9a4620501359bc7622e61916db6144d70dd3d5e48fe471952c4b865b1fe7911c64bdcdb848120b5620ad445f24aa36b452a02aaafcf21abde998d
+EBUILD gnupg-2.1.15.ebuild 4570 SHA256 8a8a2a347184293403d78eb604f2c520ac716e162cb8acfc21795952abe9b07f SHA512 385f5c40a42559e3b686d16dedc2ca442dd0a075514184e67eef97624cc419bd0bfc7f7ca6fdd3dc549cb4e3beafce656b725adcf201d27b151dab6456346875 WHIRLPOOL be781ec9278f2b9284e139dccbaa986a2c2860f74bd3933a6ce5e325b4ac6cd7b0301c31331955e308d71c754c2a00922a8a2ea8db7178ed73e9135a8d3293a8
+EBUILD gnupg-2.1.20-r1.ebuild 3102 SHA256 1e8c8bdee0c90d9ea51b3ed3e940a4f4e7e67c823816961ca75e02e8b726dc03 SHA512 68eafca6339bab0f118c5ff9119a984ee2b7432942929d429a430c053da568ed7729d13a507d073bebc8a273e74eb40f66585ef84cc9b83181f2ea5d6990d615 WHIRLPOOL 99ee773c6aec668d1e4ebbb9ef65792e26f01088d54443dff0578de61ca9d665ba30e96be80cd7e447abb9fed56f3061aff7c224941de90f31ee2134995a8adc
+EBUILD gnupg-2.2.0.ebuild 3124 SHA256 7605f5d6f19bf50ef51ba29412ac7d2be64bf7412678312f835557ae52ed6bab SHA512 3891728ab252676b298b4f5dd5791856b688f61baaf1f86be387195177331f5a296dad965e248595c1ccf150d15c74e3e8ac30ae74e205a1f45f2a32753ee09f WHIRLPOOL b2002be1e997cdfb3f264385795d5a03a0964cdb28293b7e5de511c97cd9bf6cae7d9b80edced641b99972323adb2b1bfd2fc8eeb4148c5e5bfbf83990f73284
+EBUILD gnupg-2.2.1.ebuild 3224 SHA256 8087d59a0748422d7888180f3e7b4692285cebb9ce7a8ac802bf563558ef9e9d SHA512 ebe3107c7444f4f821760d854da5376a9953b7e6781673cc55b3704ce9accf5306277140648a047f9fe705c7e5ef7922e45c0fceb8508d80edd63b6dab08b579 WHIRLPOOL 1c9745178e0276a11bf73d31705318c40e6a0c2c9191cee90df14fc0e02856f0eb534ef036b6ee3815dc4eb574f31e12cb5b433424b9362e4d1513c7dde55699
+MISC ChangeLog 17653 SHA256 0f85d5aa5e23837a910ad2d14a05a1a3cd8a3bc9f59d4e0fcbc1b6cf30d8f166 SHA512 8e8d0cac1c1c9662d9754e1ee04399bffbd41eaec93d361bb01ac753d9907c60d56f184eb5e265f4817afe681f090b4d796274a2bb33988764e036fdb71dd2f1 WHIRLPOOL 960f2283993b2d007df253abd5a5b0eb0d1441df64262825785793cfd756f6d314c3186948fddfc946ed801e64834ac4909ab9654ceb8e2c45d9df3543ea6812
+MISC ChangeLog-2015 89046 SHA256 295a825284cc7d9b7148c77733782937402db7e07fd7fbf0a9f44861d2018ce7 SHA512 9920db843f9cc1863f3529ac2022f591de8f0b930f82b64ca2859d542af679de3dcc733e5b55b8de060df9bf01ce68cd1828d0c179b1f9f05093cd6566efddc6 WHIRLPOOL d21dbe313d4c1b0e50012e0cc05560d13b712875514dbbea2f56be40ce85c99db8a7693a0f4492dd631119d37cbc796546fe5b62f5d6a6baf598d0a94c0ac0a3
+MISC metadata.xml 1198 SHA256 6077905daacd534deb51d99622a7c18e7db3de5cb2f12d7eb0aef5cbf7557afe SHA512 cd4ad4996e1c641bf8b6815a72f90427fa3c20864fe440157068ebb38300228e907ccf34fca2fd9ba821eeadee741c0cf8d8b09ce60c965f340e64c4fae3c069 WHIRLPOOL 2283e4db26f6a39ccac72c73f7efd9b7013c6b55a92937d8fb464178d8b0c7afafa749900d4a58fa4f339887bafa0118e9996b15a9e1fdd1e68d228828be6895
diff --git a/app-crypt/gnupg/files/gnupg-2.1.20-gpg-Fix-typo.patch b/app-crypt/gnupg/files/gnupg-2.1.20-gpg-Fix-typo.patch
new file mode 100644
index 000000000000..292fc264ac84
--- /dev/null
+++ b/app-crypt/gnupg/files/gnupg-2.1.20-gpg-Fix-typo.patch
@@ -0,0 +1,27 @@
+From 692208fd6c1547cc7dd2062a1d1c9499bc0a8be4 Mon Sep 17 00:00:00 2001
+From: Justus Winter <justus@g10code.com>
+Date: Mon, 8 May 2017 13:52:39 +0200
+Subject: [PATCH] gpg: Fix typo.
+
+--
+Signed-off-by: Justus Winter <justus@g10code.com>
+---
+ g10/packet.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/g10/packet.h b/g10/packet.h
+index a10495c..d42510d 100644
+--- a/g10/packet.h
++++ b/g10/packet.h
+@@ -623,7 +623,7 @@ struct parse_packet_ctx_s
+ iobuf_t inp; /* The input stream with the packets. */
+ struct packet_struct last_pkt; /* The last parsed packet. */
+ int free_last_pkt; /* Indicates that LAST_PKT must be freed. */
+- int skip_meta; /* Skip right trust packets. */
++ int skip_meta; /* Skip ring trust packets. */
+ };
+ typedef struct parse_packet_ctx_s *parse_packet_ctx_t;
+
+--
+2.10.2
+
diff --git a/app-crypt/gnupg/files/gnupg-2.1.20-gpg-Properly-account-for-ring-trust-packets.patch b/app-crypt/gnupg/files/gnupg-2.1.20-gpg-Properly-account-for-ring-trust-packets.patch
new file mode 100644
index 000000000000..58568db47d2a
--- /dev/null
+++ b/app-crypt/gnupg/files/gnupg-2.1.20-gpg-Properly-account-for-ring-trust-packets.patch
@@ -0,0 +1,86 @@
+From 22739433e98be80e46fe7d01d52a9627c1aebaae Mon Sep 17 00:00:00 2001
+From: Justus Winter <justus@g10code.com>
+Date: Mon, 8 May 2017 14:24:00 +0200
+Subject: [PATCH] gpg: Properly account for ring trust packets.
+
+* g10/keyring.c (keyring_get_keyblock): Use the parser's packet count
+instead of counting ourself.
+* g10/packet.h (struct parse_packet_ctx_s): New field
+'n_parsed_packets'.
+(init_parse_packet): Initialize new field.
+* g10/parse-packet.c (parse): Count packets.
+--
+
+The 'keyring' keystore depends on the number of packets for delete and
+update operations. With the rework of the ring trust packets, the
+trust packets were no longer properly accounted for leading to keyring
+corruptions.
+
+The 'keybox' store was not affected.
+
+GnuPG-bug-id: 3123
+GnuPG-bug-id: 3135
+GnuPG-bug-id: 3144
+Fixes-commit: a8895c99a7d0750132477d80cd66caaf3a709113
+Signed-off-by: Justus Winter <justus@g10code.com>
+---
+ g10/keyring.c | 4 ++--
+ g10/packet.h | 2 ++
+ g10/parse-packet.c | 3 +++
+ 3 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/g10/keyring.c b/g10/keyring.c
+index e223f0f..50f1b82 100644
+--- a/g10/keyring.c
++++ b/g10/keyring.c
+@@ -409,11 +409,11 @@ keyring_get_keyblock (KEYRING_HANDLE hd, KBNODE *ret_kb)
+ pkt = xmalloc (sizeof *pkt);
+ init_packet (pkt);
+ init_parse_packet (&parsectx, a);
+- hd->found.n_packets = 0;;
++ hd->found.n_packets = 0;
+ lastnode = NULL;
+ save_mode = set_packet_list_mode(0);
+ while ((rc=parse_packet (&parsectx, pkt)) != -1) {
+- hd->found.n_packets++;
++ hd->found.n_packets = parsectx.n_parsed_packets;
+ if (gpg_err_code (rc) == GPG_ERR_UNKNOWN_PACKET) {
+ free_packet (pkt, &parsectx);
+ init_packet (pkt);
+diff --git a/g10/packet.h b/g10/packet.h
+index d42510d..cf2121c 100644
+--- a/g10/packet.h
++++ b/g10/packet.h
+@@ -624,6 +624,7 @@ struct parse_packet_ctx_s
+ struct packet_struct last_pkt; /* The last parsed packet. */
+ int free_last_pkt; /* Indicates that LAST_PKT must be freed. */
+ int skip_meta; /* Skip ring trust packets. */
++ unsigned int n_parsed_packets; /* Number of parsed packets. */
+ };
+ typedef struct parse_packet_ctx_s *parse_packet_ctx_t;
+
+@@ -633,6 +634,7 @@ typedef struct parse_packet_ctx_s *parse_packet_ctx_t;
+ (a)->last_pkt.pkt.generic= NULL;\
+ (a)->free_last_pkt = 0; \
+ (a)->skip_meta = 0; \
++ (a)->n_parsed_packets = 0; \
+ } while (0)
+
+ #define deinit_parse_packet(a) do { \
+diff --git a/g10/parse-packet.c b/g10/parse-packet.c
+index fa44f83..dbb7af8 100644
+--- a/g10/parse-packet.c
++++ b/g10/parse-packet.c
+@@ -764,6 +764,9 @@ parse (parse_packet_ctx_t ctx, PACKET *pkt, int onlykeypkts, off_t * retpos,
+ partial? (new_ctb ? " partial" : " indeterminate") :"",
+ new_ctb? " new-ctb":"");
+
++ /* Count it. */
++ ctx->n_parsed_packets++;
++
+ pkt->pkttype = pkttype;
+ rc = GPG_ERR_UNKNOWN_PACKET; /* default error */
+ switch (pkttype)
+--
+2.10.2
+
diff --git a/app-crypt/gnupg/files/gnupg-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch b/app-crypt/gnupg/files/gnupg-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch
new file mode 100644
index 000000000000..dd75e3a5e96c
--- /dev/null
+++ b/app-crypt/gnupg/files/gnupg-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch
@@ -0,0 +1,33 @@
+From e3bdb7d17264b8d5bd9abab97c96d9c4a50e4f61 Mon Sep 17 00:00:00 2001
+From: Kristian Fiskerstrand <kf@sumptuouscapital.com>
+Date: Mon, 3 Apr 2017 23:44:56 +0300
+Subject: [PATCH] gpgscm: Use shorter socket path lengts to improve test
+ reliability
+
+--
+As socket lengths are normally restricted to 108 characters
+(UNIX_PATH_MAX variable in /usr/include/linux/un.h), using 42 characters
+by default easily results in errors.
+---
+ tests/gpgscm/tests.scm | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/gpgscm/tests.scm b/tests/gpgscm/tests.scm
+index 592b36f..f54a387 100644
+--- a/tests/gpgscm/tests.scm
++++ b/tests/gpgscm/tests.scm
+@@ -273,9 +273,9 @@
+ (canonical-path (_mkdtemp (if (null? components)
+ (path-join
+ (get-temp-path)
+- (string-append "gpgscm-" (get-isotime) "-"
++ (string-append "gscm"
+ (basename-suffix *scriptname* ".scm")
+- "-XXXXXX"))
++ "XXXXXX"))
+ (apply path-join components)))))
+
+ ;; Make a temporary directory and remove it at interpreter shutdown.
+--
+2.10.2
+
diff --git a/app-crypt/gnupg/files/gnupg-2.2.1-fix-gnupg-wait.patch b/app-crypt/gnupg/files/gnupg-2.2.1-fix-gnupg-wait.patch
new file mode 100644
index 000000000000..6a2c18e9b63f
--- /dev/null
+++ b/app-crypt/gnupg/files/gnupg-2.2.1-fix-gnupg-wait.patch
@@ -0,0 +1,85 @@
+From eeb3da6eb717ed6a1a1069a7611eb37503e8672d Mon Sep 17 00:00:00 2001
+From: NIIBE Yutaka <gniibe@fsij.org>
+Date: Tue, 19 Sep 2017 12:28:43 +0900
+Subject: [PATCH 2/3] common: Fix gnupg_wait_processes.
+
+* common/exechelp-posix.c (gnupg_wait_processes): Loop for r_exitcodes
+even if we already see an error.
+
+--
+
+The value stored by waitpid for exit code is encoded; It requires
+decoded by WEXITSTATUS macro, regardless of an error.
+
+For example, when one of processes is already exited and another is
+still running, it resulted wrong value of in r_exitcodes[n].
+
+Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
+---
+ common/exechelp-posix.c | 50 +++++++++++++++++++++++++------------------------
+ 1 file changed, 26 insertions(+), 24 deletions(-)
+
+diff --git a/common/exechelp-posix.c b/common/exechelp-posix.c
+index 7237993a2..3acf74ad6 100644
+--- a/common/exechelp-posix.c
++++ b/common/exechelp-posix.c
+@@ -784,30 +784,32 @@ gnupg_wait_processes (const char **pgmnames, pid_t *pids, size_t count,
+ }
+ }
+
+- if (ec == 0)
+- for (i = 0; i < count; i++)
+- {
+- if (WIFEXITED (r_exitcodes[i]) && WEXITSTATUS (r_exitcodes[i]) == 127)
+- {
+- log_error (_("error running '%s': probably not installed\n"),
+- pgmnames[i]);
+- ec = GPG_ERR_CONFIGURATION;
+- }
+- else if (WIFEXITED (r_exitcodes[i]) && WEXITSTATUS (r_exitcodes[i]))
+- {
+- if (dummy)
+- log_error (_("error running '%s': exit status %d\n"),
+- pgmnames[i], WEXITSTATUS (r_exitcodes[i]));
+- else
+- r_exitcodes[i] = WEXITSTATUS (r_exitcodes[i]);
+- ec = GPG_ERR_GENERAL;
+- }
+- else if (!WIFEXITED (r_exitcodes[i]))
+- {
+- log_error (_("error running '%s': terminated\n"), pgmnames[i]);
+- ec = GPG_ERR_GENERAL;
+- }
+- }
++ for (i = 0; i < count; i++)
++ {
++ if (r_exitcodes[i] == -1)
++ continue;
++
++ if (WIFEXITED (r_exitcodes[i]) && WEXITSTATUS (r_exitcodes[i]) == 127)
++ {
++ log_error (_("error running '%s': probably not installed\n"),
++ pgmnames[i]);
++ ec = GPG_ERR_CONFIGURATION;
++ }
++ else if (WIFEXITED (r_exitcodes[i]) && WEXITSTATUS (r_exitcodes[i]))
++ {
++ if (dummy)
++ log_error (_("error running '%s': exit status %d\n"),
++ pgmnames[i], WEXITSTATUS (r_exitcodes[i]));
++ else
++ r_exitcodes[i] = WEXITSTATUS (r_exitcodes[i]);
++ ec = GPG_ERR_GENERAL;
++ }
++ else if (!WIFEXITED (r_exitcodes[i]))
++ {
++ log_error (_("error running '%s': terminated\n"), pgmnames[i]);
++ ec = GPG_ERR_GENERAL;
++ }
++ }
+
+ xfree (dummy);
+ return gpg_err_make (GPG_ERR_SOURCE_DEFAULT, ec);
+--
+2.13.5
+
diff --git a/app-crypt/gnupg/gnupg-1.4.21.ebuild b/app-crypt/gnupg/gnupg-1.4.21.ebuild
new file mode 100644
index 000000000000..d8cb5bc50c6c
--- /dev/null
+++ b/app-crypt/gnupg/gnupg-1.4.21.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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 ~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:0= )
+ 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 https://wiki.gentoo.org/wiki/GnuPG 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.1.15.ebuild b/app-crypt/gnupg/gnupg-2.1.15.ebuild
new file mode 100644
index 000000000000..2e4b59ef30a0
--- /dev/null
+++ b/app-crypt/gnupg/gnupg-2.1.15.ebuild
@@ -0,0 +1,157 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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 arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="bzip2 doc +gnutls ldap nls readline selinux smartcard tofu tools usb"
+
+COMMON_DEPEND_LIBS="
+ >=dev-libs/npth-1.2
+ >=dev-libs/libassuan-2.4.3
+ >=dev-libs/libgcrypt-1.7.3
+ >=dev-libs/libgpg-error-1.24
+ >=dev-libs/libksba-1.3.4
+ >=net-misc/curl-7.10
+ gnutls? ( >=net-libs/gnutls-3.0:0= )
+ sys-libs/zlib
+ ldap? ( net-nds/openldap )
+ bzip2? ( app-arch/bzip2 )
+ readline? ( sys-libs/readline:0= )
+ smartcard? ( usb? ( virtual/libusb:0 ) )
+ tofu? ( >=dev-db/sqlite-3.7 )
+ "
+COMMON_DEPEND_BINS="app-crypt/pinentry
+ !app-crypt/dirmngr"
+
+# Existence of executables is checked during configuration.
+DEPEND="${COMMON_DEPEND_LIBS}
+ ${COMMON_DEPEND_BINS}
+ nls? ( sys-devel/gettext )
+ doc? ( sys-apps/texinfo )"
+
+RDEPEND="${COMMON_DEPEND_LIBS}
+ ${COMMON_DEPEND_BINS}
+ selinux? ( sec-policy/selinux-gpg )
+ nls? ( virtual/libintl )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch_user
+}
+
+src_configure() {
+ local myconf=()
+
+ 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) \
+ $(use_enable tofu) \
+ $(use_enable tools wks-tools) \
+ 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
+ # The help*txt files are read from the datadir by GnuPG directly.
+ # They do not work if compressed or moved!
+ #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/gnupg-2.1.20-r1.ebuild b/app-crypt/gnupg/gnupg-2.1.20-r1.ebuild
new file mode 100644
index 000000000000..5ce9f46cd62e
--- /dev/null
+++ b/app-crypt/gnupg/gnupg-2.1.20-r1.ebuild
@@ -0,0 +1,122 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit toolchain-funcs
+
+DESCRIPTION="The GNU Privacy Guard, a GPL OpenPGP implementation"
+HOMEPAGE="http://www.gnupg.org/"
+LICENSE="GPL-3"
+
+MY_P="${P/_/-}"
+SRC_URI="mirror://gnupg/gnupg/${MY_P}.tar.bz2"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+
+SLOT="0"
+IUSE="bzip2 doc +gnutls ldap nls readline selinux +smartcard tofu tools usb wks-server"
+
+COMMON_DEPEND_LIBS="
+ >=dev-libs/npth-1.2
+ >=dev-libs/libassuan-2.4.3
+ >=dev-libs/libgcrypt-1.7.3
+ >=dev-libs/libgpg-error-1.24
+ >=dev-libs/libksba-1.3.4
+ >=net-misc/curl-7.10
+ gnutls? ( >=net-libs/gnutls-3.0:0= )
+ sys-libs/zlib
+ ldap? ( net-nds/openldap )
+ bzip2? ( app-arch/bzip2 )
+ readline? ( sys-libs/readline:0= )
+ smartcard? ( usb? ( virtual/libusb:0 ) )
+ tofu? ( >=dev-db/sqlite-3.7 )
+ "
+COMMON_DEPEND_BINS="app-crypt/pinentry
+ !app-crypt/dirmngr"
+
+# Existence of executables is checked during configuration.
+DEPEND="${COMMON_DEPEND_LIBS}
+ ${COMMON_DEPEND_BINS}
+ nls? ( sys-devel/gettext )
+ doc? ( sys-apps/texinfo )"
+
+RDEPEND="${COMMON_DEPEND_LIBS}
+ ${COMMON_DEPEND_BINS}
+ selinux? ( sec-policy/selinux-gpg )
+ nls? ( virtual/libintl )"
+
+S="${WORKDIR}/${MY_P}"
+
+DOCS=(
+ ChangeLog NEWS README THANKS TODO VERSION
+ doc/FAQ doc/DETAILS doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER
+)
+
+PATCHES=(
+ "${FILESDIR}/${P}-gpg-Fix-typo.patch"
+ "${FILESDIR}/${P}-gpg-Properly-account-for-ring-trust-packets.patch"
+ "${FILESDIR}/${P}-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch"
+)
+
+src_configure() {
+ local myconf=()
+
+ 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 \
+ "${myconf[@]}" \
+ $(use_enable bzip2) \
+ $(use_enable gnutls) \
+ $(use_enable nls) \
+ $(use_enable tofu) \
+ $(use_enable wks-server wks-tools) \
+ $(use_with ldap) \
+ $(use_with readline) \
+ --enable-gpg \
+ --enable-gpgsm \
+ --enable-large-secmem \
+ CC_FOR_BUILD="$(tc-getBUILD_CC)"
+}
+
+src_compile() {
+ default
+
+ use doc && emake -C doc html
+}
+
+src_install() {
+ default
+
+ use tools &&
+ dobin \
+ tools/{convert-from-106,gpg-check-pattern} \
+ tools/{gpg-zip,gpgconf,gpgsplit,lspgpot,mail-signed-keys} \
+ tools/make-dns-cert
+
+ 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
+
+ use doc && dodoc doc/gnupg.html/* doc/*.png
+}
diff --git a/app-crypt/gnupg/gnupg-2.2.0.ebuild b/app-crypt/gnupg/gnupg-2.2.0.ebuild
new file mode 100644
index 000000000000..ba5fbde5fcc9
--- /dev/null
+++ b/app-crypt/gnupg/gnupg-2.2.0.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit systemd toolchain-funcs
+
+MY_P="${P/_/-}"
+
+DESCRIPTION="The GNU Privacy Guard, a GPL OpenPGP implementation"
+HOMEPAGE="http://www.gnupg.org/"
+SRC_URI="mirror://gnupg/gnupg/${MY_P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="bzip2 doc +gnutls ldap nls readline selinux +smartcard tofu tools usb wks-server"
+
+COMMON_DEPEND_LIBS="
+ >=dev-libs/npth-1.2
+ >=dev-libs/libassuan-2.4.3
+ >=dev-libs/libgcrypt-1.7.3
+ >=dev-libs/libgpg-error-1.24
+ >=dev-libs/libksba-1.3.4
+ >=net-misc/curl-7.10
+ gnutls? ( >=net-libs/gnutls-3.0:0= )
+ sys-libs/zlib
+ ldap? ( net-nds/openldap )
+ bzip2? ( app-arch/bzip2 )
+ readline? ( sys-libs/readline:0= )
+ smartcard? ( usb? ( virtual/libusb:0 ) )
+ tofu? ( >=dev-db/sqlite-3.7 )
+ "
+COMMON_DEPEND_BINS="app-crypt/pinentry
+ !app-crypt/dirmngr"
+
+# Existence of executables is checked during configuration.
+DEPEND="${COMMON_DEPEND_LIBS}
+ ${COMMON_DEPEND_BINS}
+ nls? ( sys-devel/gettext )
+ doc? ( sys-apps/texinfo )"
+
+RDEPEND="${COMMON_DEPEND_LIBS}
+ ${COMMON_DEPEND_BINS}
+ selinux? ( sec-policy/selinux-gpg )
+ nls? ( virtual/libintl )"
+
+S="${WORKDIR}/${MY_P}"
+
+DOCS=(
+ ChangeLog NEWS README THANKS TODO VERSION
+ doc/FAQ doc/DETAILS doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER
+)
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch"
+)
+
+src_configure() {
+ local myconf=()
+
+ 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 \
+ "${myconf[@]}" \
+ $(use_enable bzip2) \
+ $(use_enable gnutls) \
+ $(use_enable nls) \
+ $(use_enable tofu) \
+ $(use_enable wks-server wks-tools) \
+ $(use_with ldap) \
+ $(use_with readline) \
+ --enable-gpg \
+ --enable-gpgsm \
+ --enable-large-secmem \
+ --enable-all-tests \
+ CC_FOR_BUILD="$(tc-getBUILD_CC)"
+}
+
+src_compile() {
+ default
+
+ use doc && emake -C doc html
+}
+
+src_install() {
+ default
+
+ use tools &&
+ dobin \
+ tools/{convert-from-106,gpg-check-pattern} \
+ tools/{gpg-zip,gpgconf,gpgsplit,lspgpot,mail-signed-keys} \
+ tools/make-dns-cert
+
+ dosym gpg /usr/bin/gpg2
+ dosym gpgv /usr/bin/gpgv2
+ echo ".so man1/gpg.1" > "${ED}"/usr/share/man/man1/gpg2.1 || die
+ echo ".so man1/gpgv.1" > "${ED}"/usr/share/man/man1/gpgv2.1 || die
+
+ dodir /etc/env.d
+ echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg || die
+
+ use doc && dodoc doc/gnupg.html/* doc/*.png
+
+ systemd_douserunit doc/examples/systemd-user/*.{service,socket}
+}
diff --git a/app-crypt/gnupg/gnupg-2.2.1.ebuild b/app-crypt/gnupg/gnupg-2.2.1.ebuild
new file mode 100644
index 000000000000..0cdc74c459b4
--- /dev/null
+++ b/app-crypt/gnupg/gnupg-2.2.1.ebuild
@@ -0,0 +1,129 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit systemd toolchain-funcs
+
+MY_P="${P/_/-}"
+
+DESCRIPTION="The GNU Privacy Guard, a GPL OpenPGP implementation"
+HOMEPAGE="http://www.gnupg.org/"
+SRC_URI="mirror://gnupg/gnupg/${MY_P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="bzip2 doc +gnutls ldap nls readline selinux +smartcard tofu tools usb wks-server"
+
+COMMON_DEPEND_LIBS="
+ >=dev-libs/npth-1.2
+ >=dev-libs/libassuan-2.4.3
+ >=dev-libs/libgcrypt-1.7.3
+ >=dev-libs/libgpg-error-1.24
+ >=dev-libs/libksba-1.3.4
+ >=net-misc/curl-7.10
+ gnutls? ( >=net-libs/gnutls-3.0:0= )
+ sys-libs/zlib
+ ldap? ( net-nds/openldap )
+ bzip2? ( app-arch/bzip2 )
+ readline? ( sys-libs/readline:0= )
+ smartcard? ( usb? ( virtual/libusb:0 ) )
+ tofu? ( >=dev-db/sqlite-3.7 )
+ "
+COMMON_DEPEND_BINS="app-crypt/pinentry
+ !app-crypt/dirmngr"
+
+# Existence of executables is checked during configuration.
+DEPEND="${COMMON_DEPEND_LIBS}
+ ${COMMON_DEPEND_BINS}
+ nls? ( sys-devel/gettext )
+ doc? ( sys-apps/texinfo )"
+
+RDEPEND="${COMMON_DEPEND_LIBS}
+ ${COMMON_DEPEND_BINS}
+ selinux? ( sec-policy/selinux-gpg )
+ nls? ( virtual/libintl )"
+
+S="${WORKDIR}/${MY_P}"
+
+DOCS=(
+ ChangeLog NEWS README THANKS TODO VERSION
+ doc/FAQ doc/DETAILS doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER
+)
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch"
+ "${FILESDIR}/${P}-fix-gnupg-wait.patch"
+)
+
+src_configure() {
+ local myconf=()
+
+ 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 \
+ "${myconf[@]}" \
+ $(use_enable bzip2) \
+ $(use_enable gnutls) \
+ $(use_enable nls) \
+ $(use_enable tofu) \
+ $(use_enable wks-server wks-tools) \
+ $(use_with ldap) \
+ $(use_with readline) \
+ --enable-gpg \
+ --enable-gpgsm \
+ --enable-large-secmem \
+ --enable-all-tests \
+ CC_FOR_BUILD="$(tc-getBUILD_CC)"
+}
+
+src_compile() {
+ default
+
+ use doc && emake -C doc html
+}
+
+src_test() {
+ export TESTFLAGS=--parallel
+ default
+}
+
+src_install() {
+ default
+
+ use tools &&
+ dobin \
+ tools/{convert-from-106,gpg-check-pattern} \
+ tools/{gpg-zip,gpgconf,gpgsplit,lspgpot,mail-signed-keys} \
+ tools/make-dns-cert
+
+ dosym gpg /usr/bin/gpg2
+ dosym gpgv /usr/bin/gpgv2
+ echo ".so man1/gpg.1" > "${ED}"/usr/share/man/man1/gpg2.1 || die
+ echo ".so man1/gpgv.1" > "${ED}"/usr/share/man/man1/gpgv2.1 || die
+
+ dodir /etc/env.d
+ echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg || die
+
+ use doc && dodoc doc/gnupg.html/* doc/*.png
+
+ systemd_douserunit doc/examples/systemd-user/*.{service,socket}
+}
diff --git a/app-crypt/gnupg/metadata.xml b/app-crypt/gnupg/metadata.xml
new file mode 100644
index 000000000000..d9ae4079527c
--- /dev/null
+++ b/app-crypt/gnupg/metadata.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>k_f@gentoo.org</email>
+ <name>Kristian Fiskerstrand</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>crypto@gentoo.org</email>
+ <name>Crypto</name>
+ </maintainer>
+ <longdescription>
+ GnuPG is a complete and free implementation of the OpenPGP standard as
+ defined by RFC4880.
+ </longdescription>
+ <use>
+ <flag name="smartcard">
+ Build scdaemon software. Enables usage of OpenPGP cards. For
+ other type of smartcards, try <pkg>app-crypt/gnupg-pkcs11-scd</pkg>.
+ Bring in <pkg>dev-libs/libusb</pkg> as a dependency; enable scdaemon.
+ </flag>
+ <flag name="usb">
+ 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="tofu">
+ Enable support for Trust on First use trust model; requires <pkg>dev-db/sqlite</pkg>.
+ </flag>
+ <flag name="tools">
+ Install extra tools (including gpgsplit and gpg-zip).
+ </flag>
+ <flag name="wks-server">
+ Install the wks-server
+ </flag>
+ </use>
+</pkgmetadata>