docker-engine: new package
[buildroot-gz.git] / package / tvheadend / tvheadend.mk
blob516cbd32c9abb44d9320eaef2d1cc37aac96e66c
1 ################################################################################
3 # tvheadend
5 ################################################################################
7 TVHEADEND_VERSION = 8e637f9f903f6d820f701a1461b144e67665c6fa
8 TVHEADEND_SITE = $(call github,tvheadend,tvheadend,$(TVHEADEND_VERSION))
9 TVHEADEND_LICENSE = GPLv3+
10 TVHEADEND_LICENSE_FILES = LICENSE.md
11 TVHEADEND_DEPENDENCIES = \
12 host-gettext \
13 host-pkgconf \
14 $(if $(BR2_PACKAGE_PYTHON3),host-python3,host-python) \
15 openssl
17 ifeq ($(BR2_PACKAGE_AVAHI),y)
18 TVHEADEND_DEPENDENCIES += avahi
19 endif
21 ifeq ($(BR2_PACKAGE_DBUS),y)
22 TVHEADEND_DEPENDENCIES += dbus
23 TVHEADEND_CONF_OPTS += --enable-dbus-1
24 else
25 TVHEADEND_CONF_OPTS += --disable-dbus-1
26 endif
28 ifeq ($(BR2_PACKAGE_FFMPEG),y)
29 TVHEADEND_DEPENDENCIES += ffmpeg
30 TVHEADEND_CONF_OPTS += --enable-libav
31 else
32 TVHEADEND_CONF_OPTS += --disable-libav
33 endif
35 ifeq ($(BR2_PACKAGE_LIBDVBCSA),y)
36 TVHEADEND_DEPENDENCIES += libdvbcsa
37 TVHEADEND_CONF_OPTS += --enable-dvbcsa
38 else
39 TVHEADEND_CONF_OPTS += --disable-dvbcsa
40 endif
42 ifeq ($(BR2_PACKAGE_LIBHDHOMERUN),y)
43 TVHEADEND_DEPENDENCIES += libhdhomerun
44 TVHEADEND_CONF_OPTS += --enable-hdhomerun_client
45 else
46 TVHEADEND_CONF_OPTS += --disable-hdhomerun_client
47 endif
49 ifeq ($(BR2_PACKAGE_LIBICONV),y)
50 TVHEADEND_DEPENDENCIES += libiconv
51 endif
53 TVHEADEND_CFLAGS = $(TARGET_CFLAGS)
54 ifeq ($(BR2_PACKAGE_LIBURIPARSER),y)
55 TVHEADEND_DEPENDENCIES += liburiparser
56 TVHEADEND_CFLAGS += $(if $(BR2_USE_WCHAR),,-DURI_NO_UNICODE)
57 endif
59 TVHEADEND_DEPENDENCIES += dtv-scan-tables
61 # The tvheadend build system expects the transponder data to be present inside
62 # its source tree. To prevent a download initiated by the build system just
63 # copy the data files in the right place and add the corresponding stamp file.
64 define TVHEADEND_INSTALL_DTV_SCAN_TABLES
65 $(INSTALL) -d $(@D)/data/dvb-scan
66 cp -r $(TARGET_DIR)/usr/share/dvb/* $(@D)/data/dvb-scan/
67 touch $(@D)/data/dvb-scan/.stamp
68 endef
69 TVHEADEND_PRE_CONFIGURE_HOOKS += TVHEADEND_INSTALL_DTV_SCAN_TABLES
71 define TVHEADEND_CONFIGURE_CMDS
72 (cd $(@D); \
73 $(TARGET_CONFIGURE_OPTS) \
74 $(TARGET_CONFIGURE_ARGS) \
75 CFLAGS="$(TVHEADEND_CFLAGS)" \
76 ./configure \
77 --prefix=/usr \
78 --arch="$(ARCH)" \
79 --cpu="$(BR2_GCC_TARGET_CPU)" \
80 --nowerror \
81 --python="$(HOST_DIR)/usr/bin/python" \
82 --enable-dvbscan \
83 --enable-bundle \
84 --disable-ffmpeg_static \
85 --disable-hdhomerun_static \
86 $(TVHEADEND_CONF_OPTS) \
88 endef
90 define TVHEADEND_BUILD_CMDS
91 $(MAKE) -C $(@D)
92 endef
94 define TVHEADEND_INSTALL_TARGET_CMDS
95 $(MAKE) -C $(@D) DESTDIR="$(TARGET_DIR)" install
96 endef
98 # Remove documentation and source files that are not needed because we
99 # use the bundled web interface version.
100 define TVHEADEND_CLEAN_SHARE
101 rm -rf $(TARGET_DIR)/usr/share/tvheadend/docs
102 rm -rf $(TARGET_DIR)/usr/share/tvheadend/src
103 endef
105 TVHEADEND_POST_INSTALL_TARGET_HOOKS += TVHEADEND_CLEAN_SHARE
107 #----------------------------------------------------------------------------
108 # To run tvheadend, we need:
109 # - a startup script, and its config file
110 # - a non-root user to run as, and a home for it that is not accessible
111 # to the other users (because there will be crendentials in there)
113 define TVHEADEND_INSTALL_INIT_SYSV
114 $(INSTALL) -D package/tvheadend/etc.default.tvheadend $(TARGET_DIR)/etc/default/tvheadend
115 $(INSTALL) -D package/tvheadend/S99tvheadend $(TARGET_DIR)/etc/init.d/S99tvheadend
116 endef
118 define TVHEADEND_USERS
119 tvheadend -1 tvheadend -1 * /home/tvheadend - video TVHeadend daemon
120 endef
121 define TVHEADEND_PERMISSIONS
122 /home/tvheadend r 0700 tvheadend tvheadend - - - - -
123 endef
125 $(eval $(generic-package))