diff --git a/spk/tvheadend/Makefile b/spk/tvheadend/Makefile index f00121ff2b1a..060210211bc6 100644 --- a/spk/tvheadend/Makefile +++ b/spk/tvheadend/Makefile @@ -4,7 +4,7 @@ SPK_GIT_HASH = c6bb43d SPK_GIT_DATE = 20211020 SPK_VERS = $(SPK_SHORT_VERS).$(SPK_GIT_DATE) TVH_VERS = $(SPK_SHORT_VERS)~$(SPK_GIT_HASH) -SPK_REV = 31 +SPK_REV = 30 SPK_ICON = src/tvheadend.png DSM_UI_DIR = app @@ -13,7 +13,9 @@ DSM_UI_DIR = app # 000-fix-version.patch from cross/tvheadend export TVH_VERS -SPK_DEPENDS = "python310" +SPK_DEPENDS = "python38" +WHEELS = src/requirements.txt + DEPENDS = cross/$(SPK_NAME) cross/zap2epg cross/dtv-scan-tables MAINTAINER = th0ma7 diff --git a/spk/tvheadend/src/requirements.txt b/spk/tvheadend/src/requirements.txt new file mode 100644 index 000000000000..84b557c9ea35 --- /dev/null +++ b/spk/tvheadend/src/requirements.txt @@ -0,0 +1,4 @@ +certifi==2021.5.30 +chardet==4.0.0 +requests==2.25.1 +urllib3==1.26.5 diff --git a/spk/tvheadend/src/service-setup.sh b/spk/tvheadend/src/service-setup.sh index f4d40490398d..78989220419e 100644 --- a/spk/tvheadend/src/service-setup.sh +++ b/spk/tvheadend/src/service-setup.sh @@ -2,9 +2,12 @@ # Sourced script by generic installer and start-stop-status scripts # Add ffmpeg and ifself to path -PYTHON_DIR="/var/packages/python310/target" +PYTHON_DIR="/var/packages/python38/target" +PYTHONENV="${SYNOPKG_PKGDEST}/env" +VIRTUALENV="${PYTHON_DIR}/bin/virtualenv" +WHEELHOUSE=${SYNOPKG_PKGDEST}/share/wheelhouse FFMPEG_DIR="/var/packages/ffmpeg/target" -PATH="${SYNOPKG_PKGDEST}/bin:${FFMPEG_DIR}/bin:${PYTHON_DIR}/bin:${PATH}" +PATH="${SYNOPKG_PKGDEST}/env/bin:${SYNOPKG_PKGDEST}/bin:${FFMPEG_DIR}/bin:${PYTHON_DIR}/bin:${PATH}" # Service configuration. Change http and htsp ports here and in conf/tvheadend.sc for non-standard ports HTTP=9981 @@ -19,6 +22,18 @@ SVC_BACKGROUND=yes # Group configuration to manage permissions of recording folders GROUP=sc-media +service_postinst () +{ + # EPG Grabber (zap2epg) - Create a Python virtualenv + ${VIRTUALENV} --system-site-packages ${PYTHONENV} + + # EPG Grabber (zap2epg) - Install the wheels/requirements + ${SYNOPKG_PKGDEST}/env/bin/pip install \ + --no-deps --no-index --no-input --upgrade \ + --force-reinstall --find-links \ + ${WHEELHOUSE} ${WHEELHOUSE}/*.whl +} + service_postupgrade () { # Need to enforce correct permissions for recording directories on upgrades