diff --git a/packages/addons/addon-depends/pcsc-lite/package.mk b/packages/addons/addon-depends/pcsc-lite/package.mk new file mode 100644 index 0000000000..2c6ab65bf6 --- /dev/null +++ b/packages/addons/addon-depends/pcsc-lite/package.mk @@ -0,0 +1,39 @@ +################################################################################ +# This file is part of LibreELEC - https://LibreELEC.tv +# Copyright (C) 2016 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="pcsc-lite" +PKG_VERSION="1.8.16" +PKG_REV="0" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="http://pcsclite.alioth.debian.org/pcsclite.html" +PKG_URL="https://alioth.debian.org/frs/download.php/file/4164/${PKG_NAME}-${PKG_VERSION}.tar.bz2" +PKG_DEPENDS_TARGET="toolchain libusb" +PKG_PRIORITY="optional" +PKG_SECTION="service/system" +PKG_SHORTDESC="Middleware to access a smart card using SCard API (PC/SC)" +PKG_LONGDESC="Middleware to access a smart card using SCard API (PC/SC)" + +PKG_IS_ADDON="no" +PKG_AUTORECONF="yes" + +PKG_CONFIGURE_OPTS_TARGET="--disable-shared \ + --enable-static \ + --disable-libudev \ + --enable-libusb \ + --enable-usbdropdir=/storage/.kodi/addons/service.system.pcscd-addon/drivers" diff --git a/packages/addons/service/oscam/changelog.txt b/packages/addons/service/oscam/changelog.txt new file mode 100644 index 0000000000..2907dab344 --- /dev/null +++ b/packages/addons/service/oscam/changelog.txt @@ -0,0 +1,2 @@ +7.0.100 +- initial LibreELEC version \ No newline at end of file diff --git a/packages/addons/service/oscam/icon/icon.png b/packages/addons/service/oscam/icon/icon.png new file mode 100644 index 0000000000..3055c46ebd Binary files /dev/null and b/packages/addons/service/oscam/icon/icon.png differ diff --git a/packages/addons/service/oscam/package.mk b/packages/addons/service/oscam/package.mk new file mode 100644 index 0000000000..1a0227f421 --- /dev/null +++ b/packages/addons/service/oscam/package.mk @@ -0,0 +1,66 @@ +################################################################################ +# This file is part of LibreELEC - https://LibreELEC.tv +# Copyright (C) 2016 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="oscam" +PKG_VERSION="09609e1" +PKG_VERSION_NUMBER="11225" +PKG_REV="100" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="http://www.streamboard.tv/oscam/wiki" +PKG_URL="http://repo.or.cz/oscam.git/snapshot/$PKG_VERSION.tar.gz" +PKG_DEPENDS_TARGET="toolchain pcsc-lite" +PKG_PRIORITY="optional" +PKG_SECTION="service.softcam" +PKG_SHORTDESC="OSCam is Open Source Conditional Access Modul." +PKG_LONGDESC="OSCam is a softcam, software to be used to decrypt digital television channels, as an alternative for a conditional access module." + +PKG_IS_ADDON="yes" +PKG_ADDON_NAME="OSCam" +PKG_ADDON_TYPE="xbmc.service" +PKG_AUTORECONF="no" +PKG_ADDON_REPOVERSION="7.0" + +pre_unpack() { +export OSCAM_ADDON_VERSION="$PKG_VERSION_NUMBER" +} + +configure_target() { + cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIBUSBDIR=$SYSROOT_PREFIX/usr \ + -DWITH_SSL=0 \ + -DHAVE_LIBCRYPTO=0 \ + -DHAVE_DVBAPI=1 -DWITH_STAPI=0 \ + -DWEBIF=1 \ + -DWITH_DEBUG=0 \ + -DOPTIONAL_INCLUDE_DIR=$SYSROOT_PREFIX/usr/include \ + -DSTATIC_LIBUSB=1 \ + -DCLOCKFIX=0 \ + .. +} + +makeinstall_target() { + : # nop +} + +addon() { + mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin + cp -P $PKG_BUILD/.$TARGET_NAME/oscam $ADDON_BUILD/$PKG_ADDON_ID/bin + cp -P $PKG_BUILD/.$TARGET_NAME/utils/list_smargo $ADDON_BUILD/$PKG_ADDON_ID/bin +} diff --git a/packages/addons/service/oscam/patches/oscam-01-revision.patch b/packages/addons/service/oscam/patches/oscam-01-revision.patch new file mode 100644 index 0000000000..201666456e --- /dev/null +++ b/packages/addons/service/oscam/patches/oscam-01-revision.patch @@ -0,0 +1,13 @@ +diff --git a/config.sh b/config.sh +index 7653731..a6b2ea8 100755 +--- a/config.sh ++++ b/config.sh +@@ -687,7 +687,7 @@ do + break + ;; + '-r'|'--oscam-revision') +- (svnversion -n . 2>/dev/null || printf 0) | sed 's/.*://; s/[^0-9]*$//; s/^$/0/' ++ echo "$OSCAM_ADDON_VERSION" + break + ;; + '-O'|'--detect-osx-sdk-version') diff --git a/packages/addons/service/oscam/patches/oscam-02-link-with-ludev.patch b/packages/addons/service/oscam/patches/oscam-02-link-with-ludev.patch new file mode 100644 index 0000000000..ff16f494da --- /dev/null +++ b/packages/addons/service/oscam/patches/oscam-02-link-with-ludev.patch @@ -0,0 +1,28 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3ebd781..2966e65 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -474,7 +474,7 @@ add_library (${csoscam} STATIC ${csoscam_srcs} ${csoscam_hdrs}) + + set (exe_name "oscam") + add_executable (${exe_name} ${exe_srcs} ${exe_hdrs}) +-target_link_libraries (${exe_name} ${csoscam} ${csmodules} ${csreaders} csctapi cscrypt minilzo) ++target_link_libraries (${exe_name} ${csoscam} ${csmodules} ${csreaders} csctapi cscrypt minilzo udev) + if(HAVE_LIBRT AND HAVE_LIBUSB) + if (LIBUSBDIR) + set (libusb_link "imp_libusb") +diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt +index 6790913..a603d3e 100644 +--- a/utils/CMakeLists.txt ++++ b/utils/CMakeLists.txt +@@ -12,7 +12,7 @@ file (GLOB all_srcs ${exe_srcs}) + + set (util_name "list_smargo") + add_executable (${util_name} ${exe_srcs} ${exe_hdrs}) +-target_link_libraries (${util_name} ${libusb_link} ${rt_link} ${setupapi_link} ${ole32_link} ${shell32_link} ${pthread_link} ${dl_link}) ++target_link_libraries (${util_name} ${libusb_link} ${rt_link} ${setupapi_link} ${ole32_link} ${shell32_link} ${pthread_link} ${dl_link} udev) + #----------------------- printout resume ----------------------------- + + message (STATUS "Utils: operating system: ${OSCamOperatingSystem}") +-- +1.7.2.5 diff --git a/packages/addons/service/oscam/patches/oscam-03-pcsc-pthread.patch b/packages/addons/service/oscam/patches/oscam-03-pcsc-pthread.patch new file mode 100644 index 0000000000..4eeee55111 --- /dev/null +++ b/packages/addons/service/oscam/patches/oscam-03-pcsc-pthread.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cd52430..b01b9fc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -530,6 +530,7 @@ if (HAVE_PCSC) + if (NOT OSCamOperatingSystem MATCHES "Mac OS X") + if (NOT OSCamOperatingSystem MATCHES "Windows/Cygwin") + target_link_libraries (${exe_name} pcsclite) ++ target_link_libraries (${exe_name} pthread) + endif (NOT OSCamOperatingSystem MATCHES "Windows/Cygwin") + endif (NOT OSCamOperatingSystem MATCHES "Mac OS X") + endif (HAVE_PCSC) diff --git a/packages/addons/service/oscam/source/bin/oscam.start b/packages/addons/service/oscam/source/bin/oscam.start new file mode 100755 index 0000000000..23ae9d2bee --- /dev/null +++ b/packages/addons/service/oscam/source/bin/oscam.start @@ -0,0 +1,63 @@ +#!/bin/sh + +################################################################################ +# This file is part of LibreELEC - https://LibreELEC.tv +# Copyright (C) 2016 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.softcam.oscam + +mkdir -p $ADDON_HOME/config +mkdir -p $ADDON_HOME/log + +for config_name in \ + oscam.ac oscam.cert oscam.dvbapi oscam.guess oscam.ird oscam.provid \ + oscam.server oscam.services oscam.srvid oscam.tiers oscam.user +do + [ ! -f $ADDON_HOME/config/$config_name ] && touch $ADDON_HOME/config/$config_name +done + +if [ ! -f "$ADDON_HOME/config/oscam.conf" ]; then + cp $ADDON_DIR/oscam-default.conf $ADDON_HOME/config/oscam.conf +fi + +find $ADDON_DIR/bin -maxdepth 1 -type f ! -perm 0755 -exec chmod 0755 \{\} \; + +if [ "$WORKAROUND_SLEEP" == "true" ] ; then + sleep $WORKAROUND_SLEEP_TIME +fi + +# start userspace DVB driver/addon +for driver_dvb in $(find /storage/.kodi/addons/driver.dvb.*/bin/userspace-driver.sh -type f 2>/dev/null); do + driver_dvb_name=$(echo $driver_dvb | awk 'BEGIN {FS="/"} {printf("%s", $5)}') + logger -t OSCAM "### Loading userspace DVB driver: $driver_dvb_name ###" + # use ". " because of variable export + . $driver_dvb +done + +if [ "$WAIT_FOR_FEINIT" == "true" ] ; then + while [ true ] ; do + if [ -e /dev/dvb/adapter$((NUM_ADAPTERS-1))/frontend0 ] ; then + break + fi + sleep 1 + done +fi + +exec oscam -c $ADDON_HOME/config > /dev/null 2>&1 + diff --git a/packages/addons/service/oscam/source/default.py b/packages/addons/service/oscam/source/default.py new file mode 100644 index 0000000000..c6dfcce9f2 --- /dev/null +++ b/packages/addons/service/oscam/source/default.py @@ -0,0 +1,17 @@ +################################################################################ +# This file is part of LibreELEC - https://LibreELEC.tv +# Copyright (C) 2016 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 . +################################################################################ diff --git a/packages/addons/service/oscam/source/oscam-default.conf b/packages/addons/service/oscam/source/oscam-default.conf new file mode 100644 index 0000000000..ac5da7844c --- /dev/null +++ b/packages/addons/service/oscam/source/oscam-default.conf @@ -0,0 +1,27 @@ +# oscam.conf generated automatically by Streamboard OSCAM 1.00-unstable_svn build #0 +# Read more: http://streamboard.gmc.to/svn/oscam/trunk/Distribution/doc/txt/oscam.conf.txt + +[global] +usrfile = /storage/.kodi/userdata/addon_data/service.softcam.oscam/log/oscamuser.log +logfile = /storage/.kodi/userdata/addon_data/service.softcam.oscam/log/oscam.log +cwlogdir = /storage/.kodi/userdata/addon_data/service.softcam.oscam/log/cw +nice = -1 +saveinithistory = 1 + +[monitor] +port = 988 +aulow = 120 +hideclient_to = 15 +monlevel = 1 +appendchaninfo = 0 + +[webif] +httpport = 8888 +httpuser = oscam +httppwd = oscam +httpallowed = 0.0.0.0-255.255.255.255 + +[dvbapi] +enabled = 1 +pmt_mode = 4 +boxtype = pc diff --git a/packages/addons/service/oscam/source/resources/language/English/strings.xml b/packages/addons/service/oscam/source/resources/language/English/strings.xml new file mode 100644 index 0000000000..adb080f372 --- /dev/null +++ b/packages/addons/service/oscam/source/resources/language/English/strings.xml @@ -0,0 +1,10 @@ + + + General + Restart on suspend / resume + DVBAPI + Delay the start of OSCam + time (s) + Wait for frontend initialization + Number of adapters to wait for + diff --git a/packages/addons/service/oscam/source/resources/settings.xml b/packages/addons/service/oscam/source/resources/settings.xml new file mode 100644 index 0000000000..669656f8c9 --- /dev/null +++ b/packages/addons/service/oscam/source/resources/settings.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/packages/addons/service/oscam/source/settings-default.xml b/packages/addons/service/oscam/source/settings-default.xml new file mode 100644 index 0000000000..25b504631d --- /dev/null +++ b/packages/addons/service/oscam/source/settings-default.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/packages/addons/service/oscam/source/sleep.d/oscam.power b/packages/addons/service/oscam/source/sleep.d/oscam.power new file mode 100644 index 0000000000..550f884072 --- /dev/null +++ b/packages/addons/service/oscam/source/sleep.d/oscam.power @@ -0,0 +1,40 @@ +#!/bin/sh + +################################################################################ +# This file is part of LibreELEC - https://LibreELEC.tv +# Copyright (C) 2016 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.softcam.oscam + +SERVICE="service.softcam.oscam.service" + +if [ "$RESTART_ON_RESUME" == "true" ] ; then + case "$1" in + pre) + if systemctl is-active "$SERVICE" &>/dev/null ; then + systemctl stop "$SERVICE" + fi + ;; + post) + if systemctl is-enabled "$SERVICE" &>/dev/null ; then + systemctl start "$SERVICE" + fi + ;; + esac +fi diff --git a/packages/addons/service/oscam/source/system.d/service.softcam.oscam.service b/packages/addons/service/oscam/source/system.d/service.softcam.oscam.service new file mode 100644 index 0000000000..9791e2d9b5 --- /dev/null +++ b/packages/addons/service/oscam/source/system.d/service.softcam.oscam.service @@ -0,0 +1,14 @@ +[Unit] +Description=OSCam +After=network-online.service +Requires=network-online.service + +[Service] +ExecStart=/bin/sh -c "exec sh /storage/.kodi/addons/service.softcam.oscam/bin/oscam.start" +TimeoutStopSec=1 +Restart=always +RestartSec=2 +StartLimitInterval=0 + +[Install] +WantedBy=kodi.target