From 41f847236acd896173d89cc4de8b0b894d19ebce Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Tue, 20 Nov 2007 14:43:08 +0000 Subject: import debian patchset: bind rpc to localhost by default, fix config file searching. Add a fix from tonfa to fix display in non daemon mode when multiple hosts are used (Portage version: 2.1.3.19) --- net-nntp/hellanzb/ChangeLog | 13 +++- net-nntp/hellanzb/files/digest-hellanzb-0.13-r1 | 3 - net-nntp/hellanzb/files/digest-hellanzb-0.13-r2 | 3 + ...hellanzb-0.13-Choose_interface_to_bind_on.patch | 52 ++++++++++++++ .../hellanzb-0.13-Fix_conf_file_search_path.patch | 31 +++++++++ .../files/hellanzb-0.13-fix_multiples_hosts.diff | 81 ++++++++++++++++++++++ net-nntp/hellanzb/hellanzb-0.13-r1.ebuild | 57 --------------- net-nntp/hellanzb/hellanzb-0.13-r2.ebuild | 60 ++++++++++++++++ 8 files changed, 239 insertions(+), 61 deletions(-) delete mode 100644 net-nntp/hellanzb/files/digest-hellanzb-0.13-r1 create mode 100644 net-nntp/hellanzb/files/digest-hellanzb-0.13-r2 create mode 100644 net-nntp/hellanzb/files/hellanzb-0.13-Choose_interface_to_bind_on.patch create mode 100644 net-nntp/hellanzb/files/hellanzb-0.13-Fix_conf_file_search_path.patch create mode 100644 net-nntp/hellanzb/files/hellanzb-0.13-fix_multiples_hosts.diff delete mode 100644 net-nntp/hellanzb/hellanzb-0.13-r1.ebuild create mode 100644 net-nntp/hellanzb/hellanzb-0.13-r2.ebuild (limited to 'net-nntp') diff --git a/net-nntp/hellanzb/ChangeLog b/net-nntp/hellanzb/ChangeLog index db8ba1ce1339..cc24afb8a9b3 100644 --- a/net-nntp/hellanzb/ChangeLog +++ b/net-nntp/hellanzb/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for net-nntp/hellanzb # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-nntp/hellanzb/ChangeLog,v 1.2 2007/04/11 17:53:10 swegener Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-nntp/hellanzb/ChangeLog,v 1.3 2007/11/20 14:43:07 aballier Exp $ + +*hellanzb-0.13-r2 (20 Nov 2007) + + 20 Nov 2007; Alexis Ballier + +files/hellanzb-0.13-Choose_interface_to_bind_on.patch, + +files/hellanzb-0.13-Fix_conf_file_search_path.patch, + +files/hellanzb-0.13-fix_multiples_hosts.diff, -hellanzb-0.13-r1.ebuild, + +hellanzb-0.13-r2.ebuild: + import debian patchset: bind rpc to localhost by default, fix config file + searching. Add a fix from tonfa to fix display in non daemon mode when + multiple hosts are used *hellanzb-0.13-r1 (05 Apr 2007) diff --git a/net-nntp/hellanzb/files/digest-hellanzb-0.13-r1 b/net-nntp/hellanzb/files/digest-hellanzb-0.13-r1 deleted file mode 100644 index 49b039d674c3..000000000000 --- a/net-nntp/hellanzb/files/digest-hellanzb-0.13-r1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 d3510c6b1b2c7b935332a469fdc8e7e2 hellanzb-0.13.tar.gz 163698 -RMD160 2ec3069cd0c9cb6c9fdaa4a4edc4f311a86d944c hellanzb-0.13.tar.gz 163698 -SHA256 565b08725eb92ac1e278fa7df2c7b27b21588c4e24c140fddbec4a5625159127 hellanzb-0.13.tar.gz 163698 diff --git a/net-nntp/hellanzb/files/digest-hellanzb-0.13-r2 b/net-nntp/hellanzb/files/digest-hellanzb-0.13-r2 new file mode 100644 index 000000000000..49b039d674c3 --- /dev/null +++ b/net-nntp/hellanzb/files/digest-hellanzb-0.13-r2 @@ -0,0 +1,3 @@ +MD5 d3510c6b1b2c7b935332a469fdc8e7e2 hellanzb-0.13.tar.gz 163698 +RMD160 2ec3069cd0c9cb6c9fdaa4a4edc4f311a86d944c hellanzb-0.13.tar.gz 163698 +SHA256 565b08725eb92ac1e278fa7df2c7b27b21588c4e24c140fddbec4a5625159127 hellanzb-0.13.tar.gz 163698 diff --git a/net-nntp/hellanzb/files/hellanzb-0.13-Choose_interface_to_bind_on.patch b/net-nntp/hellanzb/files/hellanzb-0.13-Choose_interface_to_bind_on.patch new file mode 100644 index 000000000000..a254a9d23c9a --- /dev/null +++ b/net-nntp/hellanzb/files/hellanzb-0.13-Choose_interface_to_bind_on.patch @@ -0,0 +1,52 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 001-Choose_interface_to_bind_on +## by Adam Cécile (Le_Vert) +## +## DP: Add a Hellanzb.XMLRPC_SERVER option which allowusers to set on which +## DP: IP address XMLRPC server will be binded. + +@DPATCH@ +diff -u hellanzb-0.11/Hellanzb/HellaXMLRPC/__init__.py hellanzb-0.11/Hellanzb/HellaXMLRPC/__init__.py.new +--- hellanzb-0.11/Hellanzb/HellaXMLRPC/__init__.py 2007-01-30 03:51:05.000000000 +0100 ++++ hellanzb-0.11/Hellanzb/HellaXMLRPC/__init__.py.new 2007-02-10 15:19:14.000000000 +0100 +@@ -597,9 +597,9 @@ + try: + if SECURE: + secure = HtPasswdWrapper(hxmlrpcs, 'hellanzb', Hellanzb.XMLRPC_PASSWORD, 'hellanzb XML RPC') +- reactor.listenTCP(Hellanzb.XMLRPC_PORT, Site(secure)) ++ reactor.listenTCP(Hellanzb.XMLRPC_PORT, Site(secure), 50, Hellanzb.XMLRPC_SERVER_BIND) + else: +- reactor.listenTCP(Hellanzb.XMLRPC_PORT, Site(hxmlrpcs)) ++ reactor.listenTCP(Hellanzb.XMLRPC_PORT, Site(hxmlrpcs), 50, Hellanzb.XMLRPC_SERVER_BIND) + except CannotListenError, cle: + error(str(cle)) + raise FatalError('Cannot bind to XML RPC port, is another hellanzb queue daemon already running?') + +diff -u hellanzb-0.11/etc/hellanzb.conf.sample hellanzb-0.11/etc/hellanzb.conf.sample.new +--- hellanzb-0.11/etc/hellanzb.conf.sample 2007-01-30 03:51:05.000000000 +0100 ++++ hellanzb-0.11/etc/hellanzb.conf.sample.new 2007-02-10 15:18:10.000000000 +0100 +@@ -151,6 +151,10 @@ + # Hostname for the XMLRPC client to connect to. By default, localhost + Hellanzb.XMLRPC_SERVER = 'localhost' + ++# IP address on which the XMLRPC Server will be binded to. ++# Type '0.0.0.0' for any interfaces, '127.0.0.1' will disable remote access ++Hellanzb.XMLRPC_SERVER_BIND = '127.0.0.1' ++ + # Port number the XML RPC server will listen on, and the client will connect to. + # Set to 'None' (without the quotes!) for no XML RPC server + Hellanzb.XMLRPC_PORT = 8760 +diff -u hellanzb-0.11/Hellanzb/Core.py hellanzb-0.11/Hellanzb/Core.py.new +--- hellanzb-0.11/Hellanzb/Core.py 2007-01-30 03:51:05.000000000 +0100 ++++ hellanzb-0.11/Hellanzb/Core.py.new 2007-02-10 15:18:10.000000000 +0100 +@@ -113,7 +106,9 @@ + + if not hasattr(Hellanzb, 'SKIP_UNRAR') or Hellanzb.SKIP_UNRAR is None: + Hellanzb.SKIP_UNRAR = False +- ++ if not hasattr(Hellanzb, 'XMLRPC_SERVER_BIND') or Hellanzb.XMLRPC_SERVER_BIND is None: ++ print 'Warning: Hellanzb.XMLRPC_SERVER_BIND is not set, bind to 127.0.0.1' ++ Hellanzb.XMLRPC_SERVER_BIND = '127.0.0.1' + + if not hasattr(Hellanzb, 'SMART_PAR'): + Hellanzb.SMART_PAR = True diff --git a/net-nntp/hellanzb/files/hellanzb-0.13-Fix_conf_file_search_path.patch b/net-nntp/hellanzb/files/hellanzb-0.13-Fix_conf_file_search_path.patch new file mode 100644 index 000000000000..ee22dd20c1ed --- /dev/null +++ b/net-nntp/hellanzb/files/hellanzb-0.13-Fix_conf_file_search_path.patch @@ -0,0 +1,31 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 000-Fix_conf_file_search_path by +## Adam Cécile (Le_Vert) +## +## DP: Search for configuration file in $HOME/.hellanzb/ or /etc/ + +@DPATCH@ + +diff -u hellanzb-0.11/Hellanzb/Core.py hellanzb-0.11/Hellanzb/Core.py.new +--- hellanzb-0.11/Hellanzb/Core.py 2007-02-10 15:01:50.000000000 +0100 ++++ hellanzb-0.11/Hellanzb/Core.py.new 2007-02-10 15:05:48.000000000 +0100 +@@ -33,16 +33,9 @@ + else: + error('Unable to load specified config file: ' + optionalConfigFile) + sys.exit(1) +- +- # look for conf in this order: sys.prefix, ./, or ./etc/ +- confDirs = [os.path.join(sys.prefix, 'etc')] +- try: +- confDirs.append(os.path.join(os.getcwd(), 'etc')) +- confDirs.append(os.getcwd()) +- except OSError, ose: +- if ose.errno != 2: +- raise +- # OSError: [Errno 2] No such file or directory. cwd doesn't exist ++ ++ # Look for conf file in /etc or $HOME/.hellanzb ++ confDirs = [ os.path.expanduser('~') + '/.hellanzb', '/etc' ] + + # hard coding preferred Darwin config file location, kind of lame. but I'd rather do + # this then make an etc dir in os x's Python.framework directory diff --git a/net-nntp/hellanzb/files/hellanzb-0.13-fix_multiples_hosts.diff b/net-nntp/hellanzb/files/hellanzb-0.13-fix_multiples_hosts.diff new file mode 100644 index 000000000000..695c62ce3bc4 --- /dev/null +++ b/net-nntp/hellanzb/files/hellanzb-0.13-fix_multiples_hosts.diff @@ -0,0 +1,81 @@ +diff -r bdbcba80e0fa Hellanzb/NZBLeecher/Protocol.py +--- a/Hellanzb/NZBLeecher/Protocol.py Wed Nov 14 10:00:29 2007 +0100 ++++ b/Hellanzb/NZBLeecher/Protocol.py Wed Nov 14 10:01:07 2007 +0100 +@@ -27,18 +27,14 @@ PHI = 1.6180339887498948 # (1 + math.sqr + PHI = 1.6180339887498948 # (1 + math.sqrt(5)) / 2 + class NZBLeecherFactory(ReconnectingClientFactory): + +- def __init__(self, username, password, activeTimeout, antiIdleTimeout, hostname, ++ def __init__(self, username, password, activeTimeout, antiIdleTimeout, + serverPoolName, skipGroupCmd, fillServerPriority = 0, color = None): + self.username = username + self.password = password + self.antiIdleTimeout = antiIdleTimeout + self.activeTimeout = activeTimeout +- self.hostname = hostname + self.serverPoolName = serverPoolName + self.fillServerPriority = fillServerPriority +- +- self.host = None +- self.port = None + + # statistics for the current session (sessions end when downloading stops on all + # clients). sessionReadBytes and sessionStartime are used to calculate the average +diff -r bdbcba80e0fa Hellanzb/NZBLeecher/__init__.py +--- a/Hellanzb/NZBLeecher/__init__.py Wed Nov 14 10:00:29 2007 +0100 ++++ b/Hellanzb/NZBLeecher/__init__.py Wed Nov 14 10:01:07 2007 +0100 +@@ -122,30 +122,28 @@ def connectServer(serverName, serverDict + connectionCount = 0 + hosts = serverDict['hosts'] + connections = int(serverDict['connections']) ++ antiIdle = int(setWithDefault(serverDict, 'antiIdle', defaultAntiIdle)) ++ idleTimeout = int(setWithDefault(serverDict, 'idleTimeout', defaultIdleTimeout)) ++ skipGroupCmd = setWithDefault(serverDict, 'skipGroupCmd', False) ++ fillServer = setWithDefault(serverDict, 'fillserver', 0) ++ useSSL = setWithDefault(serverDict, 'ssl', False) ++ ++ nsf = NZBLeecherFactory(serverDict['username'], serverDict['password'], ++ idleTimeout, antiIdle, serverName, skipGroupCmd, ++ fillServer) ++ color = nsf.color ++ Hellanzb.nsfs.append(nsf) ++ ++ preWrappedNsf = nsf ++ nsf = HellaThrottlingFactory(nsf) + + for host in hosts: +- antiIdle = int(setWithDefault(serverDict, 'antiIdle', defaultAntiIdle)) +- idleTimeout = int(setWithDefault(serverDict, 'idleTimeout', defaultIdleTimeout)) +- skipGroupCmd = setWithDefault(serverDict, 'skipGroupCmd', False) +- fillServer = setWithDefault(serverDict, 'fillserver', 0) +- useSSL = setWithDefault(serverDict, 'ssl', False) +- +- nsf = NZBLeecherFactory(serverDict['username'], serverDict['password'], +- idleTimeout, antiIdle, host, serverName, skipGroupCmd, +- fillServer) +- color = nsf.color +- Hellanzb.nsfs.append(nsf) +- + split = host.split(':') + host = split[0] + if len(split) == 2: + port = int(split[1]) + else: + port = 119 +- nsf.host, nsf.port = host, port +- +- preWrappedNsf = nsf +- nsf = HellaThrottlingFactory(nsf) + + ctxf = None + if useSSL: +@@ -195,7 +193,8 @@ def connectServer(serverName, serverDict + if antiIdle == 0: + preWrappedNsf.leecherConnectors.append(connector) + connectionCount += 1 +- preWrappedNsf.setConnectionCount(connectionCount) ++ ++ preWrappedNsf.setConnectionCount(connectionCount) + + if antiIdle == 0: + action = '' diff --git a/net-nntp/hellanzb/hellanzb-0.13-r1.ebuild b/net-nntp/hellanzb/hellanzb-0.13-r1.ebuild deleted file mode 100644 index 16ee7aca43bd..000000000000 --- a/net-nntp/hellanzb/hellanzb-0.13-r1.ebuild +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-nntp/hellanzb/hellanzb-0.13-r1.ebuild,v 1.1 2007/04/05 18:35:25 aballier Exp $ - -inherit distutils eutils - -DESCRIPTION="Retrieves and processes .nzb files" -HOMEPAGE="http://www.hellanzb.com/" -SRC_URI="http://www.hellanzb.com/distfiles/${P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~x86 ~amd64" -IUSE="libnotify" - -RDEPEND=">=dev-python/twisted-2.0 - dev-python/twisted-web - || ( app-arch/unrar - app-arch/rar ) - app-arch/par2cmdline - libnotify? ( dev-python/notify-python )" - -DEPEND="" - -DOCS="CHANGELOG CREDITS PKG-INFO README" - -src_unpack() { - unpack ${A} - cd "${S}" - - epatch "${FILESDIR}/${P}-datafiles.patch" -} - -src_install() { - distutils_src_install - - newconfd "${FILESDIR}/hellanzb.conf" hellanzb - newinitd "${FILESDIR}/hellanzb.init" hellanzb - - insinto etc - doins etc/hellanzb.conf.sample -} - -pkg_postinst() { - elog "You can start hellanzb in the background automatically by using" - elog "the init-script. To do this, add it to your default runlevel:" - elog "" - elog " rc-update add hellanzb default" - elog "" - elog "Use this command to start the daemon now:" - elog "" - elog " /etc/init.d/hellanzb start" - elog "" - elog "You will have to config /etc/conf.d/hellanzb before the init-script" - elog "will work. It is recommended that you change the user under which" - elog "the daemon will run." -} diff --git a/net-nntp/hellanzb/hellanzb-0.13-r2.ebuild b/net-nntp/hellanzb/hellanzb-0.13-r2.ebuild new file mode 100644 index 000000000000..a7e73ebbcd07 --- /dev/null +++ b/net-nntp/hellanzb/hellanzb-0.13-r2.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-nntp/hellanzb/hellanzb-0.13-r2.ebuild,v 1.1 2007/11/20 14:43:07 aballier Exp $ + +inherit distutils eutils + +DESCRIPTION="Retrieves and processes .nzb files" +HOMEPAGE="http://www.hellanzb.com/" +SRC_URI="http://www.hellanzb.com/distfiles/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~x86 ~amd64" +IUSE="libnotify" + +RDEPEND=">=dev-python/twisted-2.0 + dev-python/twisted-web + || ( app-arch/unrar + app-arch/rar ) + app-arch/par2cmdline + libnotify? ( dev-python/notify-python )" + +DEPEND="" + +DOCS="CHANGELOG CREDITS PKG-INFO README" + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}/${P}-datafiles.patch" + epatch "${FILESDIR}/${P}-Fix_conf_file_search_path.patch" + epatch "${FILESDIR}/${P}-Choose_interface_to_bind_on.patch" + epatch "${FILESDIR}/${P}-fix_multiples_hosts.diff" +} + +src_install() { + distutils_src_install + + newconfd "${FILESDIR}/hellanzb.conf" hellanzb + newinitd "${FILESDIR}/hellanzb.init" hellanzb + + insinto etc + doins etc/hellanzb.conf.sample +} + +pkg_postinst() { + elog "You can start hellanzb in the background automatically by using" + elog "the init-script. To do this, add it to your default runlevel:" + elog "" + elog " rc-update add hellanzb default" + elog "" + elog "Use this command to start the daemon now:" + elog "" + elog " /etc/init.d/hellanzb start" + elog "" + elog "You will have to config /etc/conf.d/hellanzb before the init-script" + elog "will work. It is recommended that you change the user under which" + elog "the daemon will run." +} -- cgit v1.2.3-65-gdbad