--- pydirector-1.0.0.orig/debian/README.Debian +++ pydirector-1.0.0/debian/README.Debian @@ -0,0 +1,8 @@ +pydyrecotor for Debian +====================== + +This package has the necessary patches applied to work with the +twisted-calendarserver and calendarserver packages. See debian/patches/ in the +source package for details. + + -- Guido Guenther Thu, 30 Apr 2008 12:47:56 +0100 --- pydirector-1.0.0.orig/debian/changelog +++ pydirector-1.0.0/debian/changelog @@ -0,0 +1,19 @@ +pydirector (1.0.0-2.1) unstable; urgency=medium + + * Non-maintainer upload. + * Build using dh-python. Closes: #786336. + + -- Matthias Klose Tue, 18 Aug 2015 16:46:11 +0200 + +pydirector (1.0.0-2) unstable; urgency=low + + * [0c3d2c0] Fix typo in maintainer address (Closes: #584568) + + -- Guido Günther Tue, 26 Jul 2011 00:49:20 +0200 + +pydirector (1.0.0-1) unstable; urgency=low + + * Initial release (Closes: #414849) + + -- Guido Guenther Sat, 04 Aug 2007 13:38:16 +0200 + --- pydirector-1.0.0.orig/debian/compat +++ pydirector-1.0.0/debian/compat @@ -0,0 +1 @@ +5 --- pydirector-1.0.0.orig/debian/control +++ pydirector-1.0.0/debian/control @@ -0,0 +1,21 @@ +Source: pydirector +Section: python +Priority: extra +Maintainer: Debian Calendarserver Team +Uploaders: Guido Günther +Build-Depends: cdbs, debhelper (>= 5), python-all-dev, dh-python, python-setuptools, quilt +Vcs-Git: git://git.debian.org/git/calendarserver/pydirector.git +Vcs-Browser: http://git.debian.org/?p=calendarserver/pydirector.git +Standards-Version: 3.7.3 + +Package: python-pydirector +Architecture: all +Depends: ${python:Depends}, ${misc:Depends}, python-twisted-core +XB-Python-Version: ${python:Versions} +Description: pure Python TCP load balancer + pydirector takes inbound TCP connections and connects them to one of a number + of backend servers. It's + * async I/O based + * supports multiple scheduling algorithms like random, round robin, + leastconns, last recently used + * transparently detects failed servers --- pydirector-1.0.0.orig/debian/copyright +++ pydirector-1.0.0/debian/copyright @@ -0,0 +1,37 @@ +This package was debianized by Guido Guenther on +Sat, 04 Aug 2007 13:03:55 +0200. + +It was downloaded from http://pythondirector.sourceforge.net/ + +Upstream Author: + + Anthony Baxter + +Copyright: + + Copyright (c) 2002-2003 ekit.com Inc (http://www.ekit-inc.com/) and Anthony + Baxter (anthony@interlink.com.au) + +License: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +The Debian packaging is (C) 2007, Guido Guenther and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. + --- pydirector-1.0.0.orig/debian/docs +++ pydirector-1.0.0/debian/docs @@ -0,0 +1,7 @@ +BUGS.txt +TODO.txt +doc/configure.txt +doc/README.txt +doc/schedulers.txt +doc/webapi.txt +doc/xmlreference.txt --- pydirector-1.0.0.orig/debian/examples +++ pydirector-1.0.0/debian/examples @@ -0,0 +1 @@ +confex.xml --- pydirector-1.0.0.orig/debian/patches/pydirector.pdamp.patch +++ pydirector-1.0.0/debian/patches/pydirector.pdamp.patch @@ -0,0 +1,37 @@ +--- pydirector/pdamp.py 1969-12-31 16:00:00.000000000 -0800 ++++ pydirector/pdamp.py 2007-04-10 17:25:22.000000000 -0700 +@@ -0,0 +1,34 @@ ++from twisted.internet import protocol ++from twisted.protocols import amp ++ ++class UnknownPortError(Exception): ++ pass ++ ++class GetClientAddress(amp.Command): ++ arguments = [('host', amp.String()), ++ ('port', amp.Integer())] ++ ++ response = [('host', amp.String()), ++ ('port', amp.Integer())] ++ ++ errors = {UnknownPortError: 'UNKNOWN_PORT'} ++ ++ ++class PDControlProtocol(amp.AMP): ++ def __init__(self, director): ++ self.director = director ++ ++ def getClientAddress(self, host, port): ++ host, port = self.director.getClientAddress(host, port) ++ if (host, port) == (None, None): ++ raise UnknownPortError() ++ ++ return {'host': host, 'port': port} ++ GetClientAddress.responder(getClientAddress) ++ ++class PDControlFactory(protocol.ServerFactory): ++ def __init__(self, director): ++ self.director = director ++ ++ def buildProtocol(self, addr): ++ return PDControlProtocol(self.director) --- pydirector-1.0.0.orig/debian/patches/pydirector.pdconf.patch +++ pydirector-1.0.0/debian/patches/pydirector.pdconf.patch @@ -0,0 +1,30 @@ +--- pydirector/pdconf.py 2004-12-14 05:31:39.000000000 -0800 ++++ pydirector/pdconf.py 2007-04-10 17:25:31.000000000 -0700 +@@ -174,7 +174,7 @@ + + + class PDConfig(object): +- __slots__ = [ 'services', 'admin', 'dom' ] ++ __slots__ = [ 'services', 'admin', 'dom', 'socket' ] + + def __init__(self, filename=None, xml=None): + import pdlogging +@@ -186,7 +186,8 @@ + dom.nodeName) + for item in dom.childNodes: + if item.nodeName in ("#text", "#comment"): continue +- if item.nodeName not in ( u'service', u'admin', u'logging' ): ++ if item.nodeName not in ( u'service', u'admin', ++ u'logging', u'control' ): + raise ConfigError, \ + "expected 'service' or 'admin', got '%s'"%item.nodeName + if item.nodeName == u'service': +@@ -198,6 +199,8 @@ + raise ConfigError, "only one 'admin' block allowed" + elif item.nodeName == u'logging': + pdlogging.initlog(item.getAttribute('file')) ++ elif item.nodeName == u'control': ++ self.socket = item.getAttribute('socket') + + def _loadDOM(self, filename, xml): + from xml.dom.minidom import parseString --- pydirector-1.0.0.orig/debian/patches/pydirector.pdmain.patch +++ pydirector-1.0.0/debian/patches/pydirector.pdmain.patch @@ -0,0 +1,42 @@ +--- pydirector/pdmain.py 2004-12-14 05:31:39.000000000 -0800 ++++ pydirector/pdmain.py 2007-04-10 17:25:12.000000000 -0700 +@@ -9,6 +9,9 @@ + if sys.version_info < (2,2): + class object: pass + ++from twisted.internet import reactor ++from pydirector import pdamp ++ + class PythonDirector(object): + + def __init__(self, config): +@@ -17,8 +20,17 @@ + self.schedulers = {} + self.manager = None + self.conf = pdconf.PDConfig(config) ++ self._connections = {} + self.createManager() + self.createListeners() ++ reactor.listenUNIX(self.conf.socket, ++ pdamp.PDControlFactory(self)) ++ ++ def getClientAddress(self, host, port): ++ return self._connections.get((host, port), (None, None)) ++ ++ def setClientAddress(self, host, peer): ++ self._connections[host] = peer + + def start(self, profile=0): + import sys +@@ -69,8 +81,9 @@ + self.listeners[service.name] = [] + for lobj in service.listen: + l = pdnetwork.Listener(service.name, +- pdconf.splitHostPort(lobj), +- scheduler) ++ pdconf.splitHostPort(lobj), ++ scheduler, ++ self) + self.listeners[service.name].append(l) + + def enableGroup(self, serviceName, groupName): --- pydirector-1.0.0.orig/debian/patches/pydirector.pdnetworktwisted.patch +++ pydirector-1.0.0/debian/patches/pydirector.pdnetworktwisted.patch @@ -0,0 +1,55 @@ +--- pydirector/pdnetworktwisted.py 2007-06-27 11:42:28.000000000 -0700 ++++ pydirector/pdnetworktwisted.py 2007-06-27 11:40:37.000000000 -0700 +@@ -28,10 +28,13 @@ + attribute .listening_address: read - a tuple of (host,port) + """ + +- def __init__(self, name, (bindhost, bindport), scheduler): ++ def __init__(self, name, (bindhost, bindport), scheduler, director): + self.name = name + self.listening_address = (bindhost, bindport) +- self.rfactory = ReceiverFactory((bindhost,bindport), scheduler) ++ self.director = director ++ self.rfactory = ReceiverFactory((bindhost,bindport), ++ scheduler, ++ self.director) + self.setScheduler(scheduler) + reactor.listenTCP(bindport, self.rfactory, interface=bindhost) + +@@ -58,7 +61,7 @@ + """ + if self.receiver is not None: + if reason.type is twisted.internet.error.ConnectionDone: +- return ++ pass + elif reason.type is twisted.internet.error.ConnectionLost: + pass + else: +@@ -79,6 +82,14 @@ + it's ok to send any buffered data from the client. + """ + #print "client connection",self.factory ++ #XXX: OMG THIS IS HORRIBLE ++ inSrc = self.receiver.transport.getPeer() ++ outSrc = self.transport.getHost() ++ ++ self.receiver.factory.director.setClientAddress( ++ (outSrc.host, outSrc.port), ++ (inSrc.host, inSrc.port)) ++ + if self.receiver.receiverOk: + self.receiver.setSender(self) + else: +@@ -197,10 +208,11 @@ + protocol = Receiver + noisy = 0 + +- def __init__(self, (bindhost, bindport), scheduler): ++ def __init__(self, (bindhost, bindport), scheduler, director): + self.bindhost = bindhost + self.bindport = bindport + self.scheduler = scheduler ++ self.director = director + + def setScheduler(self, scheduler): + self.scheduler = scheduler --- pydirector-1.0.0.orig/debian/patches/series +++ pydirector-1.0.0/debian/patches/series @@ -0,0 +1,5 @@ +pydirector.pdamp.patch -p0 +pydirector.pdconf.patch -p0 +pydirector.pdmain.patch -p0 +pydirector.pdnetworktwisted.patch -p0 +setup.patch -p0 --- pydirector-1.0.0.orig/debian/patches/setup.patch +++ pydirector-1.0.0/debian/patches/setup.patch @@ -0,0 +1,12 @@ +diff -u setup.py setup.new.py +--- setup.py 2007-01-19 11:36:00.000000000 -0800 ++++ setup.new.py 2007-01-19 11:34:37.000000000 -0800 +@@ -18,7 +18,7 @@ + author_email = "anthony@interlink.com.au", + url = 'http://sourceforge.net/projects/pythondirector/', + packages = ['pydirector'], +- scripts = ['pydir.py'], ++ scripts = ['pydir.py', 'pydir++.py'], + classifiers = [ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Web Environment', --- pydirector-1.0.0.orig/debian/pycompat +++ pydirector-1.0.0/debian/pycompat @@ -0,0 +1 @@ +2 --- pydirector-1.0.0.orig/debian/pyversions +++ pydirector-1.0.0/debian/pyversions @@ -0,0 +1 @@ +2.4- --- pydirector-1.0.0.orig/debian/rules +++ pydirector-1.0.0/debian/rules @@ -0,0 +1,8 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/python-distutils.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk + +DEB_PYTHON_CLEAN_ARGS = --all +DEB_PYTHON_INSTALL_ARGS_ALL = --install-scripts=/usr/share/pydirector