From a47cae3ce882a809024dabeb8a6aa585c642315f Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Mon, 14 Jun 2021 23:06:58 +0000 Subject: [PATCH 01/11] tvheadend-zap2epg: Add zap2epg with 'requests' python wheels --- cross/zap2epg/Makefile | 26 ++++++++++++++++++++++++++ cross/zap2epg/PLIST | 2 ++ cross/zap2epg/digests | 3 +++ spk/tvheadend/Makefile | 3 ++- 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 cross/zap2epg/Makefile create mode 100644 cross/zap2epg/PLIST create mode 100644 cross/zap2epg/digests diff --git a/cross/zap2epg/Makefile b/cross/zap2epg/Makefile new file mode 100644 index 00000000000..631101de04d --- /dev/null +++ b/cross/zap2epg/Makefile @@ -0,0 +1,26 @@ +PKG_NAME = zap2epg +PKG_VERS = 3.0 +PKG_EXT = tar.gz +#PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT) +PKG_DIST_NAME = Python3-th0ma7-updates.$(PKG_EXT) +PKG_DIST_SITE = https://github.com/daniel-widrick/zap2it-GuideScraping/archive +PKG_DIST_SITE = https://github.com/th0ma7/script.module.zap2epg/archive +PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) +PKG_DIR = script.module.zap2epg-Python3-th0ma7-updates + +DEPENDS = + +HOMEPAGE = https://github.com/edit4ever/script.module.zap2epg +COMMENT = zap2epg will generate an xmltv.xml file for USA/Canada TV lineups using zap2it source +LICENSE = GPLv3 + +INSTALL_TARGET = zap2it_install + +include ../../mk/spksrc.install-resources.mk + +.PHONY: zap2it_install +zap2it_install: + install -m 755 -d $(STAGING_INSTALL_PREFIX)/bin + install -m 755 $(WORK_DIR)/$(PKG_DIR)/tv_grab_zap2epg $(STAGING_INSTALL_PREFIX)/bin + install -m 750 -d $(STAGING_INSTALL_PREFIX)/var/epggrab/conf + install -m 640 $(WORK_DIR)/$(PKG_DIR)/epggrab/conf/zap2epg.xml $(STAGING_INSTALL_PREFIX)/var/epggrab/conf diff --git a/cross/zap2epg/PLIST b/cross/zap2epg/PLIST new file mode 100644 index 00000000000..ccdf24056fe --- /dev/null +++ b/cross/zap2epg/PLIST @@ -0,0 +1,2 @@ +bin:bin/zap2it-GuideScrape.py +rsc:etc/zap2itconfig.ini diff --git a/cross/zap2epg/digests b/cross/zap2epg/digests new file mode 100644 index 00000000000..1891d0740b2 --- /dev/null +++ b/cross/zap2epg/digests @@ -0,0 +1,3 @@ +zap2epg-3.0.tar.gz SHA1 6dbdef7a0459f151cfb06b043a5aa027af9c2011 +zap2epg-3.0.tar.gz SHA256 fefb724bcd8f460af50f56085a92db88ed839609f5c38b83e42fe8526aa5c7e7 +zap2epg-3.0.tar.gz MD5 a6a59af402b5b5fb6d5e60067a2e2b0a diff --git a/spk/tvheadend/Makefile b/spk/tvheadend/Makefile index cbc54e163e8..25a7932b39e 100644 --- a/spk/tvheadend/Makefile +++ b/spk/tvheadend/Makefile @@ -13,7 +13,8 @@ DSM_UI_DIR = app # 000-fix-version.patch from cross/tvheadend export TVH_VERS -DEPENDS = cross/$(SPK_NAME) +DEPENDS = cross/$(SPK_NAME) cross/zap2epg +WHEELS = requests MAINTAINER = th0ma7 DESCRIPTION = Tvheadend is a TV streaming server and recorder for Linux, FreeBSD and Android supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, ISDB-T, IPTV, SAT IP and HDHomeRun as input sources. Tvheadend offers HTTP, HTSP and SAT IP streaming. From be49ed405598dc5a905dbea6fbc5327b739fd526 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Mon, 14 Jun 2021 23:18:56 +0000 Subject: [PATCH 02/11] tvheadend: Add tvh bin path to discover and access TV grabbers --- spk/tvheadend/src/service-setup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spk/tvheadend/src/service-setup.sh b/spk/tvheadend/src/service-setup.sh index 32ce438c1a6..7ae58554fa2 100644 --- a/spk/tvheadend/src/service-setup.sh +++ b/spk/tvheadend/src/service-setup.sh @@ -1,6 +1,9 @@ # Package specific behaviors # Sourced script by generic installer and start-stop-status scripts +# Add ffmpeg and ifself to path +PATH="${SYNOPKG_PKGDEST}/bin:/var/packages/ffmpeg/target/bin:${PATH}" + # Service configuration. Change http and htsp ports here and in conf/tvheadend.sc for non-standard ports HTTP=9981 HTSP=9982 From bd32e1ed9b6e041b3d619815b209f5fb890c0d65 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Tue, 15 Jun 2021 02:06:27 +0000 Subject: [PATCH 03/11] zap2epg: Adjust PLIST entries --- cross/zap2epg/PLIST | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cross/zap2epg/PLIST b/cross/zap2epg/PLIST index ccdf24056fe..6e27d45e428 100644 --- a/cross/zap2epg/PLIST +++ b/cross/zap2epg/PLIST @@ -1,2 +1,2 @@ -bin:bin/zap2it-GuideScrape.py -rsc:etc/zap2itconfig.ini +rsc:bin/tv_grab_zap2epg +rsc:var/epggrab/conf/zap2epg.xml From c0ffbb7ae26976c826190e19f54e89fed18f258a Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Tue, 15 Jun 2021 02:06:48 +0000 Subject: [PATCH 04/11] tvheadend: Add python3 spk dependency --- spk/tvheadend/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/spk/tvheadend/Makefile b/spk/tvheadend/Makefile index 25a7932b39e..b55b5edb656 100644 --- a/spk/tvheadend/Makefile +++ b/spk/tvheadend/Makefile @@ -15,6 +15,7 @@ export TVH_VERS DEPENDS = cross/$(SPK_NAME) cross/zap2epg WHEELS = requests +SPK_DEPENDS = "python3>=3.7" MAINTAINER = th0ma7 DESCRIPTION = Tvheadend is a TV streaming server and recorder for Linux, FreeBSD and Android supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, ISDB-T, IPTV, SAT IP and HDHomeRun as input sources. Tvheadend offers HTTP, HTSP and SAT IP streaming. From 67e4fe7d0a3a6e90fb9ff5f4c2fdc44e63526db9 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 16 Jun 2021 12:05:24 +0000 Subject: [PATCH 05/11] tvheadend: Complete python wheels installation --- spk/tvheadend/Makefile | 2 +- spk/tvheadend/PLIST | 1 + spk/tvheadend/src/service-setup.sh | 19 ++++++++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/spk/tvheadend/Makefile b/spk/tvheadend/Makefile index b55b5edb656..8a062acbe95 100644 --- a/spk/tvheadend/Makefile +++ b/spk/tvheadend/Makefile @@ -14,7 +14,7 @@ DSM_UI_DIR = app export TVH_VERS DEPENDS = cross/$(SPK_NAME) cross/zap2epg -WHEELS = requests +WHEELS = certifi chardet requests urllib3 SPK_DEPENDS = "python3>=3.7" MAINTAINER = th0ma7 diff --git a/spk/tvheadend/PLIST b/spk/tvheadend/PLIST index e69de29bb2d..4cfaf73a12c 100644 --- a/spk/tvheadend/PLIST +++ b/spk/tvheadend/PLIST @@ -0,0 +1 @@ +rsc:share/wheelhouse diff --git a/spk/tvheadend/src/service-setup.sh b/spk/tvheadend/src/service-setup.sh index 7ae58554fa2..e4aea078e85 100644 --- a/spk/tvheadend/src/service-setup.sh +++ b/spk/tvheadend/src/service-setup.sh @@ -2,7 +2,12 @@ # Sourced script by generic installer and start-stop-status scripts # Add ffmpeg and ifself to path -PATH="${SYNOPKG_PKGDEST}/bin:/var/packages/ffmpeg/target/bin:${PATH}" +PYTHON_DIR="/var/packages/python38/target" +PYTHONENV="${SYNOPKG_PKGDEST}/env" +VIRTUALENV="${PYTHON_DIR}/bin/virtualenv" +WHEELHOUSE=${SYNOPKG_PKGDEST}/share/wheelhouse +FFMPEG_DIR="/usr/local/ffmpeg" +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 @@ -24,6 +29,18 @@ service_postinst () # Edit the password configuration according to the wizard sed -i -e "s/@password@/${wizard_password}/g" ${SYNOPKG_PKGVAR}/passwd/a927e30a755504f9784f23a4efac5109 + + # EPG Grabber (zap2epg) - Create a Python virtualenv + ${VIRTUALENV} --system-site-packages ${PYTHONENV} >> ${INST_LOG} + + # 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 >> ${INST_LOG} 2>&1 + + # EPG Grabber (zap2epg) - Adjust permissions + set_unix_permissions "${PYTHONENV}" } service_preupgrade () From a73583ec65867e7349bd60e0e829baff70be0a31 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Wed, 16 Jun 2021 12:05:45 +0000 Subject: [PATCH 06/11] tvheadend: Add new python TV helper now available with v4.3+ --- cross/tvheadend/PLIST | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cross/tvheadend/PLIST b/cross/tvheadend/PLIST index a9c77cf4632..7046f82398b 100644 --- a/cross/tvheadend/PLIST +++ b/cross/tvheadend/PLIST @@ -1,3 +1,6 @@ bin:bin/tvheadend +rsc:bin/tvhmeta +rsc:bin/tv_meta_tmdb.py +rsc:bin/tv_meta_tvdb.py rsc:share/tvheadend rsc:share/fontconfig From 928dc4f9ae0331e4b50685c95f7f9f9f1e8b9565 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 17 Jun 2021 06:34:37 -0400 Subject: [PATCH 07/11] Update spk/tvheadend/src/service-setup.sh Output now managed by installer log Co-authored-by: hgy59 --- spk/tvheadend/src/service-setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spk/tvheadend/src/service-setup.sh b/spk/tvheadend/src/service-setup.sh index e4aea078e85..ae16ef09047 100644 --- a/spk/tvheadend/src/service-setup.sh +++ b/spk/tvheadend/src/service-setup.sh @@ -31,13 +31,13 @@ service_postinst () sed -i -e "s/@password@/${wizard_password}/g" ${SYNOPKG_PKGVAR}/passwd/a927e30a755504f9784f23a4efac5109 # EPG Grabber (zap2epg) - Create a Python virtualenv - ${VIRTUALENV} --system-site-packages ${PYTHONENV} >> ${INST_LOG} + ${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 >> ${INST_LOG} 2>&1 + ${WHEELHOUSE} ${WHEELHOUSE}/*.whl # EPG Grabber (zap2epg) - Adjust permissions set_unix_permissions "${PYTHONENV}" From 7a375760b32fb5f15bc038b77971e51b0ebecb81 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 17 Jun 2021 07:03:15 -0400 Subject: [PATCH 08/11] Specify using python38 Co-authored-by: hgy59 --- spk/tvheadend/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spk/tvheadend/Makefile b/spk/tvheadend/Makefile index 8a062acbe95..55d2558396f 100644 --- a/spk/tvheadend/Makefile +++ b/spk/tvheadend/Makefile @@ -15,7 +15,7 @@ export TVH_VERS DEPENDS = cross/$(SPK_NAME) cross/zap2epg WHEELS = certifi chardet requests urllib3 -SPK_DEPENDS = "python3>=3.7" +SPK_DEPENDS = "python38" MAINTAINER = th0ma7 DESCRIPTION = Tvheadend is a TV streaming server and recorder for Linux, FreeBSD and Android supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, ISDB-T, IPTV, SAT IP and HDHomeRun as input sources. Tvheadend offers HTTP, HTSP and SAT IP streaming. From 391abd0889a9ef1c9609b33582ae60644c74a55c Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 17 Jun 2021 07:03:45 -0400 Subject: [PATCH 09/11] Avoid using /usr/local/ paths Co-authored-by: hgy59 --- spk/tvheadend/src/service-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spk/tvheadend/src/service-setup.sh b/spk/tvheadend/src/service-setup.sh index ae16ef09047..fc3c1576774 100644 --- a/spk/tvheadend/src/service-setup.sh +++ b/spk/tvheadend/src/service-setup.sh @@ -6,7 +6,7 @@ PYTHON_DIR="/var/packages/python38/target" PYTHONENV="${SYNOPKG_PKGDEST}/env" VIRTUALENV="${PYTHON_DIR}/bin/virtualenv" WHEELHOUSE=${SYNOPKG_PKGDEST}/share/wheelhouse -FFMPEG_DIR="/usr/local/ffmpeg" +FFMPEG_DIR="/var/packages/ffmpeg/target" 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 From 6e74c3e710f9c2b8693189536ef3d15b01087567 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 17 Jun 2021 11:13:03 +0000 Subject: [PATCH 10/11] tvheadend: User req. file instead of passing module directly --- spk/tvheadend/Makefile | 2 +- spk/tvheadend/src/requirements.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 spk/tvheadend/src/requirements.txt diff --git a/spk/tvheadend/Makefile b/spk/tvheadend/Makefile index 55d2558396f..ada1b451cf0 100644 --- a/spk/tvheadend/Makefile +++ b/spk/tvheadend/Makefile @@ -14,7 +14,7 @@ DSM_UI_DIR = app export TVH_VERS DEPENDS = cross/$(SPK_NAME) cross/zap2epg -WHEELS = certifi chardet requests urllib3 +WHEELS = src/requirements.txt SPK_DEPENDS = "python38" MAINTAINER = th0ma7 diff --git a/spk/tvheadend/src/requirements.txt b/spk/tvheadend/src/requirements.txt new file mode 100644 index 00000000000..84b557c9ea3 --- /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 From fdd8fd18f3f4fc3c6fbaeb2da6ae270b803f56c5 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Thu, 17 Jun 2021 11:13:36 +0000 Subject: [PATCH 11/11] tvheadend: No need to adjust permissions afterwards --- spk/tvheadend/src/service-setup.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/spk/tvheadend/src/service-setup.sh b/spk/tvheadend/src/service-setup.sh index fc3c1576774..e19a7f07436 100644 --- a/spk/tvheadend/src/service-setup.sh +++ b/spk/tvheadend/src/service-setup.sh @@ -38,9 +38,6 @@ service_postinst () --no-deps --no-index --no-input --upgrade \ --force-reinstall --find-links \ ${WHEELHOUSE} ${WHEELHOUSE}/*.whl - - # EPG Grabber (zap2epg) - Adjust permissions - set_unix_permissions "${PYTHONENV}" } service_preupgrade ()