diff options
3 files changed, 339 insertions, 0 deletions
diff --git a/recipes-extended/msmtp/files/msmtp-fixup-api-and-compiler-warning.patch b/recipes-extended/msmtp/files/msmtp-fixup-api-and-compiler-warning.patch new file mode 100644 index 0000000..14c95d7 --- /dev/null +++ b/recipes-extended/msmtp/files/msmtp-fixup-api-and-compiler-warning.patch | |||
@@ -0,0 +1,244 @@ | |||
1 | msmtp: fixup api and compiler warnings | ||
2 | |||
3 | Upstream-Status: Inappropriate [upstream rewrote with GPLv3] | ||
4 | |||
5 | Author: Morgan Little <morgan.little@windriver.com> | ||
6 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
7 | |||
8 | diff -Naur msmtp-1.4.12.orig/configure.ac msmtp-1.4.12/configure.ac | ||
9 | --- msmtp-1.4.12.orig/configure.ac | ||
10 | +++ msmtp-1.4.12/configure.ac | ||
11 | @@ -40,8 +40,8 @@ | ||
12 | dnl System | ||
13 | case "${target}" in *-*-mingw32*) windows=yes ;; *) windows=no ;; esac | ||
14 | |||
15 | -dnl gnulib | ||
16 | -gl_INIT | ||
17 | +#dnl gnulib | ||
18 | +#gl_INIT | ||
19 | |||
20 | dnl Gettext | ||
21 | AM_GNU_GETTEXT([external]) | ||
22 | diff -Naur msmtp-1.4.12.orig/gnulib/base64.c msmtp-1.4.12/gnulib/base64.c | ||
23 | --- msmtp-1.4.12.orig/gnulib/base64.c | ||
24 | +++ msmtp-1.4.12/gnulib/base64.c | ||
25 | @@ -64,8 +64,8 @@ | ||
26 | possible. If OUTLEN is larger than BASE64_LENGTH(INLEN), also zero | ||
27 | terminate the output buffer. */ | ||
28 | void | ||
29 | -base64_encode (const char *restrict in, size_t inlen, | ||
30 | - char *restrict out, size_t outlen) | ||
31 | +base64_encode (const char *in, size_t inlen, | ||
32 | + char *out, size_t outlen) | ||
33 | { | ||
34 | static const char b64str[64] = | ||
35 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | ||
36 | @@ -310,8 +310,8 @@ | ||
37 | that, when applicable, you must remove any line terminators that is | ||
38 | part of the data stream before calling this function. */ | ||
39 | bool | ||
40 | -base64_decode (const char *restrict in, size_t inlen, | ||
41 | - char *restrict out, size_t *outlen) | ||
42 | +base64_decode (const char *in, size_t inlen, | ||
43 | + char *out, size_t *outlen) | ||
44 | { | ||
45 | size_t outleft = *outlen; | ||
46 | |||
47 | diff -Naur msmtp-1.4.12.orig/gnulib/base64.h msmtp-1.4.12/gnulib/base64.h | ||
48 | --- msmtp-1.4.12.orig/gnulib/base64.h | ||
49 | +++ msmtp-1.4.12/gnulib/base64.h | ||
50 | @@ -31,13 +31,13 @@ | ||
51 | |||
52 | extern bool isbase64 (char ch); | ||
53 | |||
54 | -extern void base64_encode (const char *restrict in, size_t inlen, | ||
55 | - char *restrict out, size_t outlen); | ||
56 | +extern void base64_encode (const char *in, size_t inlen, | ||
57 | + char *out, size_t outlen); | ||
58 | |||
59 | extern size_t base64_encode_alloc (const char *in, size_t inlen, char **out); | ||
60 | |||
61 | -extern bool base64_decode (const char *restrict in, size_t inlen, | ||
62 | - char *restrict out, size_t *outlen); | ||
63 | +extern bool base64_decode (const char *in, size_t inlen, | ||
64 | + char *out, size_t *outlen); | ||
65 | |||
66 | extern bool base64_decode_alloc (const char *in, size_t inlen, | ||
67 | char **out, size_t *outlen); | ||
68 | diff -Naur msmtp-1.4.12.orig/gnulib/Makefile.am msmtp-1.4.12/gnulib/Makefile.am | ||
69 | --- msmtp-1.4.12.orig/gnulib/Makefile.am | ||
70 | +++ msmtp-1.4.12/gnulib/Makefile.am | ||
71 | @@ -59,20 +59,18 @@ | ||
72 | |||
73 | ## begin gnulib module crypto/hmac-md5 | ||
74 | |||
75 | +libgnu_a_SOURCES += hmac-md5.c | ||
76 | |||
77 | EXTRA_DIST += hmac-md5.c hmac.h | ||
78 | |||
79 | -EXTRA_libgnu_a_SOURCES += hmac-md5.c | ||
80 | - | ||
81 | ## end gnulib module crypto/hmac-md5 | ||
82 | |||
83 | ## begin gnulib module crypto/md5 | ||
84 | |||
85 | +libgnu_a_SOURCES += md5.c | ||
86 | |||
87 | EXTRA_DIST += md5.c md5.h | ||
88 | |||
89 | -EXTRA_libgnu_a_SOURCES += md5.c | ||
90 | - | ||
91 | ## end gnulib module crypto/md5 | ||
92 | |||
93 | ## begin gnulib module getdelim | ||
94 | @@ -149,11 +147,10 @@ | ||
95 | |||
96 | ## begin gnulib module memxor | ||
97 | |||
98 | +libgnu_a_SOURCES += memxor.c | ||
99 | |||
100 | EXTRA_DIST += memxor.c memxor.h | ||
101 | |||
102 | -EXTRA_libgnu_a_SOURCES += memxor.c | ||
103 | - | ||
104 | ## end gnulib module memxor | ||
105 | |||
106 | ## begin gnulib module size_max | ||
107 | @@ -219,47 +216,6 @@ | ||
108 | |||
109 | ## end gnulib module stdint | ||
110 | |||
111 | -## begin gnulib module stdio | ||
112 | - | ||
113 | -BUILT_SOURCES += stdio.h | ||
114 | - | ||
115 | -# We need the following in order to create <stdio.h> when the system | ||
116 | -# doesn't have one that works with the given compiler. | ||
117 | -stdio.h: stdio_.h | ||
118 | - rm -f $@-t $@ | ||
119 | - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ | ||
120 | - sed -e 's|@''ABSOLUTE_STDIO_H''@|$(ABSOLUTE_STDIO_H)|g' \ | ||
121 | - -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \ | ||
122 | - -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \ | ||
123 | - -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \ | ||
124 | - -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \ | ||
125 | - -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \ | ||
126 | - -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \ | ||
127 | - -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \ | ||
128 | - -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \ | ||
129 | - -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \ | ||
130 | - -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \ | ||
131 | - -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \ | ||
132 | - -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \ | ||
133 | - -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \ | ||
134 | - -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \ | ||
135 | - -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \ | ||
136 | - -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \ | ||
137 | - -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \ | ||
138 | - -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ | ||
139 | - -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ | ||
140 | - -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ | ||
141 | - -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ | ||
142 | - -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \ | ||
143 | - < $(srcdir)/stdio_.h; \ | ||
144 | - } > $@-t | ||
145 | - mv $@-t $@ | ||
146 | -MOSTLYCLEANFILES += stdio.h stdio.h-t | ||
147 | - | ||
148 | -EXTRA_DIST += stdio_.h | ||
149 | - | ||
150 | -## end gnulib module stdio | ||
151 | - | ||
152 | ## begin gnulib module sys_socket | ||
153 | |||
154 | BUILT_SOURCES += $(SYS_SOCKET_H) | ||
155 | @@ -302,40 +258,6 @@ | ||
156 | |||
157 | ## end gnulib module sysexits | ||
158 | |||
159 | -## begin gnulib module unistd | ||
160 | - | ||
161 | -BUILT_SOURCES += unistd.h | ||
162 | - | ||
163 | -# We need the following in order to create an empty placeholder for | ||
164 | -# <unistd.h> when the system doesn't have one. | ||
165 | -unistd.h: unistd_.h | ||
166 | - rm -f $@-t $@ | ||
167 | - { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ | ||
168 | - sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ | ||
169 | - -e 's|@''ABSOLUTE_UNISTD_H''@|$(ABSOLUTE_UNISTD_H)|g' \ | ||
170 | - -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \ | ||
171 | - -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \ | ||
172 | - -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \ | ||
173 | - -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ | ||
174 | - -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ | ||
175 | - -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ | ||
176 | - -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ | ||
177 | - -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ | ||
178 | - -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ | ||
179 | - -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ | ||
180 | - -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ | ||
181 | - -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ | ||
182 | - -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ | ||
183 | - -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ | ||
184 | - < $(srcdir)/unistd_.h; \ | ||
185 | - } > $@-t | ||
186 | - mv $@-t $@ | ||
187 | -MOSTLYCLEANFILES += unistd.h unistd.h-t | ||
188 | - | ||
189 | -EXTRA_DIST += unistd_.h | ||
190 | - | ||
191 | -## end gnulib module unistd | ||
192 | - | ||
193 | ## begin gnulib module vasnprintf | ||
194 | |||
195 | |||
196 | @@ -375,11 +297,10 @@ | ||
197 | |||
198 | ## begin gnulib module xalloc | ||
199 | |||
200 | +libgnu_a_SOURCES += xmalloc.c | ||
201 | |||
202 | EXTRA_DIST += xalloc.h xmalloc.c | ||
203 | |||
204 | -EXTRA_libgnu_a_SOURCES += xmalloc.c | ||
205 | - | ||
206 | ## end gnulib module xalloc | ||
207 | |||
208 | ## begin gnulib module xsize | ||
209 | diff -Naur msmtp-1.4.12.orig/gnulib/memxor.c msmtp-1.4.12/gnulib/memxor.c | ||
210 | --- msmtp-1.4.12.orig/gnulib/memxor.c | ||
211 | +++ msmtp-1.4.12/gnulib/memxor.c | ||
212 | @@ -23,7 +23,7 @@ | ||
213 | #include "memxor.h" | ||
214 | |||
215 | void * | ||
216 | -memxor (void *restrict dest, const void *restrict src, size_t n) | ||
217 | +memxor (void *dest, const void *src, size_t n) | ||
218 | { | ||
219 | char const *s = src; | ||
220 | char *d = dest; | ||
221 | diff -Naur msmtp-1.4.12.orig/gnulib/memxor.h msmtp-1.4.12/gnulib/memxor.h | ||
222 | --- msmtp-1.4.12.orig/gnulib/memxor.h | ||
223 | +++ msmtp-1.4.12/gnulib/memxor.h | ||
224 | @@ -26,6 +26,6 @@ | ||
225 | /* Compute binary exclusive OR of memory areas DEST and SRC, putting | ||
226 | the result in DEST, of length N bytes. Returns a pointer to | ||
227 | DEST. */ | ||
228 | -void *memxor (void *restrict dest, const void *restrict src, size_t n); | ||
229 | +void *memxor (void *dest, const void *src, size_t n); | ||
230 | |||
231 | #endif /* MEMXOR_H */ | ||
232 | diff -Naur msmtp-1.4.12.orig/gnulib/xsize.h msmtp-1.4.12/gnulib/xsize.h | ||
233 | --- msmtp-1.4.12.orig/gnulib/xsize.h | ||
234 | +++ msmtp-1.4.12/gnulib/xsize.h | ||
235 | @@ -24,9 +24,7 @@ | ||
236 | |||
237 | /* Get SIZE_MAX. */ | ||
238 | #include <limits.h> | ||
239 | -#if HAVE_STDINT_H | ||
240 | # include <stdint.h> | ||
241 | -#endif | ||
242 | |||
243 | /* The size of memory objects is often computed through expressions of | ||
244 | type size_t. Example: | ||
diff --git a/recipes-extended/msmtp/files/msmtp-replace-deprecated-function.patch b/recipes-extended/msmtp/files/msmtp-replace-deprecated-function.patch new file mode 100644 index 0000000..ca1fd0e --- /dev/null +++ b/recipes-extended/msmtp/files/msmtp-replace-deprecated-function.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | From 090017efca9396a7cef0ccdc645a88c5457c63b8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jackie Huang <jackie.huang@windriver.com> | ||
3 | Date: Wed, 29 Jun 2016 01:22:46 -0400 | ||
4 | Subject: [PATCH] Replace deprecated function gnutls_protocol_set_priority | ||
5 | |||
6 | The function gnutls_protocol_set_priority is deprecated | ||
7 | since GnuTLS >= 2.12.0 and replaced by gnutls_priority_set_direct. | ||
8 | |||
9 | Reference: | ||
10 | http://www.gnutls.org/manual/html_node/Upgrading-from-previous-versions.html#Upgrading-from-previous-versions | ||
11 | |||
12 | Upstream-Status: Inappropriate [upstream rewrote with GPLv3] | ||
13 | |||
14 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
15 | --- | ||
16 | src/tls.c | 20 +++++++++++++++++--- | ||
17 | 1 file changed, 17 insertions(+), 3 deletions(-) | ||
18 | |||
19 | diff --git a/src/tls.c b/src/tls.c | ||
20 | index 10818fa..881e94b 100644 | ||
21 | --- a/src/tls.c | ||
22 | +++ b/src/tls.c | ||
23 | @@ -928,7 +928,15 @@ int tls_init(tls_t *tls, const char *key_file, const char *cert_file, | ||
24 | const char *trust_file, int force_sslv3, char **errstr) | ||
25 | { | ||
26 | #ifdef HAVE_LIBGNUTLS | ||
27 | +#if GNUTLS_VERSION_MAJOR >= 2 && GNUTLS_VERSION_MINOR >= 12 | ||
28 | + const char *force_sslv3_str = ":-VERS-TLS-ALL:+VERS-SSL3.0"; | ||
29 | +#else | ||
30 | + const char *force_sslv3_str = | ||
31 | + ":-VERS-TLS1.2:-VERS-TLS1.1:-VERS-TLS1.0:+VERS-SSL3.0"; | ||
32 | +#endif | ||
33 | int error_code; | ||
34 | + char *priorities; | ||
35 | + const char *error_pos; | ||
36 | |||
37 | if ((error_code = gnutls_init(&tls->session, GNUTLS_CLIENT)) != 0) | ||
38 | { | ||
39 | @@ -945,9 +953,15 @@ int tls_init(tls_t *tls, const char *key_file, const char *cert_file, | ||
40 | } | ||
41 | if (force_sslv3) | ||
42 | { | ||
43 | - const int force_sslv3_proto_prio[2] = { GNUTLS_SSL3, 0 }; | ||
44 | - if ((error_code = gnutls_protocol_set_priority(tls->session, | ||
45 | - force_sslv3_proto_prio)) != 0) | ||
46 | + priorities = xstrdup("NORMAL"); | ||
47 | + error_pos = NULL; | ||
48 | + | ||
49 | + priorities = xrealloc(priorities, | ||
50 | + strlen(priorities) + strlen(force_sslv3_str) + 1); | ||
51 | + strcat(priorities, force_sslv3_str); | ||
52 | + | ||
53 | + if ((error_code = gnutls_priority_set_direct(tls->session, | ||
54 | + priorities, &error_pos)) != 0) | ||
55 | { | ||
56 | *errstr = xasprintf(_("cannot force SSLv3: %s"), | ||
57 | gnutls_strerror(error_code)); | ||
58 | -- | ||
59 | 2.8.1 | ||
60 | |||
diff --git a/recipes-extended/msmtp/msmtp_1.4.12.bb b/recipes-extended/msmtp/msmtp_1.4.12.bb new file mode 100644 index 0000000..e03d432 --- /dev/null +++ b/recipes-extended/msmtp/msmtp_1.4.12.bb | |||
@@ -0,0 +1,35 @@ | |||
1 | SUMMARY = "msmtp is an SMTP client." | ||
2 | DESCRIPTION = "A sendmail replacement for use in MTAs like mutt" | ||
3 | HOMEPAGE = "http://msmtp.sourceforge.net/" | ||
4 | SECTION = "console/network" | ||
5 | |||
6 | LICENSE = "GPLv2" | ||
7 | |||
8 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
9 | |||
10 | DEPENDS = "zlib gnutls" | ||
11 | |||
12 | SRC_URI = "http://sourceforge.net/projects/msmtp/files/msmtp/${PV}/${BPN}-${PV}.tar.bz2 \ | ||
13 | file://msmtp-fixup-api-and-compiler-warning.patch \ | ||
14 | file://msmtp-replace-deprecated-function.patch \ | ||
15 | " | ||
16 | |||
17 | SRC_URI[md5sum] = "ba5b61d5f7667d288f1cfadccfff8ac5" | ||
18 | SRC_URI[sha256sum] = "ab794bb014cdaeae0a1460a7aca1869dab8c93383bf01f41aca41b3d99b69509" | ||
19 | |||
20 | EXTRA_OECONF += "--with-libgnutls-prefix=${STAGING_DIR}/${HOST_SYS}" | ||
21 | |||
22 | PACKAGECONFIG ??= "" | ||
23 | PACKAGECONFIG[libidn] = "--with-libidn,--without-libidn,libidn" | ||
24 | |||
25 | inherit gettext autotools update-alternatives | ||
26 | |||
27 | ALTERNATIVE_${PN} = "sendmail" | ||
28 | ALTERNATIVE_TARGET[sendmail] = "${bindir}/msmtp" | ||
29 | ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail" | ||
30 | ALTERNATIVE_PRIORITY = "100" | ||
31 | |||
32 | pkg_postinst_${PN}_linuxstdbase () { | ||
33 | # /usr/lib/sendmail is required by LSB specification | ||
34 | [ ! -L $D/usr/lib/sendmail ] && ln -sf ${sbindir}/sendmail $D/usr/lib | ||
35 | } | ||