The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / tvheadend / tvheadend.mk
1 ################################################################################
2 #
3 # tvheadend
4 #
5 ################################################################################
6
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
12
13 ifeq ($(BR2_PACKAGE_AVAHI),y)
14 TVHEADEND_DEPENDENCIES += avahi
15 endif
16
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
23
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
30
31 ifeq ($(BR2_PACKAGE_LIBICONV),y)
32 TVHEADEND_DEPENDENCIES += libiconv
33 endif
34
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
40
41 TVHEADEND_DEPENDENCIES += dtv-scan-tables
42
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
50 endef
51 TVHEADEND_PRE_CONFIGURE_HOOKS += TVHEADEND_INSTALL_DTV_SCAN_TABLES
52
53 define TVHEADEND_CONFIGURE_CMDS
54         (cd $(@D);                                              \
55                 $(TARGET_CONFIGURE_OPTS)                        \
56                 $(TARGET_CONFIGURE_ARGS)                        \
57                 CFLAGS="$(TVHEADEND_CFLAGS)"                    \
58                 ./configure                                     \
59                         --prefix=/usr                           \
60                         --arch="$(ARCH)"                        \
61                         --cpu="$(BR2_GCC_TARGET_CPU)"           \
62                         --python="$(HOST_DIR)/usr/bin/python"   \
63                         --enable-dvbscan                        \
64                         --enable-bundle                         \
65                         --disable-libffmpeg_static              \
66                         $(TVHEADEND_CONF_OPTS)                  \
67         )
68 endef
69
70 define TVHEADEND_BUILD_CMDS
71         $(MAKE) -C $(@D)
72 endef
73
74 define TVHEADEND_INSTALL_TARGET_CMDS
75         $(MAKE) -C $(@D) DESTDIR="$(TARGET_DIR)" install
76 endef
77
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
83 endef
84
85 TVHEADEND_POST_INSTALL_TARGET_HOOKS += TVHEADEND_CLEAN_SHARE
86
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
96 endef
97 TVHEADEND_POST_INSTALL_TARGET_HOOKS += TVHEADEND_INSTALL_DB
98
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
102 endef
103
104 define TVHEADEND_USERS
105         tvheadend -1 tvheadend -1 * /home/tvheadend - video TVHeadend daemon
106 endef
107
108 $(eval $(generic-package))