Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Jan 2016 15:55:23 +0000 (UTC)
From:      Thomas Zander <riggs@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r405166 - in head/multimedia/oscam: . files
Message-ID:  <201601031555.u03FtNhx050742@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: riggs
Date: Sun Jan  3 15:55:22 2016
New Revision: 405166
URL: https://svnweb.freebsd.org/changeset/ports/405166

Log:
  Add rc script, enable communication with multimedia/tvheadend
  
  PR:		205569
  Submitted by:	franz@bett.ag (maintainer)
  Reviewed by:	riggs
  Approved by:	franz@bett.ag (maintainer)

Added:
  head/multimedia/oscam/files/oscam.in   (contents, props changed)
  head/multimedia/oscam/files/patch-module-dvbapi.c   (contents, props changed)
Modified:
  head/multimedia/oscam/Makefile
  head/multimedia/oscam/files/patch-config.h   (contents, props changed)

Modified: head/multimedia/oscam/Makefile
==============================================================================
--- head/multimedia/oscam/Makefile	Sun Jan  3 15:21:12 2016	(r405165)
+++ head/multimedia/oscam/Makefile	Sun Jan  3 15:55:22 2016	(r405166)
@@ -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 dig
 LICENSE=	GPLv3
 
 USES=		gmake tar:bzip2
+USE_RC_SUBR=	oscam
 MAKE_ARGS+=	HOSTCC=clang CC=clang
 
 .if target(gen-dist)

Added: head/multimedia/oscam/files/oscam.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/oscam/files/oscam.in	Sun Jan  3 15:55:22 2016	(r405166)
@@ -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"

Modified: head/multimedia/oscam/files/patch-config.h
==============================================================================
--- head/multimedia/oscam/files/patch-config.h	Sun Jan  3 15:21:12 2016	(r405165)
+++ head/multimedia/oscam/files/patch-config.h	Sun Jan  3 15:55:22 2016	(r405166)
@@ -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

Added: head/multimedia/oscam/files/patch-module-dvbapi.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/oscam/files/patch-module-dvbapi.c	Sun Jan  3 15:55:22 2016	(r405166)
@@ -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
+ 	{



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601031555.u03FtNhx050742>