1 |
commit: cdd0e4da50f82b1badca13b52feb19e4b80b9468 |
2 |
Author: Craig Andrews <candrews <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Oct 25 13:37:51 2018 +0000 |
4 |
Commit: Craig Andrews <candrews <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Oct 25 13:37:51 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cdd0e4da |
7 |
|
8 |
media-video/rtmpdump: OpenSSL 1.1 fix, swf verification type 2 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/669574 |
11 |
Signed-off-by: Craig Andrews <candrews <AT> gentoo.org> |
12 |
Package-Manager: Portage-2.3.51, Repoman-2.3.11 |
13 |
|
14 |
.../rtmpdump/files/rtmpdump-openssl-1.1.patch | 249 +++++++++++++++++++++ |
15 |
.../files/rtmpdump-swf_vertification_type_2.patch | 13 ++ |
16 |
.../rtmpdump-swf_vertification_type_2_part_2.patch | 21 ++ |
17 |
...999.ebuild => rtmpdump-2.4_p20161210-r2.ebuild} | 34 ++- |
18 |
media-video/rtmpdump/rtmpdump-9999.ebuild | 34 ++- |
19 |
5 files changed, 341 insertions(+), 10 deletions(-) |
20 |
|
21 |
diff --git a/media-video/rtmpdump/files/rtmpdump-openssl-1.1.patch b/media-video/rtmpdump/files/rtmpdump-openssl-1.1.patch |
22 |
new file mode 100644 |
23 |
index 00000000000..6ed388bbc09 |
24 |
--- /dev/null |
25 |
+++ b/media-video/rtmpdump/files/rtmpdump-openssl-1.1.patch |
26 |
@@ -0,0 +1,249 @@ |
27 |
+https://github.com/xbmc/inputstream.rtmp/blob/dc9353823f9cfd2943f97b586230fe387cc55dc6/depends/common/librtmp/0003-openssl-1.1.patch |
28 |
+--- a/librtmp/dh.h |
29 |
++++ b/librtmp/dh.h |
30 |
+@@ -253,20 +253,44 @@ |
31 |
+ if (!dh) |
32 |
+ goto failed; |
33 |
+ |
34 |
++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L |
35 |
+ MP_new(dh->g); |
36 |
+ |
37 |
+ if (!dh->g) |
38 |
+ goto failed; |
39 |
++#else |
40 |
++ BIGNUM *g = NULL; |
41 |
++ MP_new(g); |
42 |
++ if (!g) |
43 |
++ goto failed; |
44 |
++ |
45 |
++ DH_set0_pqg(dh, NULL, g, NULL); |
46 |
++#endif |
47 |
+ |
48 |
++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L |
49 |
+ MP_gethex(dh->p, P1024, res); /* prime P1024, see dhgroups.h */ |
50 |
++#else |
51 |
++ BIGNUM* p = NULL; |
52 |
++ DH_get0_pqg(dh, (BIGNUM const**)&p, NULL, NULL); |
53 |
++ MP_gethex(p, P1024, res); /* prime P1024, see dhgroups.h */ |
54 |
++#endif |
55 |
+ if (!res) |
56 |
+ { |
57 |
+ goto failed; |
58 |
+ } |
59 |
+ |
60 |
++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L |
61 |
+ MP_set_w(dh->g, 2); /* base 2 */ |
62 |
++#else |
63 |
++ MP_set_w(g, 2); /* base 2 */ |
64 |
++ DH_set0_pqg(dh, NULL, g, NULL); |
65 |
++#endif |
66 |
+ |
67 |
++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L |
68 |
+ dh->length = nKeyBits; |
69 |
++#else |
70 |
++ DH_set_length(dh, nKeyBits); |
71 |
++#endif |
72 |
+ return dh; |
73 |
+ |
74 |
+ failed: |
75 |
+@@ -293,12 +317,24 @@ |
76 |
+ MP_gethex(q1, Q1024, res); |
77 |
+ assert(res); |
78 |
+ |
79 |
++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L |
80 |
+ res = isValidPublicKey(dh->pub_key, dh->p, q1); |
81 |
++#else |
82 |
++ BIGNUM const* pub_key = NULL; |
83 |
++ BIGNUM const* p = NULL; |
84 |
++ DH_get0_key(dh, &pub_key, NULL); |
85 |
++ DH_get0_pqg(dh, &p, NULL, NULL); |
86 |
++ res = isValidPublicKey((BIGNUM*)pub_key, (BIGNUM*)p, q1); |
87 |
++#endif |
88 |
+ if (!res) |
89 |
+ { |
90 |
++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L |
91 |
+ MP_free(dh->pub_key); |
92 |
+ MP_free(dh->priv_key); |
93 |
+ dh->pub_key = dh->priv_key = 0; |
94 |
++#else |
95 |
++ DH_free(dh); |
96 |
++#endif |
97 |
+ } |
98 |
+ |
99 |
+ MP_free(q1); |
100 |
+@@ -314,15 +350,29 @@ |
101 |
+ DHGetPublicKey(MDH *dh, uint8_t *pubkey, size_t nPubkeyLen) |
102 |
+ { |
103 |
+ int len; |
104 |
++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L |
105 |
+ if (!dh || !dh->pub_key) |
106 |
++#else |
107 |
++ BIGNUM const* pub_key = NULL; |
108 |
++ DH_get0_key(dh, &pub_key, NULL); |
109 |
++ if (!dh || !pub_key) |
110 |
++#endif |
111 |
+ return 0; |
112 |
+ |
113 |
++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L |
114 |
+ len = MP_bytes(dh->pub_key); |
115 |
++#else |
116 |
++ len = MP_bytes(pub_key); |
117 |
++#endif |
118 |
+ if (len <= 0 || len > (int) nPubkeyLen) |
119 |
+ return 0; |
120 |
+ |
121 |
+ memset(pubkey, 0, nPubkeyLen); |
122 |
++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L |
123 |
+ MP_setbin(dh->pub_key, pubkey + (nPubkeyLen - len), len); |
124 |
++#else |
125 |
++ MP_setbin(pub_key, pubkey + (nPubkeyLen - len), len); |
126 |
++#endif |
127 |
+ return 1; |
128 |
+ } |
129 |
+ |
130 |
+@@ -364,7 +414,13 @@ |
131 |
+ MP_gethex(q1, Q1024, len); |
132 |
+ assert(len); |
133 |
+ |
134 |
++#if !defined(USE_OPENSSL) || !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER < 0x10100000L |
135 |
+ if (isValidPublicKey(pubkeyBn, dh->p, q1)) |
136 |
++#else |
137 |
++ BIGNUM const* p = NULL; |
138 |
++ DH_get0_pqg(dh, &p, NULL, NULL); |
139 |
++ if (isValidPublicKey(pubkeyBn, (BIGNUM*)p, q1)) |
140 |
++#endif |
141 |
+ res = MDH_compute_key(secret, nPubkeyLen, pubkeyBn, dh); |
142 |
+ else |
143 |
+ res = -1; |
144 |
+--- a/librtmp/handshake.h |
145 |
++++ b/librtmp/handshake.h |
146 |
+@@ -31,9 +31,9 @@ |
147 |
+ #define SHA256_DIGEST_LENGTH 32 |
148 |
+ #endif |
149 |
+ #define HMAC_CTX sha2_context |
150 |
+-#define HMAC_setup(ctx, key, len) sha2_hmac_starts(&ctx, (unsigned char *)key, len, 0) |
151 |
+-#define HMAC_crunch(ctx, buf, len) sha2_hmac_update(&ctx, buf, len) |
152 |
+-#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; sha2_hmac_finish(&ctx, dig) |
153 |
++#define HMAC_setup(ctx, key, len) sha2_hmac_starts(ctx, (unsigned char *)key, len, 0) |
154 |
++#define HMAC_crunch(ctx, buf, len) sha2_hmac_update(ctx, buf, len) |
155 |
++#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; sha2_hmac_finish(ctx, dig) |
156 |
+ |
157 |
+ typedef arc4_context * RC4_handle; |
158 |
+ #define RC4_alloc(h) *h = malloc(sizeof(arc4_context)) |
159 |
+@@ -50,9 +50,9 @@ |
160 |
+ #endif |
161 |
+ #undef HMAC_CTX |
162 |
+ #define HMAC_CTX struct hmac_sha256_ctx |
163 |
+-#define HMAC_setup(ctx, key, len) hmac_sha256_set_key(&ctx, len, key) |
164 |
+-#define HMAC_crunch(ctx, buf, len) hmac_sha256_update(&ctx, len, buf) |
165 |
+-#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; hmac_sha256_digest(&ctx, SHA256_DIGEST_LENGTH, dig) |
166 |
++#define HMAC_setup(ctx, key, len) hmac_sha256_set_key(ctx, len, key) |
167 |
++#define HMAC_crunch(ctx, buf, len) hmac_sha256_update(ctx, len, buf) |
168 |
++#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; hmac_sha256_digest(ctx, SHA256_DIGEST_LENGTH, dig) |
169 |
+ #define HMAC_close(ctx) |
170 |
+ |
171 |
+ typedef struct arcfour_ctx* RC4_handle; |
172 |
+@@ -64,14 +64,23 @@ |
173 |
+ |
174 |
+ #else /* USE_OPENSSL */ |
175 |
+ #include <openssl/sha.h> |
176 |
++#include <openssl/ossl_typ.h> |
177 |
+ #include <openssl/hmac.h> |
178 |
+ #include <openssl/rc4.h> |
179 |
+ #if OPENSSL_VERSION_NUMBER < 0x0090800 || !defined(SHA256_DIGEST_LENGTH) |
180 |
+ #error Your OpenSSL is too old, need 0.9.8 or newer with SHA256 |
181 |
+ #endif |
182 |
+-#define HMAC_setup(ctx, key, len) HMAC_CTX_init(&ctx); HMAC_Init_ex(&ctx, key, len, EVP_sha256(), 0) |
183 |
+-#define HMAC_crunch(ctx, buf, len) HMAC_Update(&ctx, buf, len) |
184 |
+-#define HMAC_finish(ctx, dig, dlen) HMAC_Final(&ctx, dig, &dlen); HMAC_CTX_cleanup(&ctx) |
185 |
++#if OPENSSL_VERSION_NUMBER < 0x10100000L |
186 |
++#define HMAC_setup(ctx, key, len) HMAC_CTX_init(ctx); HMAC_Init_ex(ctx, key, len, EVP_sha256(), 0) |
187 |
++#else |
188 |
++#define HMAC_setup(ctx, key, len) HMAC_CTX_reset(ctx); HMAC_Init_ex(ctx, key, len, EVP_sha256(), 0) |
189 |
++#endif |
190 |
++#define HMAC_crunch(ctx, buf, len) HMAC_Update(ctx, buf, len) |
191 |
++#if OPENSSL_VERSION_NUMBER < 0x10100000L |
192 |
++#define HMAC_finish(ctx, dig, dlen) HMAC_Final(ctx, dig, &dlen); HMAC_CTX_cleanup(ctx) |
193 |
++#else |
194 |
++#define HMAC_finish(ctx, dig, dlen) HMAC_Final(ctx, dig, &dlen); HMAC_CTX_free(ctx) |
195 |
++#endif |
196 |
+ |
197 |
+ typedef RC4_KEY * RC4_handle; |
198 |
+ #define RC4_alloc(h) *h = malloc(sizeof(RC4_KEY)) |
199 |
+@@ -117,7 +126,7 @@ |
200 |
+ { |
201 |
+ uint8_t digest[SHA256_DIGEST_LENGTH]; |
202 |
+ unsigned int digestLen = 0; |
203 |
+- HMAC_CTX ctx; |
204 |
++ HMAC_CTX* ctx = NULL; |
205 |
+ |
206 |
+ RC4_alloc(rc4keyIn); |
207 |
+ RC4_alloc(rc4keyOut); |
208 |
+@@ -266,7 +275,7 @@ |
209 |
+ size_t keylen, uint8_t *digest) |
210 |
+ { |
211 |
+ unsigned int digestLen; |
212 |
+- HMAC_CTX ctx; |
213 |
++ HMAC_CTX* ctx = NULL; |
214 |
+ |
215 |
+ HMAC_setup(ctx, key, keylen); |
216 |
+ HMAC_crunch(ctx, message, messageLen); |
217 |
+--- a/librtmp/hashswf.c |
218 |
++++ b/librtmp/hashswf.c |
219 |
+@@ -37,9 +37,9 @@ |
220 |
+ #define SHA256_DIGEST_LENGTH 32 |
221 |
+ #endif |
222 |
+ #define HMAC_CTX sha2_context |
223 |
+-#define HMAC_setup(ctx, key, len) sha2_hmac_starts(&ctx, (unsigned char *)key, len, 0) |
224 |
+-#define HMAC_crunch(ctx, buf, len) sha2_hmac_update(&ctx, buf, len) |
225 |
+-#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; sha2_hmac_finish(&ctx, dig) |
226 |
++#define HMAC_setup(ctx, key, len) sha2_hmac_starts(ctx, (unsigned char *)key, len, 0) |
227 |
++#define HMAC_crunch(ctx, buf, len) sha2_hmac_update(ctx, buf, len) |
228 |
++#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; sha2_hmac_finish(ctx, dig) |
229 |
+ #define HMAC_close(ctx) |
230 |
+ #elif defined(USE_GNUTLS) |
231 |
+ #include <nettle/hmac.h> |
232 |
+@@ -48,19 +48,27 @@ |
233 |
+ #endif |
234 |
+ #undef HMAC_CTX |
235 |
+ #define HMAC_CTX struct hmac_sha256_ctx |
236 |
+-#define HMAC_setup(ctx, key, len) hmac_sha256_set_key(&ctx, len, key) |
237 |
+-#define HMAC_crunch(ctx, buf, len) hmac_sha256_update(&ctx, len, buf) |
238 |
+-#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; hmac_sha256_digest(&ctx, SHA256_DIGEST_LENGTH, dig) |
239 |
++#define HMAC_setup(ctx, key, len) hmac_sha256_set_key(ctx, len, key) |
240 |
++#define HMAC_crunch(ctx, buf, len) hmac_sha256_update(ctx, len, buf) |
241 |
++#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; hmac_sha256_digest(ctx, SHA256_DIGEST_LENGTH, dig) |
242 |
+ #define HMAC_close(ctx) |
243 |
+ #else /* USE_OPENSSL */ |
244 |
+ #include <openssl/ssl.h> |
245 |
+ #include <openssl/sha.h> |
246 |
+ #include <openssl/hmac.h> |
247 |
+ #include <openssl/rc4.h> |
248 |
+-#define HMAC_setup(ctx, key, len) HMAC_CTX_init(&ctx); HMAC_Init_ex(&ctx, (unsigned char *)key, len, EVP_sha256(), 0) |
249 |
+-#define HMAC_crunch(ctx, buf, len) HMAC_Update(&ctx, (unsigned char *)buf, len) |
250 |
+-#define HMAC_finish(ctx, dig, dlen) HMAC_Final(&ctx, (unsigned char *)dig, &dlen); |
251 |
+-#define HMAC_close(ctx) HMAC_CTX_cleanup(&ctx) |
252 |
++#if OPENSSL_VERSION_NUMBER < 0x10100000L |
253 |
++#define HMAC_setup(ctx, key, len) HMAC_CTX_init(ctx); HMAC_Init_ex(ctx, (unsigned char *)key, len, EVP_sha256(), 0) |
254 |
++#else |
255 |
++#define HMAC_setup(ctx, key, len) HMAC_CTX_reset(ctx); HMAC_Init_ex(ctx, (unsigned char *)key, len, EVP_sha256(), 0) |
256 |
++#endif |
257 |
++#define HMAC_crunch(ctx, buf, len) HMAC_Update(ctx, (unsigned char *)buf, len) |
258 |
++#define HMAC_finish(ctx, dig, dlen) HMAC_Final(ctx, (unsigned char *)dig, &dlen); |
259 |
++#if OPENSSL_VERSION_NUMBER < 0x10100000L |
260 |
++#define HMAC_close(ctx) HMAC_CTX_cleanup(ctx) |
261 |
++#else |
262 |
++#define HMAC_close(ctx) HMAC_CTX_reset(ctx); HMAC_CTX_free(ctx) |
263 |
++#endif |
264 |
+ #endif |
265 |
+ |
266 |
+ extern void RTMP_TLS_Init(); |
267 |
+@@ -289,7 +297,7 @@ |
268 |
+ struct info |
269 |
+ { |
270 |
+ z_stream *zs; |
271 |
+- HMAC_CTX ctx; |
272 |
++ HMAC_CTX *ctx; |
273 |
+ int first; |
274 |
+ int zlib; |
275 |
+ int size; |
276 |
|
277 |
diff --git a/media-video/rtmpdump/files/rtmpdump-swf_vertification_type_2.patch b/media-video/rtmpdump/files/rtmpdump-swf_vertification_type_2.patch |
278 |
new file mode 100644 |
279 |
index 00000000000..0e9c8302e8c |
280 |
--- /dev/null |
281 |
+++ b/media-video/rtmpdump/files/rtmpdump-swf_vertification_type_2.patch |
282 |
@@ -0,0 +1,13 @@ |
283 |
+diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c |
284 |
+index 5311a8a..79fefae 100644 |
285 |
+--- a/librtmp/rtmp.c |
286 |
++++ b/librtmp/rtmp.c |
287 |
+@@ -2854,7 +2854,7 @@ HandleCtrl(RTMP *r, const RTMPPacket *packet) |
288 |
+ if (nType == 0x1A) |
289 |
+ { |
290 |
+ RTMP_Log(RTMP_LOGDEBUG, "%s, SWFVerification ping received: ", __FUNCTION__); |
291 |
+- if (packet->m_nBodySize > 2 && packet->m_body[2] > 0x01) |
292 |
++ if (packet->m_nBodySize > 2 && packet->m_body[2] > 0x02) |
293 |
+ { |
294 |
+ RTMP_Log(RTMP_LOGERROR, |
295 |
+ "%s: SWFVerification Type %d request not supported! Patches welcome...", |
296 |
|
297 |
diff --git a/media-video/rtmpdump/files/rtmpdump-swf_vertification_type_2_part_2.patch b/media-video/rtmpdump/files/rtmpdump-swf_vertification_type_2_part_2.patch |
298 |
new file mode 100644 |
299 |
index 00000000000..55d02692464 |
300 |
--- /dev/null |
301 |
+++ b/media-video/rtmpdump/files/rtmpdump-swf_vertification_type_2_part_2.patch |
302 |
@@ -0,0 +1,21 @@ |
303 |
+diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c |
304 |
+index df2cb27..b72dc64 100644 |
305 |
+--- a/librtmp/rtmp.c |
306 |
++++ b/librtmp/rtmp.c |
307 |
+@@ -2857,14 +2857,14 @@ HandleCtrl(RTMP *r, const RTMPPacket *packet) |
308 |
+ if (packet->m_nBodySize > 2 && packet->m_body[2] > 0x01) |
309 |
+ { |
310 |
+ RTMP_Log(RTMP_LOGERROR, |
311 |
+- "%s: SWFVerification Type %d request not supported! Patches welcome...", |
312 |
++ "%s: SWFVerification Type %d request not supported, attempting to use SWFVerification Type 1! Patches welcome...", |
313 |
+ __FUNCTION__, packet->m_body[2]); |
314 |
+ } |
315 |
+ #ifdef CRYPTO |
316 |
+ /*RTMP_LogHex(packet.m_body, packet.m_nBodySize); */ |
317 |
+ |
318 |
+ /* respond with HMAC SHA256 of decompressed SWF, key is the 30byte player key, also the last 30 bytes of the server handshake are applied */ |
319 |
+- else if (r->Link.SWFSize) |
320 |
++ if (r->Link.SWFSize) |
321 |
+ { |
322 |
+ RTMP_SendCtrl(r, 0x1B, 0, 0); |
323 |
+ } |
324 |
\ No newline at end of file |
325 |
|
326 |
diff --git a/media-video/rtmpdump/rtmpdump-9999.ebuild b/media-video/rtmpdump/rtmpdump-2.4_p20161210-r2.ebuild |
327 |
similarity index 71% |
328 |
copy from media-video/rtmpdump/rtmpdump-9999.ebuild |
329 |
copy to media-video/rtmpdump/rtmpdump-2.4_p20161210-r2.ebuild |
330 |
index 83fe157d7a3..8bfb1dd533d 100644 |
331 |
--- a/media-video/rtmpdump/rtmpdump-9999.ebuild |
332 |
+++ b/media-video/rtmpdump/rtmpdump-2.4_p20161210-r2.ebuild |
333 |
@@ -1,18 +1,16 @@ |
334 |
-# Copyright 1999-2018 Gentoo Foundation |
335 |
+# Copyright 1999-2018 Gentoo Authors |
336 |
# Distributed under the terms of the GNU General Public License v2 |
337 |
|
338 |
EAPI="6" |
339 |
|
340 |
-inherit git-r3 multilib toolchain-funcs multilib-minimal flag-o-matic |
341 |
+inherit multilib toolchain-funcs multilib-minimal flag-o-matic |
342 |
|
343 |
DESCRIPTION="RTMP client intended to stream audio or video flash content" |
344 |
HOMEPAGE="https://rtmpdump.mplayerhq.hu/" |
345 |
-EGIT_REPO_URI="https://git.ffmpeg.org/rtmpdump.git" |
346 |
|
347 |
# the library is LGPL-2.1, the command is GPL-2 |
348 |
LICENSE="GPL-2 LGPL-2.1" |
349 |
SLOT="0" |
350 |
-KEYWORDS="" |
351 |
IUSE="gnutls ssl libressl" |
352 |
|
353 |
DEPEND="ssl? ( |
354 |
@@ -25,6 +23,22 @@ DEPEND="ssl? ( |
355 |
)" |
356 |
RDEPEND="${DEPEND}" |
357 |
|
358 |
+PATCHES=( |
359 |
+ "${FILESDIR}/${PN}-openssl-1.1.patch" |
360 |
+ "${FILESDIR}/${PN}-swf_vertification_type_2.patch" |
361 |
+ "${FILESDIR}/${PN}-swf_vertification_type_2_part_2.patch" |
362 |
+) |
363 |
+ |
364 |
+if [[ ${PV} == *9999 ]] ; then |
365 |
+ KEYWORDS="" |
366 |
+ SRC_URI="" |
367 |
+ EGIT_REPO_URI="https://git.ffmpeg.org/rtmpdump.git" |
368 |
+ inherit git-r3 |
369 |
+else |
370 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux" |
371 |
+ SRC_URI="https://dev.gentoo.org/~hwoarang/distfiles/${P}.tar.gz" |
372 |
+fi |
373 |
+ |
374 |
pkg_setup() { |
375 |
if ! use ssl && use gnutls ; then |
376 |
ewarn "USE='gnutls' is ignored without USE='ssl'." |
377 |
@@ -32,6 +46,16 @@ pkg_setup() { |
378 |
fi |
379 |
} |
380 |
|
381 |
+src_unpack() { |
382 |
+ if [[ ${PV} == *9999 ]] ; then |
383 |
+ git-r3_src_unpack |
384 |
+ else |
385 |
+ mkdir -p "${S}" || die "Can't create source directory" |
386 |
+ cd "${S}" || die |
387 |
+ unpack ${A} |
388 |
+ fi |
389 |
+} |
390 |
+ |
391 |
src_prepare() { |
392 |
# fix #571106 by restoring pre-GCC5 inline semantics |
393 |
append-cflags -std=gnu89 |
394 |
@@ -42,7 +66,7 @@ src_prepare() { |
395 |
-e 's:OPT:OPTS:' \ |
396 |
-e 's:CFLAGS=.*:& $(OPT):' librtmp/Makefile \ |
397 |
|| die "failed to fix Makefile" |
398 |
- eapply_user |
399 |
+ default |
400 |
multilib_copy_sources |
401 |
} |
402 |
|
403 |
|
404 |
diff --git a/media-video/rtmpdump/rtmpdump-9999.ebuild b/media-video/rtmpdump/rtmpdump-9999.ebuild |
405 |
index 83fe157d7a3..8bfb1dd533d 100644 |
406 |
--- a/media-video/rtmpdump/rtmpdump-9999.ebuild |
407 |
+++ b/media-video/rtmpdump/rtmpdump-9999.ebuild |
408 |
@@ -1,18 +1,16 @@ |
409 |
-# Copyright 1999-2018 Gentoo Foundation |
410 |
+# Copyright 1999-2018 Gentoo Authors |
411 |
# Distributed under the terms of the GNU General Public License v2 |
412 |
|
413 |
EAPI="6" |
414 |
|
415 |
-inherit git-r3 multilib toolchain-funcs multilib-minimal flag-o-matic |
416 |
+inherit multilib toolchain-funcs multilib-minimal flag-o-matic |
417 |
|
418 |
DESCRIPTION="RTMP client intended to stream audio or video flash content" |
419 |
HOMEPAGE="https://rtmpdump.mplayerhq.hu/" |
420 |
-EGIT_REPO_URI="https://git.ffmpeg.org/rtmpdump.git" |
421 |
|
422 |
# the library is LGPL-2.1, the command is GPL-2 |
423 |
LICENSE="GPL-2 LGPL-2.1" |
424 |
SLOT="0" |
425 |
-KEYWORDS="" |
426 |
IUSE="gnutls ssl libressl" |
427 |
|
428 |
DEPEND="ssl? ( |
429 |
@@ -25,6 +23,22 @@ DEPEND="ssl? ( |
430 |
)" |
431 |
RDEPEND="${DEPEND}" |
432 |
|
433 |
+PATCHES=( |
434 |
+ "${FILESDIR}/${PN}-openssl-1.1.patch" |
435 |
+ "${FILESDIR}/${PN}-swf_vertification_type_2.patch" |
436 |
+ "${FILESDIR}/${PN}-swf_vertification_type_2_part_2.patch" |
437 |
+) |
438 |
+ |
439 |
+if [[ ${PV} == *9999 ]] ; then |
440 |
+ KEYWORDS="" |
441 |
+ SRC_URI="" |
442 |
+ EGIT_REPO_URI="https://git.ffmpeg.org/rtmpdump.git" |
443 |
+ inherit git-r3 |
444 |
+else |
445 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux" |
446 |
+ SRC_URI="https://dev.gentoo.org/~hwoarang/distfiles/${P}.tar.gz" |
447 |
+fi |
448 |
+ |
449 |
pkg_setup() { |
450 |
if ! use ssl && use gnutls ; then |
451 |
ewarn "USE='gnutls' is ignored without USE='ssl'." |
452 |
@@ -32,6 +46,16 @@ pkg_setup() { |
453 |
fi |
454 |
} |
455 |
|
456 |
+src_unpack() { |
457 |
+ if [[ ${PV} == *9999 ]] ; then |
458 |
+ git-r3_src_unpack |
459 |
+ else |
460 |
+ mkdir -p "${S}" || die "Can't create source directory" |
461 |
+ cd "${S}" || die |
462 |
+ unpack ${A} |
463 |
+ fi |
464 |
+} |
465 |
+ |
466 |
src_prepare() { |
467 |
# fix #571106 by restoring pre-GCC5 inline semantics |
468 |
append-cflags -std=gnu89 |
469 |
@@ -42,7 +66,7 @@ src_prepare() { |
470 |
-e 's:OPT:OPTS:' \ |
471 |
-e 's:CFLAGS=.*:& $(OPT):' librtmp/Makefile \ |
472 |
|| die "failed to fix Makefile" |
473 |
- eapply_user |
474 |
+ default |
475 |
multilib_copy_sources |
476 |
} |