1 |
commit: b580348546711590c0152a8371e3cf00393b4720 |
2 |
Author: Kristian Fiskerstrand <k_f <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 7 20:42:38 2018 +0000 |
4 |
Commit: Kristian Fiskerstrand <k_f <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 7 20:42:38 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b5803485 |
7 |
|
8 |
app-crypt/gnupg: Add fix for missing IPv6 stack |
9 |
|
10 |
Bug: https://bugs.gentoo.org/646194 |
11 |
Package-Manager: Portage-2.3.19, Repoman-2.3.6 |
12 |
|
13 |
...r-Handle-failures-related-to-missing-IPv6.patch | 31 +++++ |
14 |
app-crypt/gnupg/gnupg-2.2.4-r2.ebuild | 130 +++++++++++++++++++++ |
15 |
2 files changed, 161 insertions(+) |
16 |
|
17 |
diff --git a/app-crypt/gnupg/files/gnupg-2.2.4-dirmngr-Handle-failures-related-to-missing-IPv6.patch b/app-crypt/gnupg/files/gnupg-2.2.4-dirmngr-Handle-failures-related-to-missing-IPv6.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..53843900b9f |
20 |
--- /dev/null |
21 |
+++ b/app-crypt/gnupg/files/gnupg-2.2.4-dirmngr-Handle-failures-related-to-missing-IPv6.patch |
22 |
@@ -0,0 +1,31 @@ |
23 |
+From b7f48a0095a5b010b94f8192f4adc1adf8697567 Mon Sep 17 00:00:00 2001 |
24 |
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o> |
25 |
+Date: Wed, 31 Jan 2018 16:57:19 +0100 |
26 |
+Subject: [PATCH] dirmngr: Handle failures related to missing IPv6 gracefully |
27 |
+ |
28 |
+Handle the two possible connect failures related to missing IPv6 support |
29 |
+gracefully by marking the host dead and retrying with another one. |
30 |
+If IPv6 is disabled via procfs, connect() will return EADDRNOTAVAIL. |
31 |
+If IPv6 is not compiled into the kernel, it will return EAFNOSUPPORT. |
32 |
+This makes it possible to use dual-stack hkp servers on hosts not having |
33 |
+IPv6 without random connection failures. |
34 |
+--- |
35 |
+ dirmngr/ks-engine-hkp.c | 2 ++ |
36 |
+ 1 file changed, 2 insertions(+) |
37 |
+ |
38 |
+diff --git a/dirmngr/ks-engine-hkp.c b/dirmngr/ks-engine-hkp.c |
39 |
+index 4a0b08f4f..a9bb93666 100644 |
40 |
+--- a/dirmngr/ks-engine-hkp.c |
41 |
++++ b/dirmngr/ks-engine-hkp.c |
42 |
+@@ -1353,6 +1353,8 @@ handle_send_request_error (ctrl_t ctrl, gpg_error_t err, const char *request, |
43 |
+ case GPG_ERR_UNKNOWN_HOST: |
44 |
+ case GPG_ERR_NETWORK: |
45 |
+ case GPG_ERR_EIO: /* Sometimes used by estream cookie functions. */ |
46 |
++ case GPG_ERR_EADDRNOTAVAIL: /* e.g. when IPv6 is disabled */ |
47 |
++ case GPG_ERR_EAFNOSUPPORT: /* e.g. when IPv6 is not compiled in */ |
48 |
+ if (mark_host_dead (request) && *tries_left) |
49 |
+ retry = 1; |
50 |
+ break; |
51 |
+-- |
52 |
+2.16.1 |
53 |
+ |
54 |
|
55 |
diff --git a/app-crypt/gnupg/gnupg-2.2.4-r2.ebuild b/app-crypt/gnupg/gnupg-2.2.4-r2.ebuild |
56 |
new file mode 100644 |
57 |
index 00000000000..73881ec3b1b |
58 |
--- /dev/null |
59 |
+++ b/app-crypt/gnupg/gnupg-2.2.4-r2.ebuild |
60 |
@@ -0,0 +1,130 @@ |
61 |
+# Copyright 1999-2018 Gentoo Foundation |
62 |
+# Distributed under the terms of the GNU General Public License v2 |
63 |
+ |
64 |
+EAPI="6" |
65 |
+ |
66 |
+inherit systemd toolchain-funcs |
67 |
+ |
68 |
+MY_P="${P/_/-}" |
69 |
+ |
70 |
+DESCRIPTION="The GNU Privacy Guard, a GPL OpenPGP implementation" |
71 |
+HOMEPAGE="http://www.gnupg.org/" |
72 |
+SRC_URI="mirror://gnupg/gnupg/${MY_P}.tar.bz2" |
73 |
+ |
74 |
+LICENSE="GPL-3" |
75 |
+SLOT="0" |
76 |
+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" |
77 |
+IUSE="bzip2 doc ldap nls readline selinux +smartcard ssl tofu tools usb wks-server" |
78 |
+ |
79 |
+COMMON_DEPEND_LIBS=" |
80 |
+ >=dev-libs/npth-1.2 |
81 |
+ >=dev-libs/libassuan-2.5.0 |
82 |
+ >=dev-libs/libgcrypt-1.7.3 |
83 |
+ >=dev-libs/libgpg-error-1.24 |
84 |
+ >=dev-libs/libksba-1.3.4 |
85 |
+ >=net-misc/curl-7.10 |
86 |
+ ssl? ( >=net-libs/gnutls-3.0:0= ) |
87 |
+ sys-libs/zlib |
88 |
+ ldap? ( net-nds/openldap ) |
89 |
+ bzip2? ( app-arch/bzip2 ) |
90 |
+ readline? ( sys-libs/readline:0= ) |
91 |
+ smartcard? ( usb? ( virtual/libusb:0 ) ) |
92 |
+ tofu? ( >=dev-db/sqlite-3.7 ) |
93 |
+ " |
94 |
+COMMON_DEPEND_BINS="app-crypt/pinentry |
95 |
+ !app-crypt/dirmngr" |
96 |
+ |
97 |
+# Existence of executables is checked during configuration. |
98 |
+DEPEND="${COMMON_DEPEND_LIBS} |
99 |
+ ${COMMON_DEPEND_BINS} |
100 |
+ nls? ( sys-devel/gettext ) |
101 |
+ doc? ( sys-apps/texinfo )" |
102 |
+ |
103 |
+RDEPEND="${COMMON_DEPEND_LIBS} |
104 |
+ ${COMMON_DEPEND_BINS} |
105 |
+ selinux? ( sec-policy/selinux-gpg ) |
106 |
+ nls? ( virtual/libintl )" |
107 |
+ |
108 |
+S="${WORKDIR}/${MY_P}" |
109 |
+ |
110 |
+DOCS=( |
111 |
+ ChangeLog NEWS README THANKS TODO VERSION |
112 |
+ doc/FAQ doc/DETAILS doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER |
113 |
+) |
114 |
+ |
115 |
+PATCHES=( |
116 |
+ "${FILESDIR}/${PN}-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch" |
117 |
+ "${FILESDIR}/${P}-dirmngr-Handle-failures-related-to-missing-IPv6.patch" |
118 |
+) |
119 |
+ |
120 |
+src_configure() { |
121 |
+ local myconf=() |
122 |
+ |
123 |
+ if use smartcard; then |
124 |
+ myconf+=( |
125 |
+ --enable-scdaemon |
126 |
+ $(use_enable usb ccid-driver) |
127 |
+ ) |
128 |
+ else |
129 |
+ myconf+=( --disable-scdaemon ) |
130 |
+ fi |
131 |
+ |
132 |
+ if use elibc_SunOS || use elibc_AIX; then |
133 |
+ myconf+=( --disable-symcryptrun ) |
134 |
+ else |
135 |
+ myconf+=( --enable-symcryptrun ) |
136 |
+ fi |
137 |
+ |
138 |
+ # glib fails and picks up clang's internal stdint.h causing weird errors |
139 |
+ [[ ${CC} == *clang ]] && \ |
140 |
+ export gl_cv_absolute_stdint_h=/usr/include/stdint.h |
141 |
+ |
142 |
+ econf \ |
143 |
+ "${myconf[@]}" \ |
144 |
+ $(use_enable bzip2) \ |
145 |
+ $(use_enable ssl gnutls) \ |
146 |
+ $(use_enable nls) \ |
147 |
+ $(use_enable tofu) \ |
148 |
+ $(use_enable wks-server wks-tools) \ |
149 |
+ $(use_with ldap) \ |
150 |
+ $(use_with readline) \ |
151 |
+ --enable-gpg \ |
152 |
+ --enable-gpgsm \ |
153 |
+ --enable-large-secmem \ |
154 |
+ --enable-all-tests \ |
155 |
+ CC_FOR_BUILD="$(tc-getBUILD_CC)" |
156 |
+} |
157 |
+ |
158 |
+src_compile() { |
159 |
+ default |
160 |
+ |
161 |
+ use doc && emake -C doc html |
162 |
+} |
163 |
+ |
164 |
+src_test() { |
165 |
+ #Bug: 638574 |
166 |
+ use tofu && export TESTFLAGS=--parallel |
167 |
+ default |
168 |
+} |
169 |
+ |
170 |
+src_install() { |
171 |
+ default |
172 |
+ |
173 |
+ use tools && |
174 |
+ dobin \ |
175 |
+ tools/{convert-from-106,gpg-check-pattern} \ |
176 |
+ tools/{gpg-zip,gpgconf,gpgsplit,lspgpot,mail-signed-keys} \ |
177 |
+ tools/make-dns-cert |
178 |
+ |
179 |
+ dosym gpg /usr/bin/gpg2 |
180 |
+ dosym gpgv /usr/bin/gpgv2 |
181 |
+ echo ".so man1/gpg.1" > "${ED}"/usr/share/man/man1/gpg2.1 || die |
182 |
+ echo ".so man1/gpgv.1" > "${ED}"/usr/share/man/man1/gpgv2.1 || die |
183 |
+ |
184 |
+ dodir /etc/env.d |
185 |
+ echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg || die |
186 |
+ |
187 |
+ use doc && dodoc doc/gnupg.html/* doc/*.png |
188 |
+ |
189 |
+ systemd_douserunit doc/examples/systemd-user/*.{service,socket} |
190 |
+} |