summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Bronder <jsbronder@gentoo.org>2013-01-03 20:02:32 +0000
committerJustin Bronder <jsbronder@gentoo.org>2013-01-03 20:02:32 +0000
commit6938903f1dbce3c54d8281109461737c540405f5 (patch)
treed710ca4e6bda03af968ef81f941448e7830d8dc7 /net-nntp
parentVersion bump to the latest. (diff)
downloadgentoo-2-6938903f1dbce3c54d8281109461737c540405f5.tar.gz
gentoo-2-6938903f1dbce3c54d8281109461737c540405f5.tar.bz2
gentoo-2-6938903f1dbce3c54d8281109461737c540405f5.zip
add net-nntp/sabnzbd
(Portage version: 2.1.11.37/cvs/Linux x86_64, signed Manifest commit with key 4D7043C9)
Diffstat (limited to 'net-nntp')
-rw-r--r--net-nntp/sabnzbd/ChangeLog11
-rw-r--r--net-nntp/sabnzbd/files/sabnzbd3
-rw-r--r--net-nntp/sabnzbd/files/sabnzbd.confd8
-rw-r--r--net-nntp/sabnzbd/files/sabnzbd.initd41
-rw-r--r--net-nntp/sabnzbd/files/use-system-configobj-and-feedparser.patch44
-rw-r--r--net-nntp/sabnzbd/metadata.xml12
-rw-r--r--net-nntp/sabnzbd/sabnzbd-0.7.7.ebuild104
7 files changed, 223 insertions, 0 deletions
diff --git a/net-nntp/sabnzbd/ChangeLog b/net-nntp/sabnzbd/ChangeLog
new file mode 100644
index 000000000000..2e52f3a15550
--- /dev/null
+++ b/net-nntp/sabnzbd/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for net-nntp/sabnzbd
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-nntp/sabnzbd/ChangeLog,v 1.1 2013/01/03 20:02:32 jsbronder Exp $
+
+*sabnzbd-0.7.7 (03 Jan 2013)
+
+ 03 Jan 2013; Justin Bronder <jsbronder@gentoo.org> +sabnzbd-0.7.7.ebuild,
+ +files/sabnzbd, +files/sabnzbd.confd, +files/sabnzbd.initd,
+ +files/use-system-configobj-and-feedparser.patch, +metadata.xml:
+ add net-nntp/sabnzbd
+
diff --git a/net-nntp/sabnzbd/files/sabnzbd b/net-nntp/sabnzbd/files/sabnzbd
new file mode 100644
index 000000000000..33aaf7bcbc2a
--- /dev/null
+++ b/net-nntp/sabnzbd/files/sabnzbd
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+cd /usr/share/sabnzbd && python SABnzbd.py $*
diff --git a/net-nntp/sabnzbd/files/sabnzbd.confd b/net-nntp/sabnzbd/files/sabnzbd.confd
new file mode 100644
index 000000000000..1dcaa94b8384
--- /dev/null
+++ b/net-nntp/sabnzbd/files/sabnzbd.confd
@@ -0,0 +1,8 @@
+SABNZBD_SERVER=0.0.0.0
+SABNZBD_PORT=8080
+SABNZBD_CONFIGFILE=/etc/sabnzbd/sabnzbd.ini
+SABNZBD_USER=sabnzbd
+SABNZBD_GROUP=sabnzbd
+
+# 0 - error/warnings, 1 - info, 2 - debug
+SABNZBD_LOGGING=1
diff --git a/net-nntp/sabnzbd/files/sabnzbd.initd b/net-nntp/sabnzbd/files/sabnzbd.initd
new file mode 100644
index 000000000000..b3e0af0ef4fc
--- /dev/null
+++ b/net-nntp/sabnzbd/files/sabnzbd.initd
@@ -0,0 +1,41 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-nntp/sabnzbd/files/sabnzbd.initd,v 1.1 2013/01/03 20:02:32 jsbronder Exp $
+
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting SABnzbd"
+
+ start-stop-daemon \
+ --quiet \
+ --start \
+ --user ${SABNZBD_USER} \
+ --group ${SABNZBD_GROUP} \
+ --name sabnzbd \
+ --exec /usr/bin/sabnzbd \
+ -- \
+ --server ${SABNZBD_SERVER}:${SABNZBD_PORT} \
+ --config-file ${SABNZBD_CONFIGFILE} \
+ --daemon
+ eend $?
+}
+
+stop() {
+ local api_key=$(awk '/^api_key =/{print $3}' ${SABNZBD_CONFIGFILE})
+ local hostname=${SABNZBD_SERVER}
+
+ ebegin "Stopping SABnzbd"
+
+ if [ -z "${hostname}" -o "${hostname}" == "0.0.0.0" ]; then
+ hostname="localhost"
+ fi
+ /usr/bin/wget -q --delete-after \
+ "http://${SABNZBD_SERVER}:${SABNZBD_PORT}/sabnzbd/api?mode=shutdown&apikey=${api_key}"
+ eend $?
+}
+
diff --git a/net-nntp/sabnzbd/files/use-system-configobj-and-feedparser.patch b/net-nntp/sabnzbd/files/use-system-configobj-and-feedparser.patch
new file mode 100644
index 000000000000..a55a54a01093
--- /dev/null
+++ b/net-nntp/sabnzbd/files/use-system-configobj-and-feedparser.patch
@@ -0,0 +1,44 @@
+From 89cb8b86fb087bc4706478ce4ec3ad5fd19602e6 Mon Sep 17 00:00:00 2001
+From: Justin Bronder <jsbronder@gmail.com>
+Date: Thu, 3 Jan 2013 04:10:37 -0500
+Subject: [PATCH] use system configobj and feedparser
+
+---
+ sabnzbd/config.py | 4 +++-
+ sabnzbd/rss.py | 2 +-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/sabnzbd/config.py b/sabnzbd/config.py
+index c3fc54c..cce2b14 100644
+--- a/sabnzbd/config.py
++++ b/sabnzbd/config.py
+@@ -23,10 +23,12 @@ import os
+ import logging
+ import threading
+ import shutil
++
++import configobj
++
+ import sabnzbd.misc
+ from sabnzbd.constants import CONFIG_VERSION, NORMAL_PRIORITY, DEFAULT_PRIORITY
+ from sabnzbd.utils import listquote
+-from sabnzbd.utils import configobj
+ from sabnzbd.decorators import synchronized
+
+ CONFIG_LOCK = threading.Lock()
+diff --git a/sabnzbd/rss.py b/sabnzbd/rss.py
+index 6fe6f5b..19a5d0f 100644
+--- a/sabnzbd/rss.py
++++ b/sabnzbd/rss.py
+@@ -35,7 +35,7 @@ from sabnzbd.misc import cat_convert, sanitize_foldername, wildcard_to_re, cat_t
+ import sabnzbd.emailer as emailer
+ from sabnzbd.encoding import latin1, unicoder, xml_name
+
+-import sabnzbd.utils.feedparser as feedparser
++import feedparser
+
+ __RSS = None # Global pointer to RSS-scanner instance
+
+--
+1.7.3.4
+
diff --git a/net-nntp/sabnzbd/metadata.xml b/net-nntp/sabnzbd/metadata.xml
new file mode 100644
index 000000000000..7b74c11c3766
--- /dev/null
+++ b/net-nntp/sabnzbd/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>jsbronder@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="rar">Add support for extracting rar files</flag>
+ <flag name="ssl">Add support for SSL web interface</flag>
+ <flag name="unzip">Add support for extracting zip files</flag>
+ </use>
+</pkgmetadata>
diff --git a/net-nntp/sabnzbd/sabnzbd-0.7.7.ebuild b/net-nntp/sabnzbd/sabnzbd-0.7.7.ebuild
new file mode 100644
index 000000000000..b1a129309d49
--- /dev/null
+++ b/net-nntp/sabnzbd/sabnzbd-0.7.7.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-nntp/sabnzbd/sabnzbd-0.7.7.ebuild,v 1.1 2013/01/03 20:02:32 jsbronder Exp $
+
+EAPI="4"
+
+# Require python-2 with sqlite USE flag
+PYTHON_DEPEND="2:2.6"
+PYTHON_USE_WITH="sqlite"
+
+inherit eutils python user
+
+MY_P="${P/sab/SAB}"
+
+DESCRIPTION="Binary newsgrabber with web-interface"
+HOMEPAGE="http://www.sabnzbd.org/"
+SRC_URI="mirror://sourceforge/sabnzbdplus/${MY_P}-src.tar.gz"
+
+# Sabnzbd is GPL-2 but bundles software with the following licenses.
+LICENSE="GPL-2 BSD LGPL-2 MIT BSD-1"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+rar +ssl unzip"
+
+# We actually depend on dev-python/cherrypy as well but upstream has decided
+# to bundle a custom cut of the 3.2.0 branch. Also, sabnzbd is installed to
+# /usr/share/ as upstream makes it clear they should not be in python's sitedir.
+# See: http://wiki.sabnzbd.org/unix-packaging
+
+# TODO: still bundled: kronos, rarfile, rsslib, ssmtplib, listquote, jso
+# Probably others, see licenses/
+
+RDEPEND="
+ >=app-arch/par2cmdline-0.4
+ >=dev-python/cheetah-2.0.1
+ dev-python/configobj
+ dev-python/feedparser
+ dev-python/gntp
+ dev-python/pythonutils
+ net-misc/wget
+ rar? ( app-arch/rar )
+ ssl? ( dev-python/pyopenssl )
+ unzip? ( >=app-arch/unzip-5.5.2 )
+"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ HOMEDIR="/var/lib/${PN}"
+ python_set_active_version 2
+ python_pkg_setup
+
+ # Create sabnzbd group
+ enewgroup ${PN}
+ # Create sabnzbd user, put in sabnzbd group
+ enewuser "${PN}" -1 -1 "${HOMEDIR}" "${PN}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/use-system-configobj-and-feedparser.patch
+
+ # remove bundled modules
+ rm sabnzbd/utils/{feedparser,configobj,gntp}.py
+ rm licenses/License-{feedparser,configobj,gntp}.txt
+}
+
+src_install() {
+ local d
+
+ dodir /usr/share/${PN}/sabnzbd
+ insinto /usr/share/${PN}/
+ doins SABnzbd.py
+ fperms +x /usr/share/${PN}/SABnzbd.py
+ dobin "${FILESDIR}"/sabnzbd
+
+ for d in cherrypy email icons interfaces locale po sabnzbd tools util; do
+ insinto /usr/share/${PN}/${d}
+ doins -r ${d}/*
+ done
+
+ newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+ newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+
+ diropts -o ${PN} -g ${PN}
+ dodir /etc/${PN}
+ dodir /var/log/${PN}
+
+ dodoc {ABOUT,CHANGELOG,ISSUES,README}.txt Sample-PostProc.sh licenses/*
+}
+
+pkg_postinst() {
+ python_mod_optimize /usr/share/${PN}
+
+ einfo "Default directory: ${HOMEDIR}"
+ einfo ""
+ einfo "Run: gpasswd -a <user> sabnzbd"
+ einfo "to add an user to the sabnzbd group so it can edit sabnzbd files"
+ einfo ""
+ einfo "By default sabnzbd will listen on 127.0.0.1:8080"
+}
+
+pkg_postrm() {
+ python_mod_cleanup /usr/share/${PN}
+}