From 2b2c9b83cae61a57352c6b3032c7b81e06ea7dc3 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Thu, 19 Jul 2012 02:00:12 +0000 Subject: [PATCH] added correct palaver-tap-crap --- net-im/palaver/files/palaver.py.diff | 50 ++++++++++++++++++++++++++ net-im/palaver/files/palaver_plugin.py | 40 +++++++++++++++++++++ net-im/palaver/palaver-9999.ebuild | 5 +++ 3 files changed, 95 insertions(+) create mode 100644 net-im/palaver/files/palaver.py.diff create mode 100644 net-im/palaver/files/palaver_plugin.py diff --git a/net-im/palaver/files/palaver.py.diff b/net-im/palaver/files/palaver.py.diff new file mode 100644 index 0000000..f49809a --- /dev/null +++ b/net-im/palaver/files/palaver.py.diff @@ -0,0 +1,50 @@ +--- palaver.py 2012-03-19 11:44:46.000000000 +0100 ++++ palaver_plugin.py 2012-07-19 03:53:27.782461489 +0200 +@@ -1,7 +1,40 @@ +-from twisted.scripts.mktap import _tapHelper +- +-Palaver = _tapHelper( +- "Palaver", +- "palaver.tap", +- "A multi-user chat xmpp/jabber component.", +- "palaver") ++from zope.interface import implements ++from twisted.python import usage ++from twisted.plugin import IPlugin ++from twisted.application.service import IServiceMaker ++ ++# Due to the directory layout, and the fact that plugin directories aren't ++# modules (no __init__.py), this file is named something other than palaver.py, ++# to ensure that this import pulls in the right module. ++import palaver ++ ++class Options(usage.Options): ++ optParameters = [ ++ ('rhost', None, None), ++ ('rport', None, None), ++ ('secret', None, None), ++ ('backend', None, 'dir'), ++ ('spool', None, None), ++ ('admin', None, 1), ++ ('create', None, 1), ++ ('dbname', None, 'muc'), ++ ('dbuser', None, 'muc'), ++ ('dbhostname', None, None), ++ ('log', 'l', './html/logs/'), ++ ('config', 'c', 'config.xml') ++ ] ++ ++ optFlags = [ ++ ('verbose', 'v', 'Show traffic'), ++ ] ++ ++class ServiceFactory(object): ++ implements(IServiceMaker, IPlugin) ++ tapname = "palaver" ++ description = "A multi-user chat xmpp/jabber component." ++ options = Options ++ ++ def makeService(self, options): ++ return palaver.makeService(options) ++ ++service = ServiceFactory() diff --git a/net-im/palaver/files/palaver_plugin.py b/net-im/palaver/files/palaver_plugin.py new file mode 100644 index 0000000..0b1badd --- /dev/null +++ b/net-im/palaver/files/palaver_plugin.py @@ -0,0 +1,40 @@ +from zope.interface import implements +from twisted.python import usage +from twisted.plugin import IPlugin +from twisted.application.service import IServiceMaker + +# Due to the directory layout, and the fact that plugin directories aren't +# modules (no __init__.py), this file is named something other than palaver.py, +# to ensure that this import pulls in the right module. +import palaver + +class Options(usage.Options): + optParameters = [ + ('rhost', None, None), + ('rport', None, None), + ('secret', None, None), + ('backend', None, 'dir'), + ('spool', None, None), + ('admin', None, 1), + ('create', None, 1), + ('dbname', None, 'muc'), + ('dbuser', None, 'muc'), + ('dbhostname', None, None), + ('log', 'l', './html/logs/'), + ('config', 'c', 'config.xml') + ] + + optFlags = [ + ('verbose', 'v', 'Show traffic'), + ] + +class ServiceFactory(object): + implements(IServiceMaker, IPlugin) + tapname = "palaver" + description = "A multi-user chat xmpp/jabber component." + options = Options + + def makeService(self, options): + return palaver.makeService(options) + +service = ServiceFactory() diff --git a/net-im/palaver/palaver-9999.ebuild b/net-im/palaver/palaver-9999.ebuild index ba6e37a..330a41f 100644 --- a/net-im/palaver/palaver-9999.ebuild +++ b/net-im/palaver/palaver-9999.ebuild @@ -22,6 +22,11 @@ pkg_setup() { python_set_active_version 2 } +src_prepare() { + cp ${FILESDIR}/palaver_plugin.py ${S}/twisted/plugins + rm ${S}/twisted/plugins/palaver.py +} + src_compile() { # nothing to be done here? distutils_src_compile