diff --git a/packages/addons/service/tvmosaic/changelog.txt b/packages/addons/service/tvmosaic/changelog.txt new file mode 100644 index 0000000000..ffbebe8438 --- /dev/null +++ b/packages/addons/service/tvmosaic/changelog.txt @@ -0,0 +1,2 @@ +100 +- Initial addon diff --git a/packages/addons/service/tvmosaic/icon/icon.png b/packages/addons/service/tvmosaic/icon/icon.png new file mode 100644 index 0000000000..620c7e1738 Binary files /dev/null and b/packages/addons/service/tvmosaic/icon/icon.png differ diff --git a/packages/addons/service/tvmosaic/package.mk b/packages/addons/service/tvmosaic/package.mk new file mode 100644 index 0000000000..1452d1b06f --- /dev/null +++ b/packages/addons/service/tvmosaic/package.mk @@ -0,0 +1,76 @@ +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2018-present Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +PKG_NAME="tvmosaic" +PKG_VERSION="1.0.0-16296" +PKG_REV="100" +PKG_ARCH="arm" +PKG_LICENSE="Prop." +PKG_SITE="https://tv-mosaic.com" +PKG_URL="https://github.com/awiouy/tvmosaic/archive/$PKG_VERSION.tar.gz" +PKG_DEPENDS_TARGET="toolchain" +PKG_SECTION="service" +PKG_SHORTDESC="TV Mosaic" +PKG_LONGDESC="TV Mosaic ($PKG_VERSION) live and recorded TV for Kodi and DLNA clients" + +PKG_IS_ADDON="yes" +PKG_ADDON_NAME="TV Mosaic" +PKG_ADDON_TYPE="xbmc.service" +PKG_MAINTAINER="Anton Voyl (awiouy)" + +configure_target() { + : +} + +make_target() { + : +} + +makeinstall_target() { + : +} + +debug_strip() { + : +} + +addon() { + mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin + cp $PKG_BUILD/tvmosaic/tvmosaic_reg \ + $PKG_BUILD/tvmosaic/tvmosaic_server \ + $PKG_BUILD/tvmosaic/version.dat \ + $ADDON_BUILD/$PKG_ADDON_ID/bin + + mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/config/shared.inst/RecordedTV \ + $ADDON_BUILD/$PKG_ADDON_ID/config/shared.inst/channel_logo \ + $ADDON_BUILD/$PKG_ADDON_ID/config/shared.inst/xmltv + cp -r $PKG_BUILD/tvmosaic/data \ + $PKG_BUILD/tvmosaic/shared.inst \ + $ADDON_BUILD/$PKG_ADDON_ID/config + echo $PKG_REV > $ADDON_BUILD/$PKG_ADDON_ID/config/pkg_rev + + mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/lib + cp -L $PKG_BUILD/tvmosaic/lib/libcares.so.2 \ + $PKG_BUILD/tvmosaic/lib/libdvbapi.so \ + $PKG_BUILD/tvmosaic/lib/libdvben50221.so \ + $PKG_BUILD/tvmosaic/lib/libiconv.so.2 \ + $PKG_BUILD/tvmosaic/lib/libidn.so.11 \ + $PKG_BUILD/tvmosaic/lib/libssh2.so.1 \ + $PKG_BUILD/tvmosaic/lib/libucsi.so \ + $ADDON_BUILD/$PKG_ADDON_ID/lib +} diff --git a/packages/addons/service/tvmosaic/source/bin/tvmosaic.cli b/packages/addons/service/tvmosaic/source/bin/tvmosaic.cli new file mode 100755 index 0000000000..d2a78db447 --- /dev/null +++ b/packages/addons/service/tvmosaic/source/bin/tvmosaic.cli @@ -0,0 +1,25 @@ +#!/bin/sh +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2018-present Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +. /etc/profile +oe_setup_addon service.tvmosaic + +export TVMOSAIC_ROOT_CONFIG_DIR="$ADDON_HOME" + +tvmosaic_server -command_line_mode diff --git a/packages/addons/service/tvmosaic/source/bin/tvmosaic.start b/packages/addons/service/tvmosaic/source/bin/tvmosaic.start new file mode 100755 index 0000000000..abbd7953f7 --- /dev/null +++ b/packages/addons/service/tvmosaic/source/bin/tvmosaic.start @@ -0,0 +1,42 @@ +#!/bin/sh +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2018-present Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +. /etc/profile +oe_setup_addon service.tvmosaic + +sleep "$tvm_delay" + +export TVMOSAIC_ROOT_CONFIG_DIR="$ADDON_HOME" + +pkg_rev() { + cat "$1/pkg_rev" 2> /dev/null +} + +if [ "$(pkg_rev $ADDON_DIR/config)" != "$(pkg_rev $ADDON_HOME)" ]; then + cp -r "$ADDON_DIR/config/"* "$ADDON_HOME" +fi + +if [ -f "$ADDON_HOME/tvmosaic_configuration.xml" ]; then + tvmosaic_reg -reginstall "$ADDON_HOME/data/common/product_info/tvmosaic.xml" update +else + tvmosaic_reg -preparenewinstall "$ADDON_DIR/bin" "$ADDON_HOME/data" "$ADDON_HOME/shared.inst" + tvmosaic_reg -reginstall "$ADDON_HOME/data/common/product_info/tvmosaic.xml" install +fi + +tvmosaic_server diff --git a/packages/addons/service/tvmosaic/source/default.py b/packages/addons/service/tvmosaic/source/default.py new file mode 100644 index 0000000000..a4ba4d9ce1 --- /dev/null +++ b/packages/addons/service/tvmosaic/source/default.py @@ -0,0 +1,39 @@ +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2018-present Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +import subprocess +import xbmc +import xbmcaddon + + +def systemctl(command): + subprocess.call( + ['systemctl', command, xbmcaddon.Addon().getAddonInfo('id')]) + + +class Monitor(xbmc.Monitor): + + def __init__(self, *args, **kwargs): + xbmc.Monitor.__init__(self) + + def onSettingsChanged(self): + systemctl('restart') + + +if __name__ == '__main__': + Monitor().waitForAbort() diff --git a/packages/addons/service/tvmosaic/source/resources/language/English/strings.po b/packages/addons/service/tvmosaic/source/resources/language/English/strings.po new file mode 100644 index 0000000000..537e7c5cc7 --- /dev/null +++ b/packages/addons/service/tvmosaic/source/resources/language/English/strings.po @@ -0,0 +1,14 @@ +# Kodi Media Center language file +# Addon Name: tvmosaic +# Addon id: service.tvmosaic +# Addon Provider: Team LibreELEC +msgid "" +msgstr "" + +msgctxt "#30000" +msgid "Configuration" +msgstr "" + +msgctxt "#30001" +msgid "Start delay" +msgstr "" diff --git a/packages/addons/service/tvmosaic/source/resources/settings.xml b/packages/addons/service/tvmosaic/source/resources/settings.xml new file mode 100644 index 0000000000..131f906384 --- /dev/null +++ b/packages/addons/service/tvmosaic/source/resources/settings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/addons/service/tvmosaic/source/settings-default.xml b/packages/addons/service/tvmosaic/source/settings-default.xml new file mode 100644 index 0000000000..6facb0d900 --- /dev/null +++ b/packages/addons/service/tvmosaic/source/settings-default.xml @@ -0,0 +1,3 @@ + + + diff --git a/packages/addons/service/tvmosaic/source/system.d/service.tvmosaic.service b/packages/addons/service/tvmosaic/source/system.d/service.tvmosaic.service new file mode 100644 index 0000000000..5c45fdea05 --- /dev/null +++ b/packages/addons/service/tvmosaic/source/system.d/service.tvmosaic.service @@ -0,0 +1,13 @@ +[Unit] +Description=TV Mosaic Server +Documentation=https://tv-mosaic.com +After=network-online.target +Requires=network-online.target + +[Service] +ExecStart=/bin/sh /storage/.kodi/addons/service.tvmosaic/bin/tvmosaic.start +Type=forking +Restart=always + +[Install] +WantedBy=kodi.target