From 6076697cb2321ff744f2e323c001ad10297cd331 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Tue, 4 Dec 2012 16:20:54 +0000 Subject: [PATCH] multimedia/tvheadend: new package Tvheadend is a TV streaming server for Linux supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, IPTV, and Analog video (V4L) as input sources. Signed-off-by: Alexey I. Froloff Signed-off-by: Florian Fainelli SVN-Revision: 34486 --- multimedia/tvheadend/Config.in | 21 +++++ multimedia/tvheadend/Makefile | 78 +++++++++++++++++++ multimedia/tvheadend/files/tvheadend.init | 15 ++++ multimedia/tvheadend/files/tvheadend.upgrade | 1 + multimedia/tvheadend/patches/010-SHA1.patch | 16 ++++ multimedia/tvheadend/patches/020-Werror.patch | 30 +++++++ 6 files changed, 161 insertions(+) create mode 100644 multimedia/tvheadend/Config.in create mode 100644 multimedia/tvheadend/Makefile create mode 100644 multimedia/tvheadend/files/tvheadend.init create mode 100644 multimedia/tvheadend/files/tvheadend.upgrade create mode 100644 multimedia/tvheadend/patches/010-SHA1.patch create mode 100644 multimedia/tvheadend/patches/020-Werror.patch diff --git a/multimedia/tvheadend/Config.in b/multimedia/tvheadend/Config.in new file mode 100644 index 000000000..52c018fe6 --- /dev/null +++ b/multimedia/tvheadend/Config.in @@ -0,0 +1,21 @@ +config TVHEADEND_CWC_SUPPORT + bool "NewCamD support" + default n + +config TVHEADEND_V4L_SUPPORT + bool "Video4Linux v2 support" + default n + +config TVHEADEND_LINUXDVB_SUPPORT + bool "Linux DVB support" + default n + +config TVHEADEND_DVBSCAN_SUPPORT + bool "Fetch DVB-scan data" + depends TVHEADEND_LINUXDVB_SUPPORT + default TVHEADEND_LINUXDVB_SUPPORT + +config TVHEADEND_AVAHI_SUPPORT + bool "Avahi client support" + select PACKAGE_libavahi-client + default n diff --git a/multimedia/tvheadend/Makefile b/multimedia/tvheadend/Makefile new file mode 100644 index 000000000..4a5a059d1 --- /dev/null +++ b/multimedia/tvheadend/Makefile @@ -0,0 +1,78 @@ +# +# Copyright (C) 2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=tvheadend +PKG_VERSION:=3.2 +PKG_RELEASE:=0.1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/downloads/tvheadend/tvheadend/ +PKG_MD5SUM:=4f7faa75c4ea24942c5a12a77ebdcdf0 + +include $(INCLUDE_DIR)/package.mk + +define Package/tvheadend + SECTION:=multimedia + CATEGORY:=Multimedia + TITLE:=Tvheadend is a TV streaming server for Linux + DEPENDS:=+libopenssl +librt +zlib +TVHEADEND_AVAHI_SUPPORT:libavahi-client + URL:=http://www.lonelycoder.com/hts/tvheadend_overview.html +endef + +define Package/tvheadend/description + Tvheadend is a TV streaming server for Linux supporting DVB, ATSC, IPTV, + and Analog video (V4L) as input sources. + Can be used as a backend to Showtime, XBMC and various other clients. +endef + +define Package/tvheadend/config + menu "Configuration" + depends on PACKAGE_tvheadend + source "$(SOURCE)/Config.in" + endmenu +endef + +ifeq ($(CONFIG_TVHEADEND_CWC_SUPPORT),) + CONFIGURE_ARGS += --disable-cwc +endif + +ifeq ($(CONFIG_TVHEADEND_V4L_SUPPORT),) + CONFIGURE_ARGS += --disable-v4l +endif + +ifeq ($(CONFIG_TVHEADEND_LINUXDVB_SUPPORT),) + CONFIGURE_ARGS += --disable-linuxdvb +endif + +ifeq ($(CONFIG_TVHEADEND_DVBSCAN_SUPPORT),) + CONFIGURE_ARGS += --disable-dvbscan +endif + +ifeq ($(CONFIG_TVHEADEND_AVAHI_SUPPORT),) + CONFIGURE_ARGS += --disable-avahi +else + CONFIGURE_ARGS += --enable-avahi +endif + +CONFIGURE_ARGS += \ + --release \ + --enable-bundle + +define Package/tvheadend/install + $(INSTALL_DIR) $(1)/etc/tvheadend + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/tvheadend.init $(1)/etc/init.d/tvheadend + $(INSTALL_DIR) $(1)/lib/upgrade/keep.d + $(INSTALL_DATA) ./files/tvheadend.upgrade $(1)/lib/upgrade/keep.d/tvheadend + + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/build.linux/tvheadend $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,tvheadend)) diff --git a/multimedia/tvheadend/files/tvheadend.init b/multimedia/tvheadend/files/tvheadend.init new file mode 100644 index 000000000..45258a547 --- /dev/null +++ b/multimedia/tvheadend/files/tvheadend.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2012 OpenWrt.org +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +START=80 + +start() { + service_start /usr/bin/tvheadend -f -c /etc/tvheadend +} + +stop() { + service_stop /usr/bin/tvheadend +} diff --git a/multimedia/tvheadend/files/tvheadend.upgrade b/multimedia/tvheadend/files/tvheadend.upgrade new file mode 100644 index 000000000..87b2b5357 --- /dev/null +++ b/multimedia/tvheadend/files/tvheadend.upgrade @@ -0,0 +1 @@ +/etc/tvheadend diff --git a/multimedia/tvheadend/patches/010-SHA1.patch b/multimedia/tvheadend/patches/010-SHA1.patch new file mode 100644 index 000000000..dc51ec704 --- /dev/null +++ b/multimedia/tvheadend/patches/010-SHA1.patch @@ -0,0 +1,16 @@ +diff -urN tvheadend-3.2-orig/src/trap.c tvheadend-3.2/src/trap.c +--- tvheadend-3.2-orig/src/trap.c 2012-10-23 12:56:27.000000000 +0400 ++++ tvheadend-3.2/src/trap.c 2012-10-24 21:01:34.254818786 +0400 +@@ -243,9 +243,9 @@ + char *m = malloc(st.st_size); + if(m != NULL) { + if(read(fd, m, st.st_size) == st.st_size) { +- SHA_Init(&binsum); +- SHA_Update(&binsum, (void *)m, st.st_size); +- SHA_Final(digest, &binsum); ++ SHA1_Init(&binsum); ++ SHA1_Update(&binsum, (void *)m, st.st_size); ++ SHA1_Final(digest, &binsum); + } + free(m); + } diff --git a/multimedia/tvheadend/patches/020-Werror.patch b/multimedia/tvheadend/patches/020-Werror.patch new file mode 100644 index 000000000..56acfaced --- /dev/null +++ b/multimedia/tvheadend/patches/020-Werror.patch @@ -0,0 +1,30 @@ +diff -urN tvheadend-3.2-orig/src/trap.c tvheadend-3.2/src/trap.c +--- tvheadend-3.2-orig/src/trap.c 2012-10-24 21:01:34.254818786 +0400 ++++ tvheadend-3.2/src/trap.c 2012-10-24 21:05:09.122437531 +0400 +@@ -67,6 +67,7 @@ + /** + * + */ ++#if ENABLE_EXECINFO + static int + add2lineresolve(const char *binary, void *addr, char *buf0, size_t buflen) + { +@@ -126,6 +127,7 @@ + close(fd[0]); + return 0; + } ++#endif /* ENABLE_EXECINFO */ + + + +@@ -133,8 +135,8 @@ + traphandler(int sig, siginfo_t *si, void *UC) + { + ucontext_t *uc = UC; +- char buf[200]; + #if ENABLE_EXECINFO ++ char buf[200]; + static void *frames[MAXFRAMES]; + int nframes = backtrace(frames, MAXFRAMES); + Dl_info dli; +Binary files tvheadend-3.2-orig/src/.trap.c.swp and tvheadend-3.2/src/.trap.c.swp differ -- 2.30.2