Skip to content

Commit

Permalink
[WIP] Add zap2epg TV grabber to tvheadend (#4680)
Browse files Browse the repository at this point in the history
* tvheadend-zap2epg: Add zap2epg EPG grabber with needed python wheels

Co-authored-by: hgy59 <hpgy59@gmail.com>
  • Loading branch information
th0ma7 and hgy59 authored Jun 19, 2021
1 parent 1b293c2 commit 63d036d
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cross/tvheadend/PLIST
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions cross/zap2epg/Makefile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions cross/zap2epg/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rsc:bin/tv_grab_zap2epg
rsc:var/epggrab/conf/zap2epg.xml
3 changes: 3 additions & 0 deletions cross/zap2epg/digests
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion spk/tvheadend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ 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 = src/requirements.txt
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.
Expand Down
1 change: 1 addition & 0 deletions spk/tvheadend/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rsc:share/wheelhouse
4 changes: 4 additions & 0 deletions spk/tvheadend/src/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
certifi==2021.5.30
chardet==4.0.0
requests==2.25.1
urllib3==1.26.5
17 changes: 17 additions & 0 deletions spk/tvheadend/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Package specific behaviors
# Sourced script by generic installer and start-stop-status scripts

# Add ffmpeg and ifself to path
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}/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
HTSP=9982
Expand All @@ -21,6 +29,15 @@ 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}

# 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_preupgrade ()
Expand Down

0 comments on commit 63d036d

Please sign in to comment.