Gentoo Archives: gentoo-commits

From: Craig Andrews <candrews@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/libesmtp/files/, net-libs/libesmtp/
Date: Fri, 26 Oct 2018 18:09:10
Message-Id: 1540577335.fa230af7c9832b53e08d34799acbc5877a912fc5.candrews@gentoo
1 commit: fa230af7c9832b53e08d34799acbc5877a912fc5
2 Author: Craig Andrews <candrews <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 26 16:50:33 2018 +0000
4 Commit: Craig Andrews <candrews <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 26 18:08:55 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa230af7
7
8 net-libs/libesmtp: Fix OpenSSL 1.1, EAPI=7 bump
9
10 Closes: https://bugs.gentoo.org/624412
11 Signed-off-by: Craig Andrews <candrews <AT> gentoo.org>
12 Package-Manager: Portage-2.3.51, Repoman-2.3.11
13
14 ...esmtp-1.0.6-openssl-1.1-api-compatibility.patch | 72 ++++++++++++++++++++++
15 net-libs/libesmtp/libesmtp-1.0.6-r3.ebuild | 47 ++++++++++++++
16 2 files changed, 119 insertions(+)
17
18 diff --git a/net-libs/libesmtp/files/libesmtp-1.0.6-openssl-1.1-api-compatibility.patch b/net-libs/libesmtp/files/libesmtp-1.0.6-openssl-1.1-api-compatibility.patch
19 new file mode 100644
20 index 00000000000..bc3e3f35684
21 --- /dev/null
22 +++ b/net-libs/libesmtp/files/libesmtp-1.0.6-openssl-1.1-api-compatibility.patch
23 @@ -0,0 +1,72 @@
24 +diff --git a/configure.ac b/configure.ac
25 +index 556f220..2c0693d 100644
26 +--- a/configure.ac
27 ++++ b/configure.ac
28 +@@ -303,7 +303,7 @@ if test x$with_openssl != xno ; then
29 + )
30 + fi
31 + if test x$with_openssl != xno ; then
32 +- AC_CHECK_LIB(ssl, SSL_library_init, [
33 ++ AC_CHECK_LIB(ssl, SSL_new, [
34 + with_openssl=yes
35 + LIBS="-lssl -lcrypto $LIBS"
36 + ], [
37 +diff --git a/smtp-tls.c b/smtp-tls.c
38 +index 9a66806..cfc6589 100644
39 +--- a/smtp-tls.c
40 ++++ b/smtp-tls.c
41 +@@ -57,6 +57,7 @@ static void *ctx_password_cb_arg;
42 + #ifdef USE_PTHREADS
43 + #include <pthread.h>
44 + static pthread_mutex_t starttls_mutex = PTHREAD_MUTEX_INITIALIZER;
45 ++#if OPENSSL_VERSION_NUMBER < 0x10100000
46 + static pthread_mutex_t *openssl_mutex;
47 +
48 + static void
49 +@@ -70,6 +71,7 @@ openssl_mutexcb (int mode, int n,
50 + pthread_mutex_unlock (&openssl_mutex[n]);
51 + }
52 + #endif
53 ++#endif
54 +
55 + static int
56 + starttls_init (void)
57 +@@ -77,6 +79,10 @@ starttls_init (void)
58 + if (tls_init)
59 + return 1;
60 +
61 ++#if OPENSSL_VERSION_NUMBER < 0x10100000
62 ++ /* starting from OpenSSL 1.1.0, OpenSSL uses a new threading API and does its own locking */
63 ++ /* also initialization has been reworked and is done automatically */
64 ++ /* so there's not much to do here any more */
65 + #ifdef USE_PTHREADS
66 + /* Set up mutexes for the OpenSSL library */
67 + if (openssl_mutex == NULL)
68 +@@ -94,9 +100,10 @@ starttls_init (void)
69 + CRYPTO_set_locking_callback (openssl_mutexcb);
70 + }
71 + #endif
72 +- tls_init = 1;
73 + SSL_load_error_strings ();
74 + SSL_library_init ();
75 ++#endif
76 ++ tls_init = 1;
77 + return 1;
78 + }
79 +
80 +@@ -201,7 +208,15 @@ starttls_create_ctx (smtp_session_t session)
81 + 3207. Servers typically support SSL as well as TLS because some
82 + versions of Netscape do not support TLS. I am assuming that all
83 + currently deployed servers correctly support TLS. */
84 ++#if OPENSSL_VERSION_NUMBER < 0x10100000
85 + ctx = SSL_CTX_new (TLSv1_client_method ());
86 ++#else
87 ++ ctx = SSL_CTX_new (TLS_client_method ());
88 ++ if (!SSL_CTX_set_min_proto_version(ctx, TLS1_VERSION)) {
89 ++ /* FIXME: set an error code AND free the allocated ctx */
90 ++ return NULL;
91 ++ }
92 ++#endif
93 +
94 + /* Load our keys and certificates. To avoid messing with configuration
95 + variables etc, use fixed paths for the certificate store. These are
96
97 diff --git a/net-libs/libesmtp/libesmtp-1.0.6-r3.ebuild b/net-libs/libesmtp/libesmtp-1.0.6-r3.ebuild
98 new file mode 100644
99 index 00000000000..c0d28b116e7
100 --- /dev/null
101 +++ b/net-libs/libesmtp/libesmtp-1.0.6-r3.ebuild
102 @@ -0,0 +1,47 @@
103 +# Copyright 1999-2018 Gentoo Authors
104 +# Distributed under the terms of the GNU General Public License v2
105 +
106 +EAPI=7
107 +inherit autotools
108 +
109 +DESCRIPTION="lib that implements the client side of the SMTP protocol"
110 +HOMEPAGE="http://brianstafford.info/libesmtp/"
111 +SRC_URI="http://brianstafford.info/${PN}/${P}.tar.bz2"
112 +
113 +LICENSE="LGPL-2.1 GPL-2"
114 +SLOT="0"
115 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-macos"
116 +IUSE="debug libressl ntlm ssl static-libs threads"
117 +
118 +RDEPEND="
119 + ssl? (
120 + !libressl? ( dev-libs/openssl:0= )
121 + libressl? ( dev-libs/libressl:= )
122 + )"
123 +DEPEND="${RDEPEND}"
124 +DOCS=( AUTHORS ChangeLog NEWS Notes README TODO )
125 +PATCHES=(
126 + "${FILESDIR}/${P}-openssl-1.1-api-compatibility.patch"
127 +)
128 +
129 +src_prepare() {
130 + default
131 + eautoreconf
132 +}
133 +
134 +src_configure() {
135 + econf \
136 + --disable-dependency-tracking \
137 + $(use_enable static-libs static) \
138 + --enable-all \
139 + $(use_enable ntlm) \
140 + $(use_enable threads pthreads) \
141 + $(use_enable debug) \
142 + $(use_with ssl openssl)
143 +}
144 +
145 +src_install() {
146 + default
147 + insinto /usr/share/doc/${PF}/xml
148 + doins doc/api.xml
149 +}