diff options
-rw-r--r-- | .SRCINFO | 28 | ||||
-rw-r--r-- | PKGBUILD | 55 | ||||
-rw-r--r-- | fix-import.patch | 63 | ||||
-rw-r--r-- | twisted-13.patch | 192 |
4 files changed, 338 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..a95ed9b604f8 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = flumotion + pkgdesc = A streaming media server + pkgver = 0.10.1 + pkgrel = 4 + url = http://www.flumotion.net + arch = i686 + arch = x86_64 + license = GPL + makedepends = perl-xml-parser + depends = gstreamer0.10-base-plugins + depends = gstreamer0.10-good-plugins + depends = gstreamer0.10-python + depends = kiwi + depends = pygtk + depends = python2-crypto + depends = python2-pyopenssl + depends = python2-twisted + backup = etc/flumotion/workers/default.xml + backup = etc/flumotion/managers/default/planet.xml + source = http://www.flumotion.net/src/flumotion/flumotion-0.10.1.tar.bz2 + source = twisted-13.patch + source = fix-import.patch + md5sums = fbbb2f4ccf0624742c5ca8238f3ec5e0 + md5sums = 67c870a226d14afb6d391ae6386a0fa3 + md5sums = 8f8f1859059b91ebd9e9828f2f52a701 + +pkgname = flumotion + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..cf84d6edf3bf --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,55 @@ +# $Id: PKGBUILD 125634 2015-01-08 22:36:46Z bgyorgy $ +# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Contributor: Geoffroy Carrier <geoffroy.carrier@koon.fr> +# Contributor: William Rea <sillywilly@gmail.com> + +pkgname=flumotion +pkgver=0.10.1 +pkgrel=4 +arch=('i686' 'x86_64') +pkgdesc="A streaming media server" +url="http://www.flumotion.net" +license=('GPL') +backup=(etc/flumotion/workers/default.xml + etc/flumotion/managers/default/planet.xml) +depends=('gstreamer0.10-base-plugins' 'gstreamer0.10-good-plugins' 'gstreamer0.10-python' 'kiwi' + 'pygtk' 'python2-crypto' 'python2-pyopenssl' 'python2-twisted') +makedepends=('perl-xml-parser') +source=(http://www.flumotion.net/src/$pkgname/$pkgname-$pkgver.tar.bz2 + twisted-13.patch + fix-import.patch) +md5sums=('fbbb2f4ccf0624742c5ca8238f3ec5e0' + '67c870a226d14afb6d391ae6386a0fa3' + '8f8f1859059b91ebd9e9828f2f52a701') + +prepare() { + cd "$srcdir/$pkgname-$pkgver" + + # Compatibily fix with twisted 13 + patch -Np1 -i ../twisted-13.patch + + # Fix import with recent python2 + patch -Np1 -i ../fix-import.patch + + # python2 fix + sed -i 's_candidate in python_candidate in python2_' configure + for file in $(find . -name '*.py' -print); do + sed -i 's_^#!.*/usr/bin/python_#!/usr/bin/python2_' $file + sed -i 's_^#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' $file + done +} + +build() { + cd "$srcdir/$pkgname-$pkgver" + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --sbindir=/usr/bin + make +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + install -d "$pkgdir/etc/$pkgname" + make DESTDIR="$pkgdir" install + cp -R conf/workers "$pkgdir/etc/$pkgname" + cp -R conf/managers "$pkgdir/etc/$pkgname" + cp conf/default.pem "$pkgdir/etc/$pkgname" +} diff --git a/fix-import.patch b/fix-import.patch new file mode 100644 index 000000000000..904ffe6faced --- /dev/null +++ b/fix-import.patch @@ -0,0 +1,63 @@ +From ebd389075f48253a12a71e457445a05f4373fe5e Mon Sep 17 00:00:00 2001 +From: Tim 'mithro' Ansell <mithro@mithis.com> +Date: Mon, 28 Jul 2014 01:01:59 +0930 +Subject: [PATCH] Removing the _PatchedModuleImporter hook. + +The _PatchedModuleImporter didn't pass through the level argument which is +needed for the future absolute_import to work properly. + +```python +from __future__ import absolute_import +``` +--- + flumotion/common/package.py | 30 +----------------------------- + 1 file changed, 1 insertion(+), 29 deletions(-) + +diff --git a/flumotion/common/package.py b/flumotion/common/package.py +index 5dbb05c..d41c04a 100644 +--- a/flumotion/common/package.py ++++ b/flumotion/common/package.py +@@ -31,29 +31,6 @@ + __version__ = "$Rev$" + + +-class _PatchedModuleImporter(ihooks.ModuleImporter): +- """ +- I am overriding ihook's ModuleImporter's import_module() method to +- accept (and ignore) the 'level' keyword argument that appeared in +- the built-in __import__() function in python2.5. +- +- While no built-in modules in python2.5 seem to use that keyword +- argument, 'encodings' module in python2.6 does and so it breaks if +- used together with ihooks. +- +- I make no attempt to properly support the 'level' argument - +- ihooks didn't make it into py3k, and the only use in python2.6 +- we've seen so far, in 'encodings', serves as a performance hint +- and it seems that can be ignored with no difference in behaviour. +- """ +- +- def import_module(self, name, globals=None, locals=None, fromlist=None, +- level=-1): +- # all we do is drop 'level' as ihooks don't support it, anyway +- return ihooks.ModuleImporter.import_module(self, name, globals, +- locals, fromlist) +- +- + class PackageHooks(ihooks.Hooks): + """ + I am an import Hooks object that makes sure that every package that gets +@@ -106,12 +83,7 @@ def install(self): + self.debug('installing custom importer') + self._hooks = PackageHooks() + self._hooks.packager = self +- if sys.version_info < (2, 6): +- self._importer = ihooks.ModuleImporter() +- else: +- self.debug('python2.6 or later detected - using patched' +- ' ModuleImporter') +- self._importer = _PatchedModuleImporter() ++ self._importer = ihooks.ModuleImporter() + self._importer.set_hooks(self._hooks) + self._importer.install() + diff --git a/twisted-13.patch b/twisted-13.patch new file mode 100644 index 000000000000..040827f71316 --- /dev/null +++ b/twisted-13.patch @@ -0,0 +1,192 @@ +From cd9c9cf9f93bc4043522e5994410bb92cb281209 Mon Sep 17 00:00:00 2001 +From: equinox <equinox@chaos-at-home.org> +Date: Thu, 30 Jan 2014 22:49:17 +0100 +Subject: [PATCH] fixed usage of deprecated functions listenWith and + connectWith + +Hi, + +Beginning with python twisted 13 the deprecated functions listenWith +and connectWith were removed. This prevents flumotion from being used +on current Ubuntu releases and will be unusable with Debian Jessie. +My attached patch fixes the problem. + +regards + christian + +Signed-off-by: Christian Pointner <equinox@spreadspace.org> +--- + flumotion/component/common/streamer/streamer.py | 12 ++++++------ + flumotion/component/feed.py | 6 ++++-- + flumotion/component/misc/httpserver/httpserver.py | 10 ++++++---- + flumotion/component/misc/porter/porter.py | 18 ++++++++++++------ + flumotion/job/main.py | 5 +++-- + flumotion/worker/base.py | 8 +++++++- + flumotion/worker/feedserver.py | 8 ++++++-- + 7 files changed, 44 insertions(+), 23 deletions(-) + +diff --git a/flumotion/component/common/streamer/streamer.py b/flumotion/component/common/streamer/streamer.py +index cc6591f..194c5cb 100644 +--- a/flumotion/component/common/streamer/streamer.py ++++ b/flumotion/component/common/streamer/streamer.py +@@ -561,9 +561,9 @@ def updatePorterDetails(self, path, username, password): + self._pbclient.stopTrying() # Stop trying to connect with the + # old connector. + self._pbclient.resetDelay() +- reactor.connectWith( +- fdserver.FDConnector, self._porterPath, +- self._pbclient, 10, checkPID=False) ++ c = fdserver.FDConnector(self._porterPath, self._pbclient, ++ 10, checkPID=False, reactor=reactor) ++ c.connect() + else: + raise errors.WrongStateError( + "Can't specify porter details in master mode") +@@ -624,9 +624,9 @@ def do_setup(self): + + self.info("Starting porter login at \"%s\"", self._porterPath) + # This will eventually cause d to fire +- reactor.connectWith( +- fdserver.FDConnector, self._porterPath, +- self._pbclient, 10, checkPID=False) ++ c = fdserver.FDConnector(self._porterPath, self._pbclient, ++ 10, checkPID=False, reactor=reactor) ++ c.connect() + else: + # Streamer is standalone. + try: +diff --git a/flumotion/component/feed.py b/flumotion/component/feed.py +index 2f23ac2..9646975 100644 +--- a/flumotion/component/feed.py ++++ b/flumotion/component/feed.py +@@ -135,8 +135,10 @@ def startConnecting(self, host, port, authenticator, timeout=30, + """ + assert self._factory is None + self._factory = FeedClientFactory(self) +- reactor.connectWith(PassableClientConnector, host, port, +- self._factory, timeout, bindAddress) ++ c = PassableClientConnector(host, port, self._factory, timeout, ++ bindAddress, reactor=reactor) ++ c.connect() ++ + return self._factory.login(authenticator) + + def requestFeed(self, host, port, authenticator, fullFeedId): +diff --git a/flumotion/component/misc/httpserver/httpserver.py b/flumotion/component/misc/httpserver/httpserver.py +index c83b943..40fe10b 100644 +--- a/flumotion/component/misc/httpserver/httpserver.py ++++ b/flumotion/component/misc/httpserver/httpserver.py +@@ -408,8 +408,9 @@ def do_setup(self): + self._pbclient.startLogin(creds, self._pbclient.medium) + self.info("Logging to porter on socketPath %s", self._porterPath) + # This will eventually cause d to fire +- reactor.connectWith(fdserver.FDConnector, self._porterPath, +- self._pbclient, 10, checkPID=False) ++ c = fdserver.FDConnector(self._porterPath, self._pbclient, 10, ++ checkPID=False, reactor=reactor) ++ c.connect() + else: + # File Streamer is standalone. + try: +@@ -500,8 +501,9 @@ def _updatePath(self, path): + self._pbclient.stopTrying() + + self._pbclient.resetDelay() +- reactor.connectWith(fdserver.FDConnector, self._porterPath, +- self._pbclient, 10, checkPID=False) ++ c = fdserver.FDConnector(self._porterPath, self._pbclient, 10, ++ checkPID=False, reactor=reactor) ++ c.connect() + + def _timeoutRequests(self): + self._timeoutRequestsCallLater = None +diff --git a/flumotion/component/misc/porter/porter.py b/flumotion/component/misc/porter/porter.py +index 58a30e0..d76c485 100644 +--- a/flumotion/component/misc/porter/porter.py ++++ b/flumotion/component/misc/porter/porter.py +@@ -323,9 +323,15 @@ def do_setup(self): + except OSError: + pass + +- self._socketlistener = reactor.listenWith( +- fdserver.FDPort, self._socketPath, +- serverfactory, mode=self._socketMode) ++ # listenWith is deprecated but the function never did much anyway ++ # ++ # self._socketlistener = reactor.listenWith( ++ # fdserver.FDPort, self._socketPath, ++ # serverfactory, mode=self._socketMode) ++ self._socketlistener = fdserver.FDPort(self._socketPath, ++ serverfactory, reactor=reactor, mode=self._socketMode) ++ self._socketlistener.startListening() ++ + self.info("Now listening on socketPath %s", self._socketPath) + except error.CannotListenError: + self.warning("Failed to create socket %s" % self._socketPath) +@@ -350,9 +356,9 @@ def do_setup(self): + # appropriate protocol (HTTP, RTSP, etc.) + factory = PorterProtocolFactory(self, proto) + try: +- reactor.listenWith( +- fdserver.PassableServerPort, self._port, factory, +- interface=self._interface) ++ p = fdserver.PassableServerPort(self._port, factory, ++ interface=self._interface, reactor=reactor) ++ p.startListening() + self.info("Now listening on interface %r on port %d", + self._interface, self._port) + except error.CannotListenError: +diff --git a/flumotion/job/main.py b/flumotion/job/main.py +index 4109643..2241df0 100644 +--- a/flumotion/job/main.py ++++ b/flumotion/job/main.py +@@ -52,8 +52,9 @@ def main(args): + log.info('job', 'Connecting to worker on socket %s' % (socket)) + + job_factory = job.JobClientFactory(avatarId) +- reactor.connectWith(fdserver.FDConnector, socket, job_factory, +- 10, checkPID=False) ++ c = fdserver.FDConnector(socket, job_factory, 10, checkPID=False, ++ reactor=reactor) ++ c.connect() + + reactor.addSystemEventTrigger('before', 'shutdown', + job_factory.medium.shutdownHandler) +diff --git a/flumotion/worker/base.py b/flumotion/worker/base.py +index 2ed613e..0c9e5d6 100644 +--- a/flumotion/worker/base.py ++++ b/flumotion/worker/base.py +@@ -183,7 +183,13 @@ def listen(self): + # our particular Port, which creates Transports that we know how to + # pass FDs over. + self.debug("Listening for FD's on unix socket %s", self._socketPath) +- port = reactor.listenWith(fdserver.FDPort, self._socketPath, f) ++ ++ # listenWith is deprecated but the function never did much anyway ++ # ++ # port = reactor.listenWith(fdserver.FDPort, self._socketPath, f) ++ port = fdserver.FDPort(self._socketPath, f, reactor=reactor) ++ port.startListening() ++ + self._port = port + + ### portal.IRealm method +diff --git a/flumotion/worker/feedserver.py b/flumotion/worker/feedserver.py +index c581b6b..e0d7ee1 100644 +--- a/flumotion/worker/feedserver.py ++++ b/flumotion/worker/feedserver.py +@@ -61,8 +61,12 @@ def listen(self, bouncer, portNum, unsafeTracebacks=0): + factory = pb.PBServerFactory(portal, + unsafeTracebacks=unsafeTracebacks) + +- tport = reactor.listenWith(fdserver.PassableServerPort, portNum, +- factory) ++ # listenWith is deprecated but the function never did much anyway ++ # ++ # tport = reactor.listenWith(fdserver.PassableServerPort, portNum, ++ # factory) ++ tport = fdserver.PassableServerPort(portNum, factory, reactor=reactor) ++ tport.startListening() + + self._tport = tport + self.debug('Listening for feed requests on TCP port %d', |