diff --git a/packages/addons/service/downloadmanager/SABnzbd/addon b/packages/addons/service/downloadmanager/SABnzbd/addon new file mode 100755 index 0000000000..88dd090e00 --- /dev/null +++ b/packages/addons/service/downloadmanager/SABnzbd/addon @@ -0,0 +1,37 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +# +# This Program 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, or (at your option) +# any later version. +# +# This Program 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 OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +. config/options $1 + +mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/$1 + cp -PR $PKG_BUILD/* $ADDON_BUILD/$PKG_ADDON_ID/$1 + cp -PR $PKG_DIR/config/settings.xml* $ADDON_BUILD/$PKG_ADDON_ID/settings-default.xml + +mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin + cp $BUILD/par2cmdline*/par2 $ADDON_BUILD/$PKG_ADDON_ID/bin + cp $BUILD/unrar/unrar $ADDON_BUILD/$PKG_ADDON_ID/bin + cp $BUILD/unzip*/unzip $ADDON_BUILD/$PKG_ADDON_ID/bin + +mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/pylib + cp -R $BUILD/Cheetah*/.install/usr/lib/python*/site-packages/* $ADDON_BUILD/$PKG_ADDON_ID/pylib + cp -R $BUILD/pyOpenSSL*/.install/usr/lib/python*/site-packages/* $ADDON_BUILD/$PKG_ADDON_ID/pylib + cp -R $BUILD/yenc*/.install/usr/lib/python*/site-packages/* $ADDON_BUILD/$PKG_ADDON_ID/pylib diff --git a/packages/addons/service/downloadmanager/SABnzbd/changelog.txt b/packages/addons/service/downloadmanager/SABnzbd/changelog.txt new file mode 100644 index 0000000000..2703b7f6db --- /dev/null +++ b/packages/addons/service/downloadmanager/SABnzbd/changelog.txt @@ -0,0 +1,6 @@ +0.99.2 +- update to SABnzbd-0.6.1 +- rework addon + +0.99.1 +- initial version SABnzbd-0.6.0RC2 diff --git a/packages/addons/service/downloadmanager/SABnzbd/config/settings.xml b/packages/addons/service/downloadmanager/SABnzbd/config/settings.xml new file mode 100644 index 0000000000..20c2a69b4e --- /dev/null +++ b/packages/addons/service/downloadmanager/SABnzbd/config/settings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/addons/service/downloadmanager/SABnzbd/icon/icon.png b/packages/addons/service/downloadmanager/SABnzbd/icon/icon.png new file mode 100644 index 0000000000..2c62900063 Binary files /dev/null and b/packages/addons/service/downloadmanager/SABnzbd/icon/icon.png differ diff --git a/packages/addons/service/downloadmanager/SABnzbd/meta b/packages/addons/service/downloadmanager/SABnzbd/meta new file mode 100644 index 0000000000..59416fecd8 --- /dev/null +++ b/packages/addons/service/downloadmanager/SABnzbd/meta @@ -0,0 +1,38 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +# +# This Program 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, or (at your option) +# any later version. +# +# This Program 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 OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +PKG_NAME="SABnzbd" +PKG_VERSION="0.6.1" +PKG_REV="2" +PKG_ARCH="any" +PKG_LICENSE="OSS" +PKG_SITE="http://sabnzbd.org/" +PKG_URL="$SOURCEFORGE_SRC/sabnzbdplus/sabnzbdplus/sabnzbd-${PKG_VERSION}/${PKG_NAME}-${PKG_VERSION}-src.tar.gz" +PKG_DEPENDS="Python Cheetah pyOpenSSL yenc unrar unzip par2cmdline" +PKG_BUILD_DEPENDS="toolchain Python Cheetah pyOpenSSL yenc unrar unzip par2cmdline" +PKG_PRIORITY="optional" +PKG_SECTION="service/downloadmanager" +PKG_SHORTDESC="SABnzbd makes Usenet as simple and streamlined as possible by automating everything we can." +PKG_LONGDESC="SABnzbd makes Usenet as simple and streamlined as possible by automating everything we can. All you have to do is add a .nzb file. SABnzbd+ takes over from there, where it will be automatically downloaded, verified, repaired, extracted and filed away with zero human interaction." + +PKG_IS_ADDON="yes" +PKG_ADDON_TYPE="xbmc.service" + +PKG_AUTORECONF="no" diff --git a/packages/addons/service/downloadmanager/SABnzbd/patches/SABnzbd-0.6.1-001_remove_default_settings-0.2.patch b/packages/addons/service/downloadmanager/SABnzbd/patches/SABnzbd-0.6.1-001_remove_default_settings-0.2.patch new file mode 100644 index 0000000000..cc59ea4d0f --- /dev/null +++ b/packages/addons/service/downloadmanager/SABnzbd/patches/SABnzbd-0.6.1-001_remove_default_settings-0.2.patch @@ -0,0 +1,214 @@ +diff -Naur SABnzbd-0.6.1/interfaces/Plush/templates/config_directories.tmpl SABnzbd-0.6.1.patch/interfaces/Plush/templates/config_directories.tmpl +--- SABnzbd-0.6.1/interfaces/Plush/templates/config_directories.tmpl 2011-05-15 10:44:29.000000000 +0200 ++++ SABnzbd-0.6.1.patch/interfaces/Plush/templates/config_directories.tmpl 2011-05-23 20:05:59.254145174 +0200 +@@ -109,49 +109,6 @@ + + + +-
+-
+-

$T('systemFolders')

+-

$T('base-folder'):
$my_lcldata

+-
+-
+-
+- +- +- +-
+-
+- +- +-
+-
+- +- +-
+-
+-
+- +
+
+

 

+diff -Naur SABnzbd-0.6.1/interfaces/Plush/templates/config_general.tmpl SABnzbd-0.6.1.patch/interfaces/Plush/templates/config_general.tmpl +--- SABnzbd-0.6.1/interfaces/Plush/templates/config_general.tmpl 2011-05-15 10:44:29.000000000 +0200 ++++ SABnzbd-0.6.1.patch/interfaces/Plush/templates/config_general.tmpl 2011-05-23 20:09:03.985485852 +0200 +@@ -14,82 +14,6 @@ +
+
+
+- +- +-
+-
+- +- +-
+-
+- +- +-
+-
+- +- +-
+-
+- +- +-
+-
+- +- +-
+-
+ +-
+
+
+ +@@ -152,36 +69,6 @@ + $T('explain-enable_https') + + +-
+- +- +-
+-
+- +- +-
+-
+- +- +-
+ + + +diff -Naur SABnzbd-0.6.1/interfaces/Plush/templates/config_switches.tmpl SABnzbd-0.6.1.patch/interfaces/Plush/templates/config_switches.tmpl +--- SABnzbd-0.6.1/interfaces/Plush/templates/config_switches.tmpl 2011-05-15 10:44:29.000000000 +0200 ++++ SABnzbd-0.6.1.patch/interfaces/Plush/templates/config_switches.tmpl 2011-05-23 20:09:53.829117059 +0200 +@@ -12,20 +12,6 @@ +

$T('swtag-general')

+ +
+-
+- 0 then "checked=1" else ""#--> /> +- +-
+-
+- 0 then "checked=1" else ""#--> /> +- +-
+ +
+ 0 then "checked=1" else ""#--> /> diff --git a/packages/addons/service/downloadmanager/SABnzbd/source/bin/SABnzbd.service b/packages/addons/service/downloadmanager/SABnzbd/source/bin/SABnzbd.service new file mode 100755 index 0000000000..1771ab5730 --- /dev/null +++ b/packages/addons/service/downloadmanager/SABnzbd/source/bin/SABnzbd.service @@ -0,0 +1,110 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +# +# This Program 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, or (at your option) +# any later version. +# +# This Program 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 OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +ADDON_DIR="$HOME/.xbmc/addons/service.downloadmanager.SABnzbd" +ADDON_HOME="$HOME/.xbmc/userdata/addon_data/service.downloadmanager.SABnzbd" +LOG_FILE="$ADDON_HOME/service.log" +SABNZBD_SETTINGS="$ADDON_HOME/settings.xml" + +export PYTHONPATH="$PYTHONPATH:$ADDON_DIR/pylib" + +SABNZBD_DISABLEAPIKEY="0" +SABNZBD_CHECKRELEASE="0" +SABNZBD_LAUNCHBROWSER="0" + +SABNZBD_HTTPPORT="8081" +SABNZBD_HTTPSPORT="9081" +SABNZBD_HTTPSCERT="server.cert" +SABNZBD_HTTPSKEY="server.key" + +SABNZBD_SKIN="Plush" +SABNZBD_SKIN2="Plush" +SABNZBD_WEBCOLOR="gold" +SABNZBD_WEBCOLOR2="gold" + +SABNZBD_LOGDIR="logs" +SABNZBD_ADMINDIR="admin" +SABNZBD_BACKUPDIR="backup" + +SABNZBD_INCOMPLETEDIR="/storage/downloads/incomplete" +SABNZBD_COMPLETEDIR="/storage/downloads" +SABNZBD_WATCHDIR="/storage/downloads/watch" + +write_ini() { +python $ADDON_DIR/bin/ini_tool --action=write \ + --file=$ADDON_HOME/sabnzbd.ini \ + --option="$1:$2" \ + --value="$3" +} + +mkdir -p $ADDON_HOME + +if [ ! -f "$SABNZBD_SETTINGS" ]; then + cp $ADDON_DIR/settings-default.xml $SABNZBD_SETTINGS +fi + +if [ ! -f "$ADDON_HOME/sabnzbd.ini" ]; then + SABNZBD_FIRSTRUN="yes" +fi + +# use settings from xbmc setup dialog +SABNZBD_USER=`grep SABNZBD_USER $SABNZBD_SETTINGS | awk '{print $3 }' | sed -e "s,value=,," -e "s,\",,g"` +SABNZBD_PWD=`grep SABNZBD_PWD $SABNZBD_SETTINGS | awk '{print $3 }' | sed -e "s,value=,," -e "s,\",,g"` +SABNZBD_IP=`grep SABNZBD_IP $SABNZBD_SETTINGS | awk '{print $3 }' | sed -e "s,value=,," -e "s,\",,g"` + +if [ -z "$SABNZBD_IP" ]; then + SABNZBD_IP="0.0.0.0" +fi + +write_ini misc disable_api_key $SABNZBD_DISABLEAPIKEY +write_ini misc check_new_rel $SABNZBD_CHECKRELEASE +write_ini misc auto_browser $SABNZBD_LAUNCHBROWSER +write_ini misc username $SABNZBD_USER +write_ini misc password $SABNZBD_PWD +write_ini misc port $SABNZBD_HTTPPORT +write_ini misc https_port $SABNZBD_HTTPSPORT +write_ini misc https_cert $SABNZBD_HTTPSCERT +write_ini misc https_key $SABNZBD_HTTPSKEY +write_ini misc host $SABNZBD_IP +write_ini misc web_dir $SABNZBD_SKIN +write_ini misc web_dir2 $SABNZBD_SKIN2 +write_ini misc web_color $SABNZBD_WEBCOLOR +write_ini misc web_color2 $SABNZBD_WEBCOLOR2 +write_ini misc log_dir $SABNZBD_LOGDIR +write_ini misc admin_dir $SABNZBD_ADMINDIR +write_ini misc nzb_backup_dir $SABNZBD_BACKUPDIR + +if [ "$SABNZBD_FIRSTRUN" = "yes" ]; then + mkdir -p "$SABNZBD_INCOMPLETEDIR" + mkdir -p "$SABNZBD_COMPLETEDIR" + mkdir -p "$SABNZBD_WATCHDIR" + write_ini misc download_dir $SABNZBD_INCOMPLETEDIR + write_ini misc complete_dir $SABNZBD_COMPLETEDIR + write_ini misc dirscan_dir $SABNZBD_WATCHDIR + + write_ini servers:localhost name "localhost" + write_ini servers:localhost host "localhost" + write_ini servers:localhost port "119" + write_ini servers:localhost enable "0" +fi + +python $ADDON_DIR/SABnzbd/SABnzbd.py -d -f $ADDON_HOME/sabnzbd.ini -l 0 diff --git a/packages/addons/service/downloadmanager/SABnzbd/source/bin/ini_tool b/packages/addons/service/downloadmanager/SABnzbd/source/bin/ini_tool new file mode 100755 index 0000000000..97f7b4c433 --- /dev/null +++ b/packages/addons/service/downloadmanager/SABnzbd/source/bin/ini_tool @@ -0,0 +1,117 @@ +#!/usr/bin/env python + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2011 Travis Glenn Hansen (travisghansen@openelec.tv) +# +# This Program 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, or (at your option) +# any later version. +# +# This Program 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 OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +from configobj import ConfigObj +import sys +import os +import string + +python_major = sys.version_info[0] +python_minor = sys.version_info[1] + +prog="ini_tool" +description="""Read/Write config files. + +Examples: + %(prog)s --file config.ini --action read --option [section:]username + %(prog)s --file config.ini --action write --option [section:]username --value foo""" % {'prog':prog} + +def option_required_error(option): + parser.print_usage() + print prog + ": error: " + option + " is required" + exit(2) + +if python_major > 2 or (python_major == 2 and python_minor >= 7): + import argparse + + parser = argparse.ArgumentParser( + prog=prog, + description=description, + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + + parser.add_argument('--file', help='file to read/write to/from', required=True) + parser.add_argument('--action', help='read|write', required=True) + parser.add_argument('--option', help='the option key', required=True) + parser.add_argument('--value', help='value to store in the given option (only for write action)') + + options = parser.parse_args() + +else: + import optparse + + parser = optparse.OptionParser( + prog=prog, + description=description, + ) + + parser.add_option('--file', help='file to read/write to/from') + parser.add_option('--action', help='read|write') + parser.add_option('--option', help='the option key') + parser.add_option('--value', help='value to store in the given option (only for write action)') + + (options, args) = parser.parse_args() + + if not options.file: + option_required_error("--file") + if not options.action: + option_required_error("--action") + if not options.option: + option_required_error("--option") + + +if options.action != "read" and options.action != "write": + print "'" + options.action + "' is not a valid action" + parser.print_help() + exit(2) + +if options.action == "read" and not os.path.isfile(options.file): + print "'" + options.file + "' is not a file" + exit(2) + +config = ConfigObj(options.file) +keys = string.split(options.option, ":") +key_len = len(keys) +current_section = config + +if options.action == 'read': + i = 1 + for key in keys: + if i == key_len: + print current_section[key] + exit(0) + else: + current_section = current_section[key] + i += 1 +elif options.action == 'write': + i = 1 + for key in keys: + if i == key_len: + current_section[key] = options.value + elif key not in current_section: + current_section[key] = {} + current_section = current_section[key] + i += 1 + + config.write() +else: + exit(1) \ No newline at end of file diff --git a/packages/addons/service/downloadmanager/SABnzbd/source/default.py b/packages/addons/service/downloadmanager/SABnzbd/source/default.py new file mode 100644 index 0000000000..726a943a06 --- /dev/null +++ b/packages/addons/service/downloadmanager/SABnzbd/source/default.py @@ -0,0 +1,23 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +# +# This Program 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, or (at your option) +# any later version. +# +# This Program 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 OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +import xbmc, time, os, subprocess + +os.system("SABnzbd.service") diff --git a/packages/addons/service/downloadmanager/SABnzbd/source/resources/language/Dutch/strings.xml b/packages/addons/service/downloadmanager/SABnzbd/source/resources/language/Dutch/strings.xml new file mode 100644 index 0000000000..69ffefaeb3 --- /dev/null +++ b/packages/addons/service/downloadmanager/SABnzbd/source/resources/language/Dutch/strings.xml @@ -0,0 +1,12 @@ + + + + + SABnzbd + Gebruikers instellingen + Gebruikersnaam + Wachtwoord + Netwerk instellingen + Toegestane IP adressen + + diff --git a/packages/addons/service/downloadmanager/SABnzbd/source/resources/language/English/strings.xml b/packages/addons/service/downloadmanager/SABnzbd/source/resources/language/English/strings.xml new file mode 100644 index 0000000000..68cb162a30 --- /dev/null +++ b/packages/addons/service/downloadmanager/SABnzbd/source/resources/language/English/strings.xml @@ -0,0 +1,12 @@ + + + + + SABnzbd + User Settings + Username + Password + Network Settings + Allowed IP addresses + + diff --git a/packages/addons/service/downloadmanager/SABnzbd/source/resources/language/French/strings.xml b/packages/addons/service/downloadmanager/SABnzbd/source/resources/language/French/strings.xml new file mode 100644 index 0000000000..fb3f0fc1f9 --- /dev/null +++ b/packages/addons/service/downloadmanager/SABnzbd/source/resources/language/French/strings.xml @@ -0,0 +1,12 @@ + + + + + SABnzbd + Préférences utilisateur + Nom d'utilisateur + Mot de passe + Préférences réseau + Adresses IP autorisées + + diff --git a/packages/addons/service/downloadmanager/SABnzbd/source/resources/language/German/strings.xml b/packages/addons/service/downloadmanager/SABnzbd/source/resources/language/German/strings.xml new file mode 100644 index 0000000000..ad209d26c7 --- /dev/null +++ b/packages/addons/service/downloadmanager/SABnzbd/source/resources/language/German/strings.xml @@ -0,0 +1,12 @@ + + + + + SABnzbd + Benutzer Einstellungen + Benutzername + Passwort + Netzwerk Einstellungen + Erlaubte IP Adressen + + diff --git a/packages/addons/service/downloadmanager/SABnzbd/source/resources/language/Norwegian/strings.xml b/packages/addons/service/downloadmanager/SABnzbd/source/resources/language/Norwegian/strings.xml new file mode 100644 index 0000000000..a70961eb4c --- /dev/null +++ b/packages/addons/service/downloadmanager/SABnzbd/source/resources/language/Norwegian/strings.xml @@ -0,0 +1,12 @@ + + + + + SABnzbd + Bruker Instillinger + Brukernavn + Passord + Nettverksinstillinger + Tilatte IP addresser + + diff --git a/packages/addons/service/downloadmanager/SABnzbd/source/resources/settings.xml b/packages/addons/service/downloadmanager/SABnzbd/source/resources/settings.xml new file mode 100644 index 0000000000..8ee2bb0ab2 --- /dev/null +++ b/packages/addons/service/downloadmanager/SABnzbd/source/resources/settings.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +