Browse Source

improve packaging

master
parent
commit
fae1749ba7
  1. 63
      janus/janus.patch
  2. 7
      janus/janus.spec
  3. 4
      janus/janus.txt
  4. 2
      janus/rc.janus

63
janus/janus.patch

@ -1,6 +1,6 @@
Index: configure.ac
--- configure.ac.orig 2020-06-17 12:06:07.000000000 +0200
+++ configure.ac 2020-06-20 17:55:30.036970000 +0200
+++ configure.ac 2020-06-21 00:03:38.357251000 +0200
@@ -20,38 +20,14 @@
# Common CFLAGS
CFLAGS="$CFLAGS \
@ -55,13 +55,13 @@ Index: configure.ac
JANUS_VERSION=102
Index: janus.c
--- janus.c.orig 2020-06-17 12:06:07.000000000 +0200
+++ janus.c 2020-06-20 18:02:03.313604000 +0200
+++ janus.c 2020-06-21 00:03:38.357875000 +0200
@@ -327,7 +327,7 @@
g_snprintf(glib2_version, sizeof(glib2_version), "%d.%d.%d", glib_major_version, glib_minor_version, glib_micro_version);
json_object_set_new(deps, "glib2", json_string(glib2_version));
json_object_set_new(deps, "jansson", json_string(JANSSON_VERSION));
- json_object_set_new(deps, "libnice", json_string(libnice_version_string));
+ json_object_set_new(deps, "libnice", "0");
+ json_object_set_new(deps, "libnice", json_string("0"));
json_object_set_new(deps, "libsrtp", json_string(srtp_get_version_string()));
#ifdef HAVE_TURNRESTAPI
curl_version_info_data *curl_version = curl_version_info(CURLVERSION_NOW);
@ -91,7 +91,7 @@ Index: janus.c
int code = 0;
Index: plugins/janus_audiobridge.c
--- plugins/janus_audiobridge.c.orig 2020-06-17 12:06:07.000000000 +0200
+++ plugins/janus_audiobridge.c 2020-06-20 17:55:30.038252000 +0200
+++ plugins/janus_audiobridge.c 2020-06-21 00:03:38.358555000 +0200
@@ -809,7 +809,10 @@
#include <ogg/ogg.h>
#endif
@ -105,7 +105,7 @@ Index: plugins/janus_audiobridge.c
#include "../apierror.h"
Index: rtcp.h
--- rtcp.h.orig 2020-06-17 12:06:07.000000000 +0200
+++ rtcp.h 2020-06-20 17:55:30.038393000 +0200
+++ rtcp.h 2020-06-21 00:03:38.358699000 +0200
@@ -19,6 +19,8 @@
#include <arpa/inet.h>
#ifdef __MACH__
@ -117,7 +117,7 @@ Index: rtcp.h
#endif
Index: rtp.h
--- rtp.h.orig 2020-06-17 12:06:07.000000000 +0200
+++ rtp.h 2020-06-20 17:55:30.038518000 +0200
+++ rtp.h 2020-06-21 00:03:38.358819000 +0200
@@ -19,6 +19,8 @@
#define __BYTE_ORDER BYTE_ORDER
#define __BIG_ENDIAN BIG_ENDIAN
@ -129,7 +129,7 @@ Index: rtp.h
#endif
Index: text2pcap.c
--- text2pcap.c.orig 2020-06-17 12:06:07.000000000 +0200
+++ text2pcap.c 2020-06-20 17:55:30.038639000 +0200
+++ text2pcap.c 2020-06-21 00:03:38.358935000 +0200
@@ -41,6 +41,8 @@
#define __BYTE_ORDER BYTE_ORDER
#define __BIG_ENDIAN BIG_ENDIAN
@ -139,3 +139,52 @@ Index: text2pcap.c
#else
#include <endian.h>
#endif
Index: transports/janus_websockets.c
--- transports/janus_websockets.c.orig 2020-06-17 12:06:07.000000000 +0200
+++ transports/janus_websockets.c 2020-06-21 00:03:38.359141000 +0200
@@ -274,7 +274,7 @@
#if (LWS_LIBRARY_VERSION_MAJOR >= 4)
static lws_retry_bo_t pingpong = { 0 };
#endif
-
+struct in_addr addr;
/* Helper method to return the interface associated with a local IP address */
static char *janus_websockets_get_interface_name(const char *ip) {
struct ifaddrs *addrs = NULL, *iap = NULL;
@@ -553,13 +553,6 @@
/* Force single-thread server */
wscinfo.count_threads = 1;
- /* Create the base context */
- wsc = lws_create_context(&wscinfo);
- if(wsc == NULL) {
- JANUS_LOG(LOG_ERR, "Error creating libwebsockets context...\n");
- janus_config_destroy(config);
- return -1; /* No point in keeping the plugin loaded */
- }
/* Setup the Janus API WebSockets server(s) */
item = janus_config_get(config, config_general, janus_config_type_item, "ws");
@@ -580,12 +573,22 @@
item = janus_config_get(config, config_general, janus_config_type_item, "ws_ip");
if(item && item->value) {
ip = (char *)item->value;
+ if(inet_net_pton(AF_INET, ip, &addr, sizeof(addr))>0) {
+ wscinfo.options |= LWS_SERVER_OPTION_DISABLE_IPV6;
+ }
char *iface = janus_websockets_get_interface_name(ip);
if(iface == NULL) {
JANUS_LOG(LOG_WARN, "No interface associated with %s? Falling back to no interface...\n", ip);
}
ip = iface;
}
+ /* Create the base context */
+ wsc = lws_create_context(&wscinfo);
+ if(wsc == NULL) {
+ JANUS_LOG(LOG_ERR, "Error creating libwebsockets context...\n");
+ janus_config_destroy(config);
+ return -1; /* No point in keeping the plugin loaded */
+ }
/* Prepare context */
struct lws_context_creation_info info;
memset(&info, 0, sizeof info);

7
janus/janus.spec

@ -32,7 +32,7 @@ Class: EVAL
Group: Networking
License: GPL
Version: 0.10.2
Release: 20200620
Release: 20200621
# list of sources
Source0: https://github.com/meetecho/janus-gateway/archive/v%{version}.tar.gz
@ -74,10 +74,11 @@ PreReq: opus, vorbis-libs, curl, paho, usrsctp, sofia-sip
CXXFLAGS="%{l_cxxflags -O}" \
CPPFLAGS="%{l_cppflags}" \
LDFLAGS="%{l_ldflags}" \
LIBS="-lcurl -lssl -lcrypto" \
LIBS="-lnice -lcurl -lssl -lcrypto" \
%{l_bash} ./configure \
--prefix=%{l_prefix} \
--mandir=%{l_prefix}/man
--mandir=%{l_prefix}/man \
--disable-rabbitmq
# build program
%{l_make} %{l_mflags}

4
janus/janus.txt

@ -15,6 +15,10 @@ general: {
log_to_stdout = false
log_to_file = "@l_prefix@/var/janus/log/janus.log"
debug_level = 4
debug_timestamps = true
debug_colors = false
server_name = "Janus WebRTC Server"
token_auth = true
token_auth_secret = "janus"

2
janus/rc.janus

@ -31,7 +31,7 @@
%start -p 100 -u @l_rusr@
rcService janus enable yes || exit 0
rcService janus active yes && exit 0
@l_prefix@/bin/janus
@l_prefix@/bin/janus ${janus_flags}
%stop -p 900 -u @l_rusr@
rcService janus enable yes || exit 0

Loading…
Cancel
Save