From patchwork Fri Dec 28 22:37:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 208605 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 22E462C009B for ; Sat, 29 Dec 2012 09:38:07 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 80DAFA0084; Fri, 28 Dec 2012 22:38:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w9WPs-X1Tjrs; Fri, 28 Dec 2012 22:38:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 3C52CA013F; Fri, 28 Dec 2012 22:38:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 7B8DF8F74B for ; Fri, 28 Dec 2012 22:38:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A70968459F for ; Fri, 28 Dec 2012 22:37:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Kj1YkXEYXeaO for ; Fri, 28 Dec 2012 22:37:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by whitealder.osuosl.org (Postfix) with ESMTPS id 2F3D48B271 for ; Fri, 28 Dec 2012 22:37:51 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id u54so5091301wey.41 for ; Fri, 28 Dec 2012 14:37:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references; bh=ShX/Uf31RkbeFEQ+4L250NM5EMUtowST/bK1aDHuafk=; b=gbL/GZbkErbq99rEcgl1g2SzmPr01WWDW3BAgLajKGtzm/41ySAJlzraYZwWXTIwDw MlbsPcO6MTOpL73ye9F8rz2y9tQnT8xoIj2lu41QODoVclD0/0Ql8nNa+qeja8SMMM1Z StkzlPbWRiBBE/NkrkbUJ9bBpOu6jB50goFj5ASSozfNYpRmXGfMA9YMCmtTRVy7qo/W s2JtrtT5m9T2qvRGs8Pm1I4sZ13AWMON20vAdxZ1RdYV0EjAv7Obs94/i/ATEJW3jKMx ATj194rX6EhSWmaZH5XObqBCGg4P/kE+nCDcpUYCUB89Ishrz0Kp2sythQ4hxT97pbVI Drkg== X-Received: by 10.180.75.208 with SMTP id e16mr54823988wiw.3.1356734270401; Fri, 28 Dec 2012 14:37:50 -0800 (PST) Received: from localhost.localdomain (ARennes-256-1-131-98.w90-32.abo.wanadoo.fr. [90.32.242.98]) by mx.google.com with ESMTPS id eo10sm56926858wib.9.2012.12.28.14.37.48 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 28 Dec 2012 14:37:49 -0800 (PST) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Fri, 28 Dec 2012 23:37:43 +0100 Message-Id: <76cea3141407f250513c508ae19643f9fdf26e6c.1356734184.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: In-Reply-To: References: Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH 1/1] package/tvheadend: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Signed-off-by: "Yann E. MORIN" --- package/Config.in | 1 + package/tvheadend/Config.in | 19 ++++++ package/tvheadend/S99tvheadend | 54 ++++++++++++++++++ package/tvheadend/accesscontrol.1 | 13 ++++ package/tvheadend/etc.default.tvheadend | 7 ++ .../tvheadend-no-auto-download-dvbscans.patch | 60 ++++++++++++++++++++ package/tvheadend/tvheadend.mk | 43 ++++++++++++++ 7 files changed, 197 insertions(+), 0 deletions(-) create mode 100644 package/tvheadend/Config.in create mode 100644 package/tvheadend/S99tvheadend create mode 100644 package/tvheadend/accesscontrol.1 create mode 100644 package/tvheadend/etc.default.tvheadend create mode 100644 package/tvheadend/tvheadend-no-auto-download-dvbscans.patch create mode 100644 package/tvheadend/tvheadend.mk diff --git a/package/Config.in b/package/Config.in index 6c82bab..8cec873 100644 --- a/package/Config.in +++ b/package/Config.in @@ -683,6 +683,7 @@ source "package/tinyhttpd/Config.in" source "package/tn5250/Config.in" source "package/transmission/Config.in" source "package/ttcp/Config.in" +source "package/tvheadend/Config.in" source "package/udpcast/Config.in" source "package/ulogd/Config.in" source "package/ushare/Config.in" diff --git a/package/tvheadend/Config.in b/package/tvheadend/Config.in new file mode 100644 index 0000000..944e31e --- /dev/null +++ b/package/tvheadend/Config.in @@ -0,0 +1,19 @@ +comment "tvheadend requires a toolchain with LARGEFILE support" + depends on !BR2_LARGEFILE + +config BR2_PACKAGE_TVHEADEND + bool "tvheadend" + depends on BR2_LARGEFILE + select BR2_PACKAGE_OPENSSL + help + 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. + + https://www.lonelycoder.com/redmine/projects/tvheadend/ + + Note: + - a default user has been created to log in the web configuration + GUI: admin/admin; you can change it at your discretion at runtime. + - if you want Avahi support, you'll need to enable: + Avahi, D-Bus, libdaemon diff --git a/package/tvheadend/S99tvheadend b/package/tvheadend/S99tvheadend new file mode 100644 index 0000000..407b873 --- /dev/null +++ b/package/tvheadend/S99tvheadend @@ -0,0 +1,54 @@ +#! /bin/sh +# tvheadend startup script inspired by the Debian one in the package + +# Author: Yann E. MORIN + +PATH=/usr/sbin:/usr/bin:/sbin:/bin +NAME=tvheadend +DAEMON=/usr/bin/$NAME +PIDFILE=/var/run/$NAME.pid + +[ -f "${DAEMON}" -a -x "${DAEMON}" ] || exit 0 + +# Read configuration variable file if it is present +[ -r "/etc/default/${NAME}" ] && . "/etc/default/${NAME}" + +ARGS="-f" +[ -z "${TVH_USER}" ] || ARGS="${ARGS} -u ${TVH_USER}" +[ -z "${TVH_GROUP}" ] || ARGS="${ARGS} -g ${TVH_GROUP}" +[ -z "${TVH_ADAPTERS}" ] || ARGS="${ARGS} -a ${TVH_ADAPTERS}" +[ -z "${TVH_HTTP_PORT}" ] || ARGS="${ARGS} -w ${TVH_HTTP_PORT}" +[ -z "${TVH_HTSP_PORT}" ] || ARGS="${ARGS} -e ${TVH_HTSP_PORT}" +[ "${TVH_DEBUG}" = "1" ] && ARGS="${ARGS} -s" + +case "$1" in + start) + printf "Starting TVHeadend daemon: " + if start-stop-daemon -S -q -p ${PIDFILE} -m --exec "${DAEMON}" -- ${ARGS}; then + printf "OK\n" + else + printf "failed\n" + fi + ;; + stop) + printf "Stoping TVHeadend daemon: " + start-stop-daemon -K -q -p ${PIDFILE} -s TERM + sleep 2 + if start-stop-daemon -K -q -p ${PIDFILE} -t; then + printf "failed, killing: " + start-stop-daemon -K -q -p ${PIDFILE} -s KILL -o + fi + printf "OK\n" + ;; + restart|force-reload) + "${0}" stop + sleep 2 + "${0}" stop + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +: diff --git a/package/tvheadend/accesscontrol.1 b/package/tvheadend/accesscontrol.1 new file mode 100644 index 0000000..b920943 --- /dev/null +++ b/package/tvheadend/accesscontrol.1 @@ -0,0 +1,13 @@ +{ + "enabled": 1, + "username": "admin", + "password": "admin", + "comment": "TVHeadend admin user", + "prefix": "0.0.0.0/0", + "streaming": 1, + "dvr": 1, + "dvrallcfg": 1, + "webui": 1, + "admin": 1, + "id": "1" +} diff --git a/package/tvheadend/etc.default.tvheadend b/package/tvheadend/etc.default.tvheadend new file mode 100644 index 0000000..c769055 --- /dev/null +++ b/package/tvheadend/etc.default.tvheadend @@ -0,0 +1,7 @@ +# Once we have a real user, we'll use it +TVH_USER=root +TVH_GROUP=root +#TVH_ADAPTERS= +#TVH_HTTP_PORT=9981 +#TVH_HTSP_PORT=9982 +#TVH_DEBUG=1 diff --git a/package/tvheadend/tvheadend-no-auto-download-dvbscans.patch b/package/tvheadend/tvheadend-no-auto-download-dvbscans.patch new file mode 100644 index 0000000..50bc4b6 --- /dev/null +++ b/package/tvheadend/tvheadend-no-auto-download-dvbscans.patch @@ -0,0 +1,60 @@ +Do not download transponder data as part of the build + +If dvb-scan is enabled, tvheadend will download the transponders data +from the dvb-apps package. This does not play well with buildroot. + +Instead, we rely on the dvb-apps package to install those files, so +it is no longer needed to install those as part of tvheadend. + +Signed-off-by: "Yann E. MORIN" + +diff -durN tvheadend-v3.3.orig//configure tvheadend-v3.3/configure +--- tvheadend-v3.3.orig//configure 2012-09-25 15:32:31.000000000 +0200 ++++ tvheadend-v3.3/configure 2012-12-28 17:17:23.580253413 +0100 +@@ -96,13 +96,14 @@ + # + # DVB scan + # +-if enabled linuxdvb && enabled dvbscan; then +- if [ ! -d ${ROOTDIR}/data/dvb-scan ]; then +- echo -n "Fetching dvb-scan files... " +- ${ROOTDIR}/support/getmuxlist &> /dev/null || die "Failed to fetch dvb-scan files (use --disable-dvbscan to skip)" +- echo "done" +- fi +-fi ++# For buildroot, we already installed those files via the dvb-apps package ++#if enabled linuxdvb && enabled dvbscan; then ++# if [ ! -d ${ROOTDIR}/data/dvb-scan ]; then ++# echo -n "Fetching dvb-scan files... " ++# ${ROOTDIR}/support/getmuxlist &> /dev/null || die "Failed to fetch dvb-scan files (use --disable-dvbscan to skip)" ++# echo "done" ++# fi ++#fi + + # ########################################################################### + # Write config +diff -durN tvheadend-v3.3.orig//Makefile tvheadend-v3.3/Makefile +--- tvheadend-v3.3.orig//Makefile 2012-09-25 15:32:31.000000000 +0200 ++++ tvheadend-v3.3/Makefile 2012-12-28 17:17:47.573497346 +0100 +@@ -180,7 +180,7 @@ + SRCS-${CONFIG_BUNDLE} += bundle.c + BUNDLES-yes += docs/html docs/docresources src/webui/static + BUNDLES-yes += data/conf +-BUNDLES-${CONFIG_DVBSCAN} += data/dvb-scan ++#BUNDLES-${CONFIG_DVBSCAN} += data/dvb-scan + BUNDLES = $(BUNDLES-yes) + + # +diff -durN tvheadend-v3.3.orig//support/posix.mk tvheadend-v3.3/support/posix.mk +--- tvheadend-v3.3.orig//support/posix.mk 2012-09-25 15:32:31.000000000 +0200 ++++ tvheadend-v3.3/support/posix.mk 2012-12-28 17:19:28.903121722 +0100 +@@ -12,7 +12,8 @@ + mkdir -p ${DESTDIR}${datadir}/tvheadend/$$bundle ;\ + cp -r $$bundle/* ${DESTDIR}${datadir}/tvheadend/$$bundle ;\ + done +- ++ mkdir -p ${DESTDIR}${datadir}/tvheadend/data ++ ln -s /usr/share/dvb-apps/scan ${DESTDIR}${datadir}/tvheadend/data/dvb-scan + + uninstall: + rm -f ${DESTDIR}${bindir)/tvheadend diff --git a/package/tvheadend/tvheadend.mk b/package/tvheadend/tvheadend.mk new file mode 100644 index 0000000..5100781 --- /dev/null +++ b/package/tvheadend/tvheadend.mk @@ -0,0 +1,43 @@ +############################################################# +# +# tvheadend +# +############################################################## + +TVHEADEND_VERSION = v3.3 +TVHEADEND_SITE = http://github.com/tvheadend/tvheadend/tarball/$(TVHEADEND_VERSION) +TVHEADEND_LICENSE = GPLv3+ +TVHEADEND_LICENSE_FILES = LICENSE +TVHEADEND_DEPENDENCIES = host-pkgconf host-python openssl + +ifeq ($(BR2_PACKAGE_AVAHI),y) +TVHEADEND_DEPENDENCIES += avahi +endif + +#---------------------------------------------------------------------------- +# tvheadend is a little smuggler and thief! ;-) +# During the ./configure, it downloads some files from the dvb-apps +# package, so it has a list of pre-scanned tunner configurations. +# For buildroot, we add a patch that avoids doing that, but uses the +# scan files installed by the dvb-apps package +TVHEADEND_DEPENDENCIES += dvb-apps + +#---------------------------------------------------------------------------- +# To run tvheadend, we need: +# - a startup script, and its config file +# - a default DB with a tvheadend admin +define TVHEADEND_INSTALL_DB + $(INSTALL) -D package/tvheadend/accesscontrol.1 \ + $(TARGET_DIR)/root/.hts/tvheadend/accesscontrol/1 +endef +TVHEADEND_POST_INSTALL_TARGET_HOOKS = TVHEADEND_INSTALL_DB + +define TVHEADEND_INSTALL_INIT_SYSV + $(INSTALL) -D package/tvheadend/etc.default.tvheadend $(TARGET_DIR)/etc/default/tvheadend + $(INSTALL) -D package/tvheadend/S99tvheadend $(TARGET_DIR)/etc/init.d/S99tvheadend +endef + +#---------------------------------------------------------------------------- +# tvheadend is not an autotools-based package, but it is possible to +# call its ./configure script as if it were an autotools one. +$(eval $(autotools-package))