1 ################################################################################
5 ################################################################################
7 TVHEADEND_VERSION = 14f03b8efbc40b840eda8e203a6002d6c3f24250
8 TVHEADEND_SITE = $(call github,tvheadend,tvheadend,$(TVHEADEND_VERSION))
9 TVHEADEND_LICENSE = GPLv3+
10 TVHEADEND_LICENSE_FILES = LICENSE.md
11 TVHEADEND_DEPENDENCIES = host-pkgconf $(if $(BR2_PACKAGE_PYTHON3),host-python3,host-python) openssl
13 ifeq ($(BR2_PACKAGE_AVAHI),y)
14 TVHEADEND_DEPENDENCIES += avahi
17 ifeq ($(BR2_PACKAGE_FFMPEG),y)
18 TVHEADEND_DEPENDENCIES += ffmpeg
19 TVHEADEND_CONF_OPTS += --enable-libav
21 TVHEADEND_CONF_OPTS += --disable-libav
24 ifeq ($(BR2_PACKAGE_LIBDVBCSA),y)
25 TVHEADEND_DEPENDENCIES += libdvbcsa
26 TVHEADEND_CONF_OPTS += --enable-dvbcsa
28 TVHEADEND_CONF_OPTS += --disable-dvbcsa
31 ifeq ($(BR2_PACKAGE_LIBICONV),y)
32 TVHEADEND_DEPENDENCIES += libiconv
35 TVHEADEND_CFLAGS = $(TARGET_CFLAGS)
36 ifeq ($(BR2_PACKAGE_LIBURIPARSER),y)
37 TVHEADEND_DEPENDENCIES += liburiparser
38 TVHEADEND_CFLAGS += $(if $(BR2_USE_WCHAR),,-DURI_NO_UNICODE)
41 TVHEADEND_DEPENDENCIES += dtv-scan-tables
43 # The tvheadend build system expects the transponder data to be present inside
44 # its source tree. To prevent a download initiated by the build system just
45 # copy the data files in the right place and add the corresponding stamp file.
46 define TVHEADEND_INSTALL_DTV_SCAN_TABLES
47 $(INSTALL) -d $(@D)/data/dvb-scan
48 cp -r $(TARGET_DIR)/usr/share/dvb/* $(@D)/data/dvb-scan/
49 touch $(@D)/data/dvb-scan/.stamp
51 TVHEADEND_PRE_CONFIGURE_HOOKS += TVHEADEND_INSTALL_DTV_SCAN_TABLES
53 define TVHEADEND_CONFIGURE_CMDS
55 $(TARGET_CONFIGURE_OPTS) \
56 $(TARGET_CONFIGURE_ARGS) \
57 CFLAGS="$(TVHEADEND_CFLAGS)" \
61 --cpu="$(BR2_GCC_TARGET_CPU)" \
62 --python="$(HOST_DIR)/usr/bin/python" \
65 --disable-libffmpeg_static \
66 $(TVHEADEND_CONF_OPTS) \
70 define TVHEADEND_BUILD_CMDS
74 define TVHEADEND_INSTALL_TARGET_CMDS
75 $(MAKE) -C $(@D) DESTDIR="$(TARGET_DIR)" install
78 # Remove documentation and source files that are not needed because we
79 # use the bundled web interface version.
80 define TVHEADEND_CLEAN_SHARE
81 rm -rf $(TARGET_DIR)/usr/share/tvheadend/docs
82 rm -rf $(TARGET_DIR)/usr/share/tvheadend/src
85 TVHEADEND_POST_INSTALL_TARGET_HOOKS += TVHEADEND_CLEAN_SHARE
87 #----------------------------------------------------------------------------
88 # To run tvheadend, we need:
89 # - a startup script, and its config file
90 # - a default DB with a tvheadend admin
91 # - a non-root user to run as
92 define TVHEADEND_INSTALL_DB
93 $(INSTALL) -D -m 0600 package/tvheadend/accesscontrol.1 \
94 $(TARGET_DIR)/home/tvheadend/.hts/tvheadend/accesscontrol/1
95 chmod -R go-rwx $(TARGET_DIR)/home/tvheadend
97 TVHEADEND_POST_INSTALL_TARGET_HOOKS += TVHEADEND_INSTALL_DB
99 define TVHEADEND_INSTALL_INIT_SYSV
100 $(INSTALL) -D package/tvheadend/etc.default.tvheadend $(TARGET_DIR)/etc/default/tvheadend
101 $(INSTALL) -D package/tvheadend/S99tvheadend $(TARGET_DIR)/etc/init.d/S99tvheadend
104 define TVHEADEND_USERS
105 tvheadend -1 tvheadend -1 * /home/tvheadend - video TVHeadend daemon
108 $(eval $(generic-package))