open-plc-utils: new package
[buildroot-gz.git] / package / tvheadend / tvheadend.mk
blobd6b77daade859832bb4e20737ff871a2a83153c4
1 ################################################################################
3 # tvheadend
5 ################################################################################
7 TVHEADEND_VERSION = 7006b9fd88ce0cf54d59399df40fe4ee003c4180
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
15 endif
17 ifeq ($(BR2_PACKAGE_FFMPEG),y)
18 TVHEADEND_DEPENDENCIES += ffmpeg
19 TVHEADEND_CONF_OPTS += --enable-libav
20 else
21 TVHEADEND_CONF_OPTS += --disable-libav
22 endif
24 ifeq ($(BR2_PACKAGE_LIBDVBCSA),y)
25 TVHEADEND_DEPENDENCIES += libdvbcsa
26 TVHEADEND_CONF_OPTS += --enable-dvbcsa
27 else
28 TVHEADEND_CONF_OPTS += --disable-dvbcsa
29 endif
31 ifeq ($(BR2_PACKAGE_LIBICONV),y)
32 TVHEADEND_DEPENDENCIES += libiconv
33 endif
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)
39 endif
41 TVHEADEND_DEPENDENCIES += dtv-scan-tables
43 define TVHEADEND_CONFIGURE_CMDS
44 (cd $(@D); \
45 $(TARGET_CONFIGURE_OPTS) \
46 $(TARGET_CONFIGURE_ARGS) \
47 CFLAGS="$(TVHEADEND_CFLAGS)" \
48 ./configure \
49 --prefix=/usr \
50 --arch="$(ARCH)" \
51 --cpu="$(BR2_GCC_TARGET_CPU)" \
52 --python="$(HOST_DIR)/usr/bin/python" \
53 --enable-dvbscan \
54 --enable-bundle \
55 --disable-libffmpeg_static \
56 $(TVHEADEND_CONF_OPTS) \
58 endef
60 # The tvheadend build system expects the transponder data to be present inside
61 # its source tree. To prevent a downloaded initiated by the build system just
62 # copy the data files in the right place and add the corresponding stamp file.
63 define TVHEADEND_BUILD_CMDS
64 $(INSTALL) -d $(@D)/data/dvb-scan
65 cp -r $(TARGET_DIR)/usr/share/dvb/* $(@D)/data/dvb-scan/
66 touch $(@D)/data/dvb-scan/.stamp
67 $(MAKE) -C $(@D)
68 endef
70 define TVHEADEND_INSTALL_TARGET_CMDS
71 $(MAKE) -C $(@D) DESTDIR="$(TARGET_DIR)" install
72 endef
74 # Remove documentation and source files that are not needed because we
75 # use the bundled web interface version.
76 define TVHEADEND_CLEAN_SHARE
77 rm -rf $(TARGET_DIR)/usr/share/tvheadend/docs
78 rm -rf $(TARGET_DIR)/usr/share/tvheadend/src
79 endef
81 TVHEADEND_POST_INSTALL_TARGET_HOOKS += TVHEADEND_CLEAN_SHARE
83 #----------------------------------------------------------------------------
84 # To run tvheadend, we need:
85 # - a startup script, and its config file
86 # - a default DB with a tvheadend admin
87 # - a non-root user to run as
88 define TVHEADEND_INSTALL_DB
89 $(INSTALL) -D -m 0600 package/tvheadend/accesscontrol.1 \
90 $(TARGET_DIR)/home/tvheadend/.hts/tvheadend/accesscontrol/1
91 chmod -R go-rwx $(TARGET_DIR)/home/tvheadend
92 endef
93 TVHEADEND_POST_INSTALL_TARGET_HOOKS += TVHEADEND_INSTALL_DB
95 define TVHEADEND_INSTALL_INIT_SYSV
96 $(INSTALL) -D package/tvheadend/etc.default.tvheadend $(TARGET_DIR)/etc/default/tvheadend
97 $(INSTALL) -D package/tvheadend/S99tvheadend $(TARGET_DIR)/etc/init.d/S99tvheadend
98 endef
100 define TVHEADEND_USERS
101 tvheadend -1 tvheadend -1 * /home/tvheadend - video TVHeadend daemon
102 endef
104 $(eval $(generic-package))