[packages/libjingle] - updated URL and dependencies - added srtp2 patch (use libsrtp2, replaces system-srtp patch) - adde
qboosh
qboosh at pld-linux.org
Wed Mar 3 21:50:51 CET 2021
commit 8c16c8a2cace7570164bff9c2867ea70a8a4d9dd
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Mar 3 21:51:34 2021 +0100
- updated URL and dependencies
- added srtp2 patch (use libsrtp2, replaces system-srtp patch)
- added sysmacros patch (add <sys/sysmacros.h> for major/minor macros)
- added openssl-1.1 patch from Fedora
libjingle-openssl-1.1.patch | 247 ++++++++++++++++++++++++++++++++++++++++++++
libjingle-srtp2.patch | 69 +++++++++++++
libjingle-sysmacros.patch | 10 ++
libjingle.spec | 28 ++---
system-srtp.patch | 12 ---
5 files changed, 341 insertions(+), 25 deletions(-)
---
diff --git a/libjingle.spec b/libjingle.spec
index 0a3c5f4..3ede974 100644
--- a/libjingle.spec
+++ b/libjingle.spec
@@ -5,10 +5,10 @@ Name: libjingle
Version: 0.6.14
Release: 6
License: BSD
-Group: Applications
+Group: Applications/Communication
+#Source0Download: http://code.google.com/p/libjingle/downloads/list
Source0: http://libjingle.googlecode.com/files/%{name}-%{version}.zip
# Source0-md5: b3906436df810620ced9ea7ec300799d
-URL: http://code.google.com/p/libjingle/
# fedora patches
# fedora loves to keep patch for every libjingle version, like they're not using VCS
# awk -vf=~/fc/libjingle '/^Patch/{s=d=$NF;sub(/libjingle-[0-9]+\.[0-9]+\.[0-9]+-/, "", d); printf("cp %s/%s %s\n", f, s, d)}' ~/fc/libjingle/libjingle.spec | sh
@@ -20,7 +20,6 @@ Patch4: uint32-fix.patch
Patch5: timefix.patch
Patch6: unixfilesystemfix.patch
Patch7: system-expat.patch
-Patch8: system-srtp.patch
Patch9: devicemanager-fix.patch
Patch10: v4llookup-fix.patch
Patch11: fixconflict.patch
@@ -28,25 +27,26 @@ Patch14: config-linux.patch
Patch16: compilefix.patch
Patch17: size_t.patch
Patch18: fixmacro.patch
+Patch19: %{name}-srtp2.patch
Patch20: unistd.patch
+Patch21: %{name}-sysmacros.patch
+Patch22: %{name}-openssl-1.1.patch
# /fedora patches
Patch100: bashism.patch
Patch101: time-timeutils.patch
+URL: https://developers.google.com/talk/libjingle/developer_guide
BuildRequires: alsa-lib-devel
-BuildRequires: autoconf
+BuildRequires: autoconf >= 2.50
BuildRequires: automake
-BuildRequires: expat-devel
-BuildRequires: glib-devel
-BuildRequires: gtk+2-devel
+BuildRequires: expat-devel >= 1.95
+BuildRequires: gtk+2-devel >= 2.0
BuildRequires: webrtc-libilbc-devel
+BuildRequires: libsrtp2-devel >= 2.0
BuildRequires: libstdc++-devel
BuildRequires: libtool
BuildRequires: openssl-devel >= 0.9.7g
-BuildRequires: ortp-devel
BuildRequires: pkgconfig
BuildRequires: rpmbuild(macros) >= 1.583
-BuildRequires: speex-devel
-BuildRequires: srtp-devel >= 1.4.4
BuildRequires: udev-devel
BuildRequires: unzip
BuildRequires: xorg-lib-libXcomposite-devel
@@ -88,10 +88,10 @@ Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libjingle
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: expat-devel
-Requires: gtk+2-devel
+Requires: gtk+2-devel >= 2.0
+Requires: libsrtp2-devel
Requires: libstdc++-devel
Requires: openssl-devel >= 0.9.7g
-Requires: srtp-devel
Requires: xorg-lib-libXrender-devel
%description devel
@@ -111,7 +111,6 @@ Pliki nagłówkowe potrzebne do programowania z użyciem libjingle.
%patch5 -p1
%patch6 -p1
%patch7 -p1
-%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
@@ -119,7 +118,10 @@ Pliki nagłówkowe potrzebne do programowania z użyciem libjingle.
%patch16 -p1
%patch17 -p1
%patch18 -p1
+%patch19 -p1
%patch20 -p1
+%patch21 -p1
+%patch22 -p1
%patch100 -p1
%patch101 -p1
diff --git a/libjingle-openssl-1.1.patch b/libjingle-openssl-1.1.patch
new file mode 100644
index 0000000..d470bbc
--- /dev/null
+++ b/libjingle-openssl-1.1.patch
@@ -0,0 +1,247 @@
+diff -up libjingle-0.6.14/talk/base/openssladapter.cc.openssl11 libjingle-0.6.14/talk/base/openssladapter.cc
+--- libjingle-0.6.14/talk/base/openssladapter.cc.openssl11 2017-02-20 15:00:27.678103635 -0500
++++ libjingle-0.6.14/talk/base/openssladapter.cc 2017-02-20 15:57:36.884341533 -0500
+@@ -84,6 +84,7 @@ static long socket_ctrl(BIO* h, int cmd,
+ static int socket_new(BIO* h);
+ static int socket_free(BIO* data);
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ static BIO_METHOD methods_socket = {
+ BIO_TYPE_BIO,
+ "socket",
+@@ -98,16 +99,36 @@ static BIO_METHOD methods_socket = {
+ };
+
+ BIO_METHOD* BIO_s_socket2() { return(&methods_socket); }
++#else
++static BIO_METHOD *methods_socket = NULL;
++
++static const BIO_METHOD * BIO_s_socket2(void) {
++ if (methods_socket == NULL) {
++ methods_socket = BIO_meth_new (BIO_TYPE_BIO | BIO_get_new_index (), "socket");
++ if (methods_socket == NULL ||
++ BIO_meth_set_write (methods_socket, socket_write) ||
++ BIO_meth_set_read (methods_socket, socket_read) ||
++ BIO_meth_set_puts (methods_socket, socket_puts) ||
++ BIO_meth_set_gets (methods_socket, 0) ||
++ BIO_meth_set_ctrl (methods_socket, socket_ctrl) ||
++ BIO_meth_set_create (methods_socket, socket_new) ||
++ BIO_meth_set_destroy (methods_socket, socket_free))
++ return NULL;
++ }
++ return methods_socket;
++}
++#endif
+
+ BIO* BIO_new_socket(talk_base::AsyncSocket* socket) {
+ BIO* ret = BIO_new(BIO_s_socket2());
+ if (ret == NULL) {
+ return NULL;
+ }
+- ret->ptr = socket;
++ BIO_set_data(ret, socket);
+ return ret;
+ }
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ static int socket_new(BIO* b) {
+ b->shutdown = 0;
+ b->init = 1;
+@@ -115,6 +136,14 @@ static int socket_new(BIO* b) {
+ b->ptr = 0;
+ return 1;
+ }
++#else
++static int socket_new(BIO* b) {
++ BIO_set_shutdown(b, 0);
++ BIO_set_init(b, 1);
++ BIO_set_data(b, 0);
++ return 1;
++}
++#endif
+
+ static int socket_free(BIO* b) {
+ if (b == NULL)
+@@ -125,13 +154,11 @@ static int socket_free(BIO* b) {
+ static int socket_read(BIO* b, char* out, int outl) {
+ if (!out)
+ return -1;
+- talk_base::AsyncSocket* socket = static_cast<talk_base::AsyncSocket*>(b->ptr);
++ talk_base::AsyncSocket* socket = static_cast<talk_base::AsyncSocket*>(BIO_get_data(b));
+ BIO_clear_retry_flags(b);
+ int result = socket->Recv(out, outl);
+ if (result > 0) {
+ return result;
+- } else if (result == 0) {
+- b->num = 1;
+ } else if (socket->IsBlocking()) {
+ BIO_set_retry_read(b);
+ }
+@@ -141,7 +168,7 @@ static int socket_read(BIO* b, char* out
+ static int socket_write(BIO* b, const char* in, int inl) {
+ if (!in)
+ return -1;
+- talk_base::AsyncSocket* socket = static_cast<talk_base::AsyncSocket*>(b->ptr);
++ talk_base::AsyncSocket* socket = static_cast<talk_base::AsyncSocket*>(BIO_get_data(b));
+ BIO_clear_retry_flags(b);
+ int result = socket->Send(in, inl);
+ if (result > 0) {
+@@ -164,7 +191,6 @@ static long socket_ctrl(BIO* b, int cmd,
+ case BIO_CTRL_RESET:
+ return 0;
+ case BIO_CTRL_EOF:
+- return b->num;
+ case BIO_CTRL_WPENDING:
+ case BIO_CTRL_PENDING:
+ return 0;
+@@ -696,7 +722,9 @@ bool OpenSSLAdapter::VerifyServerName(SS
+ // We assign this to a local variable, instead of passing the address
+ // directly to ASN1_item_d2i.
+ // See http://readlist.com/lists/openssl.org/openssl-users/0/4761.html.
+- unsigned char* ext_value_data = extension->value->data;
++ ASN1_OCTET_STRING *extension_data = X509_EXTENSION_get_data(extension);
++ unsigned char* ext_value_data = extension_data->data;
++ long length = extension_data->length;
+
+ #if OPENSSL_VERSION_NUMBER >= 0x0090800fL
+ const unsigned char **ext_value_data_ptr =
+@@ -707,10 +735,10 @@ bool OpenSSLAdapter::VerifyServerName(SS
+
+ if (meth->it) {
+ ext_str = ASN1_item_d2i(NULL, ext_value_data_ptr,
+- extension->value->length,
++ length,
+ ASN1_ITEM_ptr(meth->it));
+ } else {
+- ext_str = meth->d2i(NULL, ext_value_data_ptr, extension->value->length);
++ ext_str = meth->d2i(NULL, ext_value_data_ptr, length);
+ }
+
+ STACK_OF(CONF_VALUE)* value = meth->i2v(meth, ext_str, NULL);
+diff -up libjingle-0.6.14/talk/base/opensslidentity.cc.openssl11 libjingle-0.6.14/talk/base/opensslidentity.cc
+--- libjingle-0.6.14/talk/base/opensslidentity.cc.openssl11 2017-02-20 15:58:26.642105790 -0500
++++ libjingle-0.6.14/talk/base/opensslidentity.cc 2017-02-20 16:04:05.130707597 -0500
+@@ -168,7 +168,12 @@ OpenSSLKeyPair::~OpenSSLKeyPair() {
+ }
+
+ void OpenSSLKeyPair::AddReference() {
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ CRYPTO_add(&pkey_->references, 1, CRYPTO_LOCK_EVP_PKEY);
++#else
++ EVP_PKEY_up_ref(pkey_);
++#endif
++
+ }
+
+ #ifdef _DEBUG
+@@ -314,7 +319,11 @@ std::string OpenSSLCertificate::ToPEMStr
+ }
+
+ void OpenSSLCertificate::AddReference() {
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ CRYPTO_add(&x509_->references, 1, CRYPTO_LOCK_X509);
++#else
++ X509_up_ref(x509_);
++#endif
+ }
+
+ OpenSSLIdentity* OpenSSLIdentity::Generate(const std::string& common_name) {
+diff -up libjingle-0.6.14/talk/base/opensslstreamadapter.cc.openssl11 libjingle-0.6.14/talk/base/opensslstreamadapter.cc
+--- libjingle-0.6.14/talk/base/opensslstreamadapter.cc.openssl11 2017-02-20 16:05:03.402259071 -0500
++++ libjingle-0.6.14/talk/base/opensslstreamadapter.cc 2017-02-20 16:12:45.682795913 -0500
+@@ -86,6 +86,7 @@ static long stream_ctrl(BIO* h, int cmd,
+ static int stream_new(BIO* h);
+ static int stream_free(BIO* data);
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ static BIO_METHOD methods_stream = {
+ BIO_TYPE_BIO,
+ "stream",
+@@ -100,17 +101,37 @@ static BIO_METHOD methods_stream = {
+ };
+
+ static BIO_METHOD* BIO_s_stream() { return(&methods_stream); }
++#else
++static BIO_METHOD *methods_stream = NULL;
++
++static const BIO_METHOD * BIO_s_stream(void) {
++ if (methods_stream == NULL) {
++ methods_stream = BIO_meth_new (BIO_TYPE_BIO | BIO_get_new_index (), "stream");
++ if (methods_stream == NULL ||
++ BIO_meth_set_write (methods_stream, stream_write) ||
++ BIO_meth_set_read (methods_stream, stream_read) ||
++ BIO_meth_set_puts (methods_stream, stream_puts) ||
++ BIO_meth_set_gets (methods_stream, 0) ||
++ BIO_meth_set_ctrl (methods_stream, stream_ctrl) ||
++ BIO_meth_set_create (methods_stream, stream_new) ||
++ BIO_meth_set_destroy (methods_stream, stream_free))
++ return NULL;
++ }
++ return methods_stream;
++}
++#endif
+
+ static BIO* BIO_new_stream(StreamInterface* stream) {
+ BIO* ret = BIO_new(BIO_s_stream());
+ if (ret == NULL)
+ return NULL;
+- ret->ptr = stream;
++ BIO_set_data(ret, stream);
+ return ret;
+ }
+
+ // bio methods return 1 (or at least non-zero) on success and 0 on failure.
+
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ static int stream_new(BIO* b) {
+ b->shutdown = 0;
+ b->init = 1;
+@@ -118,6 +139,14 @@ static int stream_new(BIO* b) {
+ b->ptr = 0;
+ return 1;
+ }
++#else
++static int stream_new(BIO* b) {
++ BIO_set_shutdown(b, 0);
++ BIO_set_init(b, 1);
++ BIO_set_data(b, 0);
++ return 1;
++}
++#endif
+
+ static int stream_free(BIO* b) {
+ if (b == NULL)
+@@ -128,15 +157,13 @@ static int stream_free(BIO* b) {
+ static int stream_read(BIO* b, char* out, int outl) {
+ if (!out)
+ return -1;
+- StreamInterface* stream = static_cast<StreamInterface*>(b->ptr);
++ StreamInterface* stream = static_cast<StreamInterface*>(BIO_get_data(b));
+ BIO_clear_retry_flags(b);
+ size_t read;
+ int error;
+ StreamResult result = stream->Read(out, outl, &read, &error);
+ if (result == SR_SUCCESS) {
+ return read;
+- } else if (result == SR_EOS) {
+- b->num = 1;
+ } else if (result == SR_BLOCK) {
+ BIO_set_retry_read(b);
+ }
+@@ -146,7 +173,7 @@ static int stream_read(BIO* b, char* out
+ static int stream_write(BIO* b, const char* in, int inl) {
+ if (!in)
+ return -1;
+- StreamInterface* stream = static_cast<StreamInterface*>(b->ptr);
++ StreamInterface* stream = static_cast<StreamInterface*>(BIO_get_data(b));
+ BIO_clear_retry_flags(b);
+ size_t written;
+ int error;
+@@ -171,7 +198,6 @@ static long stream_ctrl(BIO* b, int cmd,
+ case BIO_CTRL_RESET:
+ return 0;
+ case BIO_CTRL_EOF:
+- return b->num;
+ case BIO_CTRL_WPENDING:
+ case BIO_CTRL_PENDING:
+ return 0;
diff --git a/libjingle-srtp2.patch b/libjingle-srtp2.patch
new file mode 100644
index 0000000..47c6763
--- /dev/null
+++ b/libjingle-srtp2.patch
@@ -0,0 +1,69 @@
+--- libjingle-0.6.14/configure.ac.orig 2021-03-02 21:47:58.773423197 +0100
++++ libjingle-0.6.14/configure.ac 2021-03-02 22:12:18.325516125 +0100
+@@ -64,7 +64,10 @@
+ fi
+ fi
+
++PKG_CHECK_MODULES(LIBSRTP, libsrtp2 >= 2, [enable_srtp=yes
++AC_DEFINE([HAVE_SRTP2], [1], [SRTP is SRTP2])], [
+ PKG_CHECK_MODULES(LIBSRTP, libsrtp >= 1.4.4, enable_srtp=yes, enable_srtp=no)
++])
+ if test x$enable_srtp = xno ; then
+ HAVE_SRTP=no
+ else
+--- libjingle-0.6.14/talk/session/phone/srtpfilter.cc.orig 2012-02-28 16:22:42.000000000 +0100
++++ libjingle-0.6.14/talk/session/phone/srtpfilter.cc 2021-03-03 06:46:37.868335637 +0100
+@@ -26,6 +26,7 @@
+ */
+
+ #undef HAVE_CONFIG_H
++#include "config.h"
+
+ #include "talk/session/phone/srtpfilter.h"
+
+@@ -42,11 +43,18 @@
+ // #define SRTP_DEBUG
+
+ #ifdef HAVE_SRTP
+-#ifdef SRTP_RELATIVE_PATH
+-#include "srtp.h" // NOLINT
++#ifdef HAVE_SRTP2
++#include <srtp2/srtp.h>
++#define err_status_ok srtp_err_status_ok
++#define err_status_auth_fail srtp_err_status_auth_fail
++#define err_status_replay_fail srtp_err_status_replay_fail
++#define err_status_replay_old srtp_err_status_replay_old
++#define crypto_policy_set_aes_cm_128_hmac_sha1_32 srtp_crypto_policy_set_aes_cm_128_hmac_sha1_32
++#define crypto_policy_set_aes_cm_128_hmac_sha1_80 srtp_crypto_policy_set_aes_cm_128_hmac_sha1_80
++#define ssrc_type_t srtp_ssrc_type_t
+ #else
+-#include "third_party/libsrtp/include/srtp.h"
+-#endif // SRTP_RELATIVE_PATH
++#include <srtp.h>
++#endif // HAVE_SRTP2
+ #ifdef _DEBUG
+ extern "C" debug_module_t mod_srtp;
+ extern "C" debug_module_t mod_auth;
+--- libjingle-0.6.14/pkgconfig/jinglesessionphone.pc.in.orig 2021-03-02 22:14:51.918017377 +0100
++++ libjingle-0.6.14/pkgconfig/jinglesessionphone.pc.in 2021-03-02 22:31:17.589344203 +0100
+@@ -7,6 +7,6 @@
+ Description: Jingle Session Phone Library
+ Requires:
+ Version: @VERSION@
+-Libs: -L${libdir} -lpthread -ljinglesessionphone -lsrtp
++Libs: -L${libdir} -lpthread -ljinglesessionphone @LIBSRTP_LIBS@
+ Cflags: -I${includedir}/libjingle- at LIBJINGLE_MAJORMINOR@ -DPOSIX
+
+--- libjingle-0.6.14/talk/session/phone/srtpfilter.h.orig 2012-02-28 16:22:42.000000000 +0100
++++ libjingle-0.6.14/talk/session/phone/srtpfilter.h 2021-03-03 19:25:24.358364152 +0100
+@@ -41,8 +41,8 @@
+
+ // Forward declaration to avoid pulling in libsrtp headers here
+ struct srtp_event_data_t;
+-struct srtp_ctx_t;
+-typedef srtp_ctx_t* srtp_t;
++struct srtp_ctx_t_;
++typedef srtp_ctx_t_* srtp_t;
+ struct srtp_policy_t;
+
+ namespace cricket {
diff --git a/libjingle-sysmacros.patch b/libjingle-sysmacros.patch
new file mode 100644
index 0000000..7e65862
--- /dev/null
+++ b/libjingle-sysmacros.patch
@@ -0,0 +1,10 @@
+--- libjingle-0.6.14/talk/session/phone/v4llookup.cc.orig 2021-03-02 21:37:38.316784499 +0100
++++ libjingle-0.6.14/talk/session/phone/v4llookup.cc 2021-03-02 21:44:44.511142273 +0100
+@@ -15,6 +15,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <unistd.h>
+
+ #include <cstring>
diff --git a/system-srtp.patch b/system-srtp.patch
deleted file mode 100644
index 4274551..0000000
--- a/system-srtp.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up libjingle-0.5.8/talk/session/phone/srtpfilter.cc.system-srtp libjingle-0.5.8/talk/session/phone/srtpfilter.cc
---- libjingle-0.5.8/talk/session/phone/srtpfilter.cc.system-srtp 2011-07-25 11:56:10.950441446 -0400
-+++ libjingle-0.5.8/talk/session/phone/srtpfilter.cc 2011-07-25 11:56:21.599308183 -0400
-@@ -58,7 +58,7 @@
- #ifdef SRTP_RELATIVE_PATH
- #include "srtp.h" // NOLINT
- #else
--#include "third_party/libsrtp/include/srtp.h"
-+#include <srtp.h>
- #endif // SRTP_RELATIVE_PATH
- #ifdef _DEBUG
- extern "C" debug_module_t mod_srtp;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/libjingle.git/commitdiff/8c16c8a2cace7570164bff9c2867ea70a8a4d9dd
More information about the pld-cvs-commit
mailing list