diff options
-rw-r--r-- | multimedia/oscam/Makefile | 2 | ||||
-rw-r--r-- | multimedia/oscam/files/oscam.in | 46 | ||||
-rw-r--r-- | multimedia/oscam/files/patch-config.h | 17 | ||||
-rw-r--r-- | multimedia/oscam/files/patch-module-dvbapi.c | 48 |
4 files changed, 106 insertions, 7 deletions
diff --git a/multimedia/oscam/Makefile b/multimedia/oscam/Makefile index 5f8f060baff0..c26f02ecb3da 100644 --- a/multimedia/oscam/Makefile +++ b/multimedia/oscam/Makefile @@ -3,6 +3,7 @@ PORTNAME= oscam PORTVERSION= 1.20 +PORTREVISION= 1 CATEGORIES= multimedia MASTER_SITES= http://el8.nl/~fbettag/oscam/ @@ -12,6 +13,7 @@ COMMENT= Softcam software to decrypt digital tv channels LICENSE= GPLv3 USES= gmake tar:bzip2 +USE_RC_SUBR= oscam MAKE_ARGS+= HOSTCC=clang CC=clang .if target(gen-dist) diff --git a/multimedia/oscam/files/oscam.in b/multimedia/oscam/files/oscam.in new file mode 100644 index 000000000000..ceb99afc1d7b --- /dev/null +++ b/multimedia/oscam/files/oscam.in @@ -0,0 +1,46 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: oscam +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# Add the following line to /etc/rc.conf[.local] to enable oscam +# +# oscam_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable oscam. +# oscam_flags (str): Custom flags for oscam. + +. /etc/rc.subr + +name=oscam +rcvar=oscam_enable +load_rc_config $name + +: ${oscam_enable:=NO} + +pidfile="/var/run/${name}.pid" +confdir="/usr/local/etc/oscam" +logdir="/var/log/oscam" +command="/usr/local/bin/oscam" + +command_args="-b -B ${pidfile} -c ${confdir}" +start_precmd="${name}_prestart" + +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin + +oscam_prestart() +{ + if [ ! -f "${pidfile}" ]; then + /usr/bin/install -m 644 /dev/null ${pidfile} + fi + if [ ! -d "${confdir}" ]; then + /usr/bin/install -m 755 -d ${confdir} + fi + if [ ! -d "${logdir}" ]; then + /usr/bin/install -m 755 -d ${logdir} + fi +} + +run_rc_command "$1" diff --git a/multimedia/oscam/files/patch-config.h b/multimedia/oscam/files/patch-config.h index c1aa51b9e402..6fdb1d19b4ce 100644 --- a/multimedia/oscam/files/patch-config.h +++ b/multimedia/oscam/files/patch-config.h @@ -1,15 +1,18 @@ --- config.h.orig 2015-09-30 21:11:35 UTC +++ config.h -@@ -7,7 +7,7 @@ +@@ -5,10 +5,8 @@ + #define WEBIF_LIVELOG 1 + #define WEBIF_JQUERY 1 #define TOUCH 1 - //#define WITH_SSL 1 - #if defined(__linux__) || defined(__CYGWIN__) --#define HAVE_DVBAPI 1 -+//#define HAVE_DVBAPI 1 - #endif +-//#define WITH_SSL 1 +-#if defined(__linux__) || defined(__CYGWIN__) ++#define WITH_SSL 1 + #define HAVE_DVBAPI 1 +-#endif #define READ_SDT_CHARSETS 1 #define CLOCKFIX 1 -@@ -23,18 +23,18 @@ + #define IRDETO_GUESSING 1 +@@ -23,18 +21,18 @@ #define MODULE_MONITOR 1 //#define MODULE_CAMD33 1 diff --git a/multimedia/oscam/files/patch-module-dvbapi.c b/multimedia/oscam/files/patch-module-dvbapi.c new file mode 100644 index 000000000000..4a303cb7f1eb --- /dev/null +++ b/multimedia/oscam/files/patch-module-dvbapi.c @@ -0,0 +1,48 @@ +--- module-dvbapi.c.orig 2015-10-10 17:22:23 UTC ++++ module-dvbapi.c +@@ -3,7 +3,6 @@ + #include "globals.h" + + #ifdef HAVE_DVBAPI +- + #include "module-dvbapi.h" + #include "module-cacheex.h" + #include "module-dvbapi-azbox.h" +@@ -4290,6 +4289,7 @@ static void *dvbapi_main_local(void *cli + { + int32_t i, j; + struct s_client *client = (struct s_client *) cli; ++ const char pmt_server_socket[]="/tmp/.listen.camd.socket"; + client->thread = pthread_self(); + SAFE_SETSPECIFIC(getclient, cli); + +@@ -4298,11 +4298,9 @@ static void *dvbapi_main_local(void *cli + int32_t maxpfdsize = (MAX_DEMUX * maxfilter) + MAX_DEMUX + 2; + struct pollfd pfd2[maxpfdsize]; + struct timeb start, end; // start time poll, end time poll +-#define PMT_SERVER_SOCKET "/tmp/.listen.camd.socket" + struct sockaddr_un saddr; + saddr.sun_family = AF_UNIX; +- strncpy(saddr.sun_path, PMT_SERVER_SOCKET, 107); +- saddr.sun_path[107] = '\0'; ++ strncpy(saddr.sun_path, pmt_server_socket, sizeof(saddr.sun_path)/sizeof(saddr.sun_path[0])); + + int32_t rc, pfdcount, g, connfd, clilen; + int32_t ids[maxpfdsize], fdn[maxpfdsize], type[maxpfdsize]; +@@ -4366,13 +4364,15 @@ static void *dvbapi_main_local(void *cli + signal_action.sa_flags = SA_RESTART; + sigaction(SIGRTMIN + 1, &signal_action, NULL); + ++ /* + dir_fd = open(TMPDIR, O_RDONLY); + if(dir_fd >= 0) + { + fcntl(dir_fd, F_SETSIG, SIGRTMIN + 1); + fcntl(dir_fd, F_NOTIFY, DN_MODIFY | DN_CREATE | DN_DELETE | DN_MULTISHOT); + event_handler(SIGRTMIN + 1); +- } ++ }*/ ++ cs_log("Only PMT 4-6 supported on FreeBSD, sorry..."); + } + else + { |