-config TVHEADEND_CWC_SUPPORT
- bool "NewCamd support"
- default y
+comment "Input & output support"
config TVHEADEND_LINUXDVB_SUPPORT
- bool "Linux DVB support"
+ bool "DVB tuners"
default y
+ help
+ Include support for DVB tuners.
+ Note: Kernel driver(s) and firmware must also be installed.
config TVHEADEND_DVBSCAN_SUPPORT
bool "Fetch DVB-scan data"
depends on TVHEADEND_LINUXDVB_SUPPORT
default TVHEADEND_LINUXDVB_SUPPORT
+ help
+ Download and include DVB scan tables.
+
+config TVHEADEND_IPTV
+ bool "IPTV client"
+ default y
+ help
+ Include IP-TV client.
+
+config TVHEADEND_SATIP_CLIENT
+ bool "SAT>IP client"
+ default y
+ help
+ Include SAT>IP client. This allows tvheadend to receive streams from a SAT>IP server.
+ SAT>IP is a client-server communication protocol in which SAT>IP servers,
+ connected to one or more DVB broadcast sources, send the program requested
+ by an SAT>IP client over an IP based network.
+ The main difference of SAT>IP to other IP-based TV distribution systems
+ such as IP-TV and DLNA is that the SAT>IP client does not select a program
+ from a server specific list, but has to specify the DVB reception parameters
+ such as the signal source, frequency, polarisation, modulation, PIDs and others.
+
+config TVHEADEND_SATIP_SERVER
+ bool "SAT>IP server"
+ default y
+ help
+ Include SAT>IP server. This allows tvheadend to stream to SAT>IP clients.
+ SAT>IP is a client-server communication protocol in which SAT>IP servers,
+ connected to one or more DVB broadcast sources, send the program requested
+ by an SAT>IP client over an IP based network.
+ The main difference of SAT>IP to other IP-based TV distribution systems
+ such as IP-TV and DLNA is that the SAT>IP client does not select a program
+ from a server specific list, but has to specify the DVB reception parameters
+ such as the signal source, frequency, polarisation, modulation, PIDs and others.
+
+config TVHEADEND_HDHOMERUN_CLIENT
+ bool "HDHomeRun client"
+ default y
+ help
+ Include HDHomeRun client.
+ HDHomeRun is a network-attached, digital television tuner box.
+
+comment "SoftCAM (Software Conditional Access Module)"
+
+config TVHEADEND_CWC_SUPPORT
+ bool "CWC newcamd"
+ default y
+ help
+ Support descrambling using Code Word Client newcamd protocol.
+
+config TVHEADEND_CAPMT_SUPPORT
+ bool "CWC capmnt"
+ default y
+ help
+ Support descrambling using Code Word Client capmnt (Linux Network DVBAPI) protocol.
+
+config TVHEADEND_CONSTCW_SUPPORT
+ bool "CCW"
+ default y
+ help
+ Support descrambling using Constant Code Word.
+
+comment "Other options"
config TVHEADEND_AVAHI_SUPPORT
- bool "Avahi client support"
+ bool "Avahi client"
select PACKAGE_libavahi-client
default n
+ help
+ Enables the opensource implementation of Apple's zero configuration protocol.
+ Tvheadend will advertise itself on the network using this protocol.
+
+config TVHEADEND_IMAGECACHE
+ bool "Image cache"
+ default n
+ help
+ Support caching TV station logos and other images on disk.
+ Note: Activating disk cache will increase fash memory wear.
+ Selecting this option does not automatically enable disk caching. It only includes support for it.
+
+config TVHEADEND_TRACE
+ bool "Low level debug trace"
+ default n
+ help
+ Support low level debug trace for tvheadend subsystems.
+ For a list of available subsystems, run "tvheadend --subsystems" in OpenWRT console.
+ Note: Selecting this option does not automatically enable trace logging.
+ It only includes support for --trace command line option and GUI.
CATEGORY:=Multimedia
TITLE:=Tvheadend is a TV streaming server for Linux
DEPENDS:=+libopenssl +librt +zlib +libffi +TVHEADEND_AVAHI_SUPPORT:libavahi-client $(ICONV_DEPENDS)
+ USERID:=tvheadend:dvb
URL:=https://tvheadend.org
MAINTAINER:=Marius Dinu <m95d+git@psihoexpert.ro>
endef
endmenu
endef
-ifeq ($(CONFIG_TVHEADEND_CWC_SUPPORT),)
- CONFIGURE_ARGS += --disable-cwc
+# Generic build options
+ifneq ($(CONFIG_PKG_ASLR_PIE_NONE),)
+ CONFIGURE_ARGS += --disable-pie
endif
+# TV sources
ifeq ($(CONFIG_TVHEADEND_LINUXDVB_SUPPORT),)
CONFIGURE_ARGS += --disable-linuxdvb
endif
CONFIGURE_ARGS += --disable-dvbscan
endif
+ifeq ($(CONFIG_TVHEADEND_IPTV),)
+ CONFIGURE_ARGS += --disable-iptv
+endif
+
+ifeq ($(CONFIG_TVHEADEND_SATIP_SERVER),)
+ CONFIGURE_ARGS += --disable-satip_server
+endif
+
+ifeq ($(CONFIG_TVHEADEND_SATIP_CLIENT),)
+ CONFIGURE_ARGS += --disable-satip_client
+endif
+
+ifeq ($(CONFIG_TVHEADEND_HDHOMERUN_CLIENT),)
+ CONFIGURE_ARGS += --disable-hdhomerun_static
+else
+ CONFIGURE_ARGS += --enable-hdhomerun_client
+endif
+
+# Descrambling
+ifeq ($(CONFIG_TVHEADEND_CWC_SUPPORT),)
+ CONFIGURE_ARGS += --disable-cwc
+endif
+
+ifeq ($(CONFIG_TVHEADEND_CAPMT_SUPPORT),)
+ CONFIGURE_ARGS += --disable-capmt
+endif
+
+ifeq ($(CONFIG_TVHEADEND_CCW_SUPPORT),)
+ CONFIGURE_ARGS += --disable-constcw
+endif
+
+# Other options
ifeq ($(CONFIG_TVHEADEND_AVAHI_SUPPORT),)
CONFIGURE_ARGS += --disable-avahi
else
CONFIGURE_ARGS += --enable-avahi
endif
+ifeq ($(CONFIG_TVHEADEND_IMAGECACHE),)
+ CONFIGURE_ARGS += --disable-imagecache
+else
+ CONFIGURE_ARGS += --enable-imagecache
+endif
+
+ifeq ($(CONFIG_TVHEADEND_TRACE),)
+ CONFIGURE_ARGS += --disable-trace
+endif
+
+# libav and ffmpeg are broken, so remove codecs too.
CONFIGURE_ARGS += \
--arch=$(ARCH) \
--disable-dbus_1 \
--disable-libav \
--disable-ffmpeg_static \
+ --disable-libx264 \
+ --disable-libx264_static \
+ --disable-libx265 \
+ --disable-libx265_static \
+ --disable-libvpx \
+ --disable-libvpx_static \
+ --disable-libtheora \
+ --disable-libtheora_static \
+ --disable-libvorbis \
+ --disable-libvorbis_static \
+ --disable-libfdkaac \
+ --disable-libfdkaac_static \
--enable-bundle \
--nowerror=unused-variable
$(INSTALL_BIN) ./files/tvheadend.init $(1)/etc/init.d/tvheadend
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/tvheadend.config $(1)/etc/config/tvheadend
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
+ $(INSTALL_BIN) ./files/dvb.hotplug $(1)/etc/hotplug.d/usb/50-dvb
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/build.linux/tvheadend $(1)/usr/bin/
--- /dev/null
+#!/bin/sh
+case "$ACTION" in
+ add)
+ chown -R root:dvb /dev/dvb/*/*
+ chmod -R 660 /dev/dvb/*/*
+ ;;
+esac
TEMP_CONFIG=/tmp/tvheadend
PERSISTENT_CONFIG=/etc/tvheadend
+# If you change the user, update the owner of tvheadend configuration directory and files!
+# If you change the group, update USB hotplug script for DVB devices in /dev/hotplug.d/usb/
+# otherwise, tvheadend won't have permissions to open newly connected tuners!
+# Also update all other packages that use the dvb group.
+TVH_USER=tvheadend
+TVH_GROUP=dvb
+
+
execute_first_run() {
- "$PROG" -c "$1" -B -C -A >/dev/null 2>&1
+ mkdir -p "$1"
+ chown -R $TVH_USER "$1"
+ # This should create a new configuration including an admin account with no name and no password,
+ # but it aborts (-A) without saving it:
+ #"$PROG" -c "$1" -B -C -A -u $TVH_USER -g $TVH_GROUP >/dev/null 2>&1
+ # Instead, run it for 10s then kill it:
+ "$PROG" -c "$1" -B -C -u $TVH_USER -g $TVH_GROUP & TVH_PID=$! ; sleep 10 ; kill $TVH_PID ; sleep 2
}
ensure_config_exists() {
ensure_config_exists
procd_open_instance
procd_set_param file /etc/config/tvheadend
- procd_set_param command "$PROG" -B
+ chown -R root:$TVH_GROUP /dev/dvb/*/*
+ procd_set_param command "$PROG" -B -u $TVH_USER -g $TVH_GROUP
load_uci_config
procd_close_instance
}