--- jabber-irc-0.4cvs20080505.orig/irclib.py.diff +++ jabber-irc-0.4cvs20080505/irclib.py.diff @@ -0,0 +1,16 @@ +78c78 +< DEBUG = 0 +--- +> DEBUG = 1 +449c449 +< +--- +> +451c451 +< self.irclibobj._remove_connection(self) +--- +> +644c644 +< +--- +> self.irclibobj._remove_connection(self) --- jabber-irc-0.4cvs20080505.orig/irc.py +++ jabber-irc-0.4cvs20080505/irc.py @@ -1,6 +1,6 @@ #!/usr/bin/python -# $Id: irc.py,v 1.125 2007/12/15 23:31:57 normanr Exp $ -version = 'CVS ' + '$Revision: 1.125 $'.split()[1] +# $Id: irc.py,v 1.133 2008/04/10 08:15:35 normanr Exp $ +version = 'CVS ' + '$Revision: 1.133 $'.split()[1] # # IRC transport # January 2004 Copyright (c) Mike Albon @@ -8,7 +8,9 @@ # # This program is free software licensed with the GNU Public License Version 2. # For a full copy of the license please go here http://www.gnu.org/licenses/licenses.html#GPL - +import os,sys +sys.path.insert(0,'/usr/lib/jabber-irc') +os.chdir('/var/lib/jabber-irc') import codecs, ConfigParser, md5, os, platform, re, select, shelve, signal, socket, sys, time, traceback import irclib, xmpp.client from xmpp.protocol import * @@ -42,8 +44,8 @@ # # All internal datastructures are held in UTF8 unicode objects. -# This is the list of charsets that python supports. Detecting this list at runtime is really difficult, so it's hardcoded here. -charsets = ['','ascii','big5','big5hkscs','cp037','cp424','cp437','cp500','cp737','cp775','cp850','cp852','cp855','cp856','cp857','cp860','cp861','cp862','cp863','cp864','cp865','cp866','cp869','cp874','cp875','cp932','cp949','cp950','cp1006','cp1026','cp1140','cp1250','cp1251','cp1252','cp1253','cp1254','cp1255','cp1256','cp1257','cp1258','euc-jp','euc-jis-2004','euc-jisx0213','euc-kr','gb2312','gbk','gb18030','hz','iso2022-jp','iso2022-jp-1','iso2022-jp-2','iso2022-jp-2004','iso2022-jp-3','iso2022-jp-ext','iso2022-kr','latin-1','iso8859-1','iso8859-2','iso8859-3','iso8859-4','iso8859-5','iso8859-6','iso8859-7','iso8859-8','iso8859-9','iso8859-10','iso8859-13','iso8859-14','iso8859-15','johab','koi8-r','koi8-u','mac-cyrillic','mac-greek','mac-iceland','mac-latin2','mac-roman','mac-turkish','ptcp154','shift-jis','shift-jis-2004','shift-jisx0213','utf-16','utf-16-be','utf-16-le','utf-7','utf-8'] +# This is the list of charsets that python supports. Detecting this list at runtime is really difficult, so it's hardcoded here. Additionally we cache the double-pairing of entries to reduce memory fragmentation +charsets = [(x,x) for x in ('','ascii','big5','big5hkscs','cp037','cp424','cp437','cp500','cp737','cp775','cp850','cp852','cp855','cp856','cp857','cp860','cp861','cp862','cp863','cp864','cp865','cp866','cp869','cp874','cp875','cp932','cp949','cp950','cp1006','cp1026','cp1140','cp1250','cp1251','cp1252','cp1253','cp1254','cp1255','cp1256','cp1257','cp1258','euc-jp','euc-jis-2004','euc-jisx0213','euc-kr','gb2312','gbk','gb18030','hz','iso2022-jp','iso2022-jp-1','iso2022-jp-2','iso2022-jp-2004','iso2022-jp-3','iso2022-jp-ext','iso2022-kr','latin-1','iso8859-1','iso8859-2','iso8859-3','iso8859-4','iso8859-5','iso8859-6','iso8859-7','iso8859-8','iso8859-9','iso8859-10','iso8859-13','iso8859-14','iso8859-15','johab','koi8-r','koi8-u','mac-cyrillic','mac-greek','mac-iceland','mac-latin2','mac-roman','mac-turkish','ptcp154','shift-jis','shift-jis-2004','shift-jisx0213','utf-16','utf-16-be','utf-16-le','utf-7','utf-8')] nonbreakingre1 = re.compile(u'(.) (?=(?: )*$)') # any char followed by a space (and followed by an even number of spaces and then the end of the string) nonbreakingre2 = re.compile(u'(^| ) ') # start of string, or any two spaces irccolour = ['#FFFFFF','#000000','#0000FF','#00FF00','#FF0000','#F08000','#8000FF','#FFF000','#FFFF00','#80FF00','#00FF80','#00FFFF','#0080FF','#FF80FF','#808080','#A0A0A0'] @@ -229,13 +231,13 @@ # private - bool # secret - bool # invite - bool - # topic - bool - # notmember - bool + # topiclock - bool + # noexternalmsgs - bool # moderated - bool # banlist - list # limit - number # key - string - # currenttopic - string + # currenttopic - tuple of strings - (nickname, topic) # members - hash - key is nick of member, value is hash, key is 'affiliation', 'role', 'jid', 'nick' # resources - hash - key is resource, value is tuple of: show, priority, status, login time # pendingoperations - hash - key is internal name of operation, joined with nick if applicable, value a list of tuples of (op,callback,data) @@ -264,7 +266,14 @@ self.irc.add_global_handler('pubnotice',self.irc_message) self.irc.add_global_handler('privmsg',self.irc_message) self.irc.add_global_handler('privnotice',self.irc_message) + self.irc.add_global_handler('adminme',self.irc_message) + self.irc.add_global_handler('adminloc1',self.irc_message) + self.irc.add_global_handler('adminloc2',self.irc_message) + self.irc.add_global_handler('adminemail',self.irc_message) + self.irc.add_global_handler('links',self.irc_message) # TODO: Specialise + #self.irc.add_global_handler('endoflinks',self.irc_message) self.irc.add_global_handler('468',self.irc_message) + self.irc.add_global_handler('erroneusnickname',self.irc_message) # TODO: Specialise self.irc.add_global_handler('whoreply',self.irc_whoreply) self.irc.add_global_handler('ctcp',self.irc_ctcp) self.irc.add_global_handler('ctcpreply',self.irc_ctcpreply) @@ -741,7 +750,7 @@ nick = channel else: nick = to.getResource() - if event.getBody() == None: + if not event.getBody(): xevent = event.getTag('x',namespace=NS_EVENT) if xevent and conn.activechats.has_key(irc_ulower(nick)): chat = conn.activechats[irc_ulower(nick)] @@ -750,14 +759,12 @@ for state in xevent.getChildren(): states.append(state.getName()) self.irc_sendctcp('X:EVENT',conn,nick,','.join(states)) - return if type == 'groupchat': if config.dumpProtocol: print "Groupchat" if irclib.is_channel(channel) and conn.channels.has_key(channel): - if config.dumpProtocol: print "channel:", event.getBody().encode('utf8') if event.getSubject(): if config.dumpProtocol: print "subject" - if conn.channels[channel].topic: + if conn.channels[channel].topiclock: if config.dumpProtocol: print "topic" if conn.channels[channel].members[conn.nickname]['role'] == 'moderator': if config.dumpProtocol: print "set topic ok" @@ -768,8 +775,8 @@ else: if config.dumpProtocol: print "anyone can set topic" self.irc_settopic(conn,channel,event.getSubject()) - elif event.getBody() != '': - if config.dumpProtocol: print "body isn't empty:" , event.getBody().encode('utf8') + elif event.getBody(): + if config.dumpProtocol: print "channel:", event.getBody().encode('utf8') if event.getBody()[0:3] == '/me': if config.dumpProtocol: print "action" self.irc_sendctcp('ACTION',conn,channel,event.getBody()[4:]) @@ -781,7 +788,7 @@ self.jabber.send(t) else: self.jabber.send(Error(event,ERR_ITEM_NOT_FOUND)) # or MALFORMED_JID maybe? - elif type in ['chat', 'normal', None]: + elif type in ['chat', 'normal', None] and event.getBody(): if nick: if conn.activechats.has_key(irc_ulower(nick)): conn.activechats[irc_ulower(nick)] = [to,event.getFrom(),time.time(),conn.activechats[irc_ulower(nick)][3]] @@ -811,6 +818,15 @@ channel='' server=room sys.exc_clear() + if not server: + m = Iq(to=event.getFrom(),frm=to, typ='result') + m.setID(id) + p = m.addChild(name='vCard', namespace=NS_VCARD) + p.setTagData(tag='FN', val='IRC Transport') + p.setTagData(tag='DESC', val='IRC Transport') + p.setTagData(tag='URL', val='http://xmpppy.sourceforge.net/irc/') + self.jabber.send(m) + raise xmpp.NodeProcessed if not self.users.has_key(fromjid): self.jabber.send(Error(event,ERR_REGISTRATION_REQUIRED)) # another candidate: ERR_SUBSCRIPTION_REQUIRED raise xmpp.NodeProcessed @@ -828,10 +844,14 @@ m = Iq(to=event.getFrom(),frm=to, typ='result') m.setID(id) p = m.addChild(name='vCard', namespace=NS_VCARD) - p.setTagData(tag='DESC', val='Additional Information:') - conn.pendingoperations["whois:" + irc_ulower(nick)] = m - conn.whois([(nick + ' ' + nick).encode(conn.charset,'replace')]) + if channel: + p.setTagData(tag='DESC', val='Additional Information:') + conn.pendingoperations["whois:" + irc_ulower(nick)] = m + conn.whois([(nick + ' ' + nick).encode(conn.charset,'replace')]) + else: + conn.admin() + self.jabber.send(m) raise xmpp.NodeProcessed @@ -974,16 +994,27 @@ raise xmpp.NodeProcessed chan = conn.channels[channel] + def b(value): + return str(value).lower() datafrm = DataForm(typ='form',data=[ - DataField(desc='Private' ,name='private' ,value=chan.private ,typ='boolean'), - DataField(desc='Secret' ,name='secret' ,value=chan.secret ,typ='boolean'), - DataField(desc='Invite Only' ,name='invite' ,value=chan.invite ,typ='boolean'), - DataField(desc='Only ops can change the Topic' ,name='topic' ,value=chan.topic ,typ='boolean'), - DataField(desc='No external channel messages' ,name='notmember' ,value=chan.notmember ,typ='boolean'), - DataField(desc='Moderated Channel' ,name='moderated' ,value=chan.moderated ,typ='boolean'), - DataField(desc='Ban List' ,name='banlist' ,value=chan.banlist ,typ='text-multi'), - DataField(desc='Channel Limit' ,name='limit' ,value=chan.limit ,typ='text-single'), - DataField(desc='Channel Key' ,name='key' ,value=chan.key ,typ='text-single')]) + DataField(desc='Private (hide topic from outsiders)',name='private',label='Private', + value=b(chan.private),typ='boolean'), + DataField(desc='Secret (hide channel from outsiders)',name='secret',label='Secret', + value=b(chan.secret),typ='boolean'), + DataField(desc='Invite Only',name='invite',label='Invite Only', + value=b(chan.invite),typ='boolean'), + DataField(desc='Only ops can change the Topic',name='topiclock',label='Topic Lock', + value=b(chan.topiclock),typ='boolean'), + DataField(desc='No external channel messages',name='noexternalmsgs',label='No External Msgs', + value=b(chan.noexternalmsgs),typ='boolean'), + DataField(desc='Moderated Channel',name='moderated',label='Moderated', + value=b(chan.moderated),typ='boolean'), + DataField(desc='Ban List',name='banlist',label='Ban List', + value=chan.banlist,typ='text-multi'), + DataField(desc='Channel Member Limit',name='limit',label='Limit', + value=chan.limit,typ='text-single'), + DataField(desc='Channel Key/Password',name='key',label='Key', + value=chan.key,typ='text-single')]) datafrm.setInstructions('Configure the room') m = Iq(frm = to, to = event.getFrom(), typ='result', queryNS=ns) @@ -1028,15 +1059,16 @@ typ='+' else: typ='-' + cmd = None if each == 'private': cmd = 'p' elif each == 'secret': cmd = 's' elif each == 'invite': cmd = 'i' - elif each == 'topic': + elif each == 'topiclock': cmd = 't' - elif each == 'notmember': + elif each == 'noexternalmsgs': cmd = 'n' elif each == 'moderated': cmd = 'm' @@ -1064,7 +1096,7 @@ else: typ='-' cmd='k %s' % conn.channels[channel].key - if not handled and fieldValue != getattr(conn.channels[channel], each): + if not handled and cmd and fieldValue != getattr(conn.channels[channel], each): conn.mode(channel,'%s%s' % (typ,cmd)) m = Iq(frm = to, to = event.getFrom(), typ='result', queryNS=ns) m.setID(id) @@ -1111,7 +1143,7 @@ nametype='text-single' form = DataForm(typ='form',data=[ DataField(desc='Character set',name='charset',label='Charset', - value=charset,typ='list-single',options=((x,x) for x in charsets)), + value=charset,typ='list-single',options=charsets), DataField(desc='Server alias used for jids',name='alias',label='Server alias', value=server,typ=nametype), DataField(desc='Server to connect to',name='address',label='Address', @@ -1226,7 +1258,8 @@ servers = {} if conf.has_key('servers'): servers = conf['servers'] - if irc_ulower(to.getNode()) == '' and servers.has_key(server): + server = irc_ulower(server) + if room == '' and servers.has_key(server): self.jabber.send(Error(event,ERR_NOT_ACCEPTABLE)) raise xmpp.NodeProcessed if not serverdetails.has_key('nick') or serverdetails['nick'] == '': @@ -1295,11 +1328,12 @@ if self.users.has_key(fromjid): if self.users[fromjid].has_key(server): - instructionText = 'Fill in the form to search for any matching room (Add * to the end of field to match substring)' + instructionText = 'Fill in the form to search for matching rooms' queryPayload = [Node('instructions', payload = instructionText)] form = DataForm(typ='form',data=[ - DataField(desc='Name of the channel',name='name',typ='text-single')]) + DataField(desc='Name of the channel',name='name',label='Channel Name', + typ='text-single')]) form.setInstructions(instructionText) queryPayload += [ Node('name'), @@ -1337,6 +1371,10 @@ name = form.getField('name').getValue() elif query.getTag('name'): name = query.getTagData('name') + if not irclib.is_channel(name): + name = '#' + name + if name[-1:] != '*': + name += '*' if self.users.has_key(fromjid): if self.users[fromjid].has_key(server): @@ -1421,7 +1459,7 @@ def irc_sendnick(self,conn,nick): try: - conn.nick(nick) + conn.nick(nick.encode(conn.charset,'replace')) except: self.irc_doquit(conn, 'set nick failed') @@ -1469,12 +1507,11 @@ if config.dumpProtocol: print "Update channel resource login: %s" % conn.channels[channel].resources else: #new resource login + name = '%s%%%s@%s' % (channel, server, config.jid) + # resource is joining an existing resource on the same channel + previousresources = conn.channels[channel].resources.keys() conn.channels[channel].resources[resource]=(event.getShow(),event.getPriority(),event.getStatus(),time.time()) if config.dumpProtocol: print "New channel resource login: %s" % conn.channels[channel].resources - # resource is joining an existing resource on the same channel - # TODO: Send topic to new resource - # TODO: Alert existing resources that a new resource has joined - name = '%s%%%s@%s' % (channel, server, config.jid) for cnick in conn.channels[channel].members.keys(): if cnick == conn.nickname: #if config.dumpProtocol: print 'nnick %s %s %s'%(name,cnick,nick) @@ -1485,6 +1522,16 @@ t=m.addChild(name='x',namespace=NS_MUC_USER) p=t.addChild(name='item',attrs=conn.channels[channel].members[cnick]) self.jabber.send(m) + for oresource in previousresources: + m = Message(to='%s/%s'%(conn.fromjid,oresource), typ='groupchat',frm=name, body='%s/%s has joined' % (nick, resource)) + self.jabber.send(m) + m = Message(to='%s/%s'%(conn.fromjid,resource), typ='groupchat',frm=name, body='%s/%s has joined' % (nick, oresource)) + self.jabber.send(m) + if conn.channels[channel].currenttopic[0]: + m = Message(to='%s/%s'%(conn.fromjid,resource),frm='%s/%s' %(name, conn.channels[channel].currenttopic[0]), typ='groupchat', subject = conn.channels[channel].currenttopic[1]) + if config.activityMessages == True: + m.setBody('/me set the topic to: %s' % conn.channels[channel].currenttopic[1]) + self.jabber.send(m) return 1 else: if conn.xresources.has_key(resource): @@ -1559,7 +1606,7 @@ if len(addressdetails) > 1: port = int(addressdetails[1]); address = addressdetails[0]; - conn=self.irc.server().connect(address,port,nick,password,username,realname,config.host) + conn=self.irc.server().connect(address,port,nick.encode(ucharset,'replace'),password,username,realname,config.host) conn.server = server conn.address = address conn.port = port @@ -1600,13 +1647,13 @@ chan.private = False chan.secret = False chan.invite = False - chan.topic = False - chan.notmember = False + chan.topiclock = False + chan.noexternalmsgs = False chan.moderated = False chan.banlist = [] chan.limit = 0 chan.key = '' - chan.currenttopic = '' + chan.currenttopic = (None,None) chan.members = {} # irc nicks in the channel chan.resources = {} @@ -1627,6 +1674,13 @@ if conn.channels[channel].resources.has_key(resource): del conn.channels[channel].resources[resource] if config.dumpProtocol: print "Deleted channel resource login: %s" % conn.channels[channel].resources + msg = '' + if message: + msg = ' (%s)' % message + name = '%s%%%s' % (channel, conn.server) + for oresource in conn.channels[channel].resources.keys(): + m = Message(to='%s/%s'%(conn.fromjid,oresource), typ='groupchat',frm='%s@%s' % (name, config.jid), body='%s/%s has left%s' % (conn.nickname, resource, msg)) + self.jabber.send(m) if conn.channels[channel].resources == {}: self.irc_leaveroom(conn,channel) del conn.channels[channel] @@ -1946,9 +2000,9 @@ elif each == 'i': #invite only conn.channels[channel].invite = plus elif each == 't': #only chanop can set topic - conn.channels[channel].topic = plus + conn.channels[channel].topiclock = plus elif each == 'n': #no not in channel messages - conn.channels[channel].notmember = plus + conn.channels[channel].noexternalmsgs = plus elif each == 'm': #moderated chanel conn.channels[channel].moderated = plus elif each == 'l': #set channel limit @@ -2012,12 +2066,12 @@ if conn.channels.has_key(channel): if nick in conn.channels[channel].members.keys(): del conn.channels[channel].members[nick] - if us: - del conn.channels[channel].members if config.activityMessages == True: for resource in conn.channels[channel].resources.keys(): m = Message(to='%s/%s'%(conn.fromjid,resource), typ='groupchat',frm='%s@%s' % (name, config.jid), body='%s (%s) was kicked by %s (%s)' % (nick, unicode(irclib.nm_to_uh(event.source()),conn.charset,'replace'), unicode(irclib.nm_to_n(event.source()),conn.charset,'replace'), line)) self.jabber.send(m) + if us: + del conn.channels[channel] m = Presence(to=conn.fromjid,typ=type,frm='%s@%s/%s' %(name, config.jid,nick)) t=m.addChild(name='x',namespace=NS_MUC_USER) p=t.addChild(name='item',attrs={'affiliation':'none','role':'none','jid':jid}) @@ -2037,7 +2091,7 @@ else: channel = irc_ulower(unicode(event.target(),conn.charset,'replace')) line,xhtml = colourparse(event.arguments()[0],conn.charset) - conn.channels[channel].currenttopic = line + conn.channels[channel].currenttopic = (nick,line) for resource in conn.channels[channel].resources.keys(): m = Message(to='%s/%s'%(conn.fromjid,resource),frm = '%s%%%s@%s/%s' % (channel,conn.server,config.jid,nick), typ='groupchat', subject = line) if config.activityMessages == True: @@ -2426,8 +2480,9 @@ del self.users[each] del socketlist[self.jabber.Connection._sock] time.sleep(5) - while not self.jabber.reconnectAndReauth(): + if not self.jabber.reconnectAndReauth(): time.sleep(5) + self.xmpp_connect() socketlist[self.jabber.Connection._sock]='xmpp' def loadConfig(): --- jabber-irc-0.4cvs20080505.orig/adhoc.py +++ jabber-irc-0.4cvs20080505/adhoc.py @@ -1,4 +1,4 @@ -# $Id: adhoc.py,v 1.3 2007/08/29 09:14:31 normanr Exp $ +# $Id: adhoc.py,v 1.4 2007/12/18 21:34:38 normanr Exp $ import sys, xmpp from xmpp.protocol import * @@ -98,6 +98,7 @@ def _DiscoHandler(self,conn,event,type): """The handler for discovery events""" fromjid = event.getFrom().getStripped().__str__() + resource = event.getFrom().getResource() to = event.getTo() room = irc_ulower(to.getNode()) try: @@ -107,7 +108,10 @@ channel='' server=room sys.exc_clear() - if channel == '' and (not self.transport.users.has_key(fromjid) or not self.transport.users[fromjid].has_key(server)): + if channel == '' and not ( + self.transport.users.has_key(fromjid) and + self.transport.users[fromjid].has_key(server) and + self.transport.users[fromjid][server].xresources.has_key(resource)): return xmpp.commands.Command_Handler_Prototype._DiscoHandler(self,conn,event,type) else: return None @@ -154,6 +158,7 @@ def _DiscoHandler(self,conn,event,type): """The handler for discovery events""" fromjid = event.getFrom().getStripped().__str__() + resource = event.getFrom().getResource() to = event.getTo() room = irc_ulower(to.getNode()) try: @@ -163,7 +168,10 @@ channel='' server=room sys.exc_clear() - if channel == '' and self.transport.users.has_key(fromjid) and self.transport.users[fromjid].has_key(server): + if channel == '' and ( + self.transport.users.has_key(fromjid) and + self.transport.users[fromjid].has_key(server) and + self.transport.users[fromjid][server].xresources.has_key(resource)): return xmpp.commands.Command_Handler_Prototype._DiscoHandler(self,conn,event,type) else: return None --- jabber-irc-0.4cvs20080505.orig/debian/dirs +++ jabber-irc-0.4cvs20080505/debian/dirs @@ -0,0 +1,6 @@ +etc/default +usr/lib/jabber-irc +usr/sbin +var/lib/jabber-irc +var/log/jabber +etc/init.d --- jabber-irc-0.4cvs20080505.orig/debian/compat +++ jabber-irc-0.4cvs20080505/debian/compat @@ -0,0 +1 @@ +7 --- jabber-irc-0.4cvs20080505.orig/debian/init.d +++ jabber-irc-0.4cvs20080505/debian/init.d @@ -0,0 +1,95 @@ +#! /bin/sh +# +# skeleton example file to build /etc/init.d/ scripts. +# This file should be used to construct scripts for /etc/init.d. +# +# Written by Miquel van Smoorenburg . +# Modified for Debian +# by Ian Murdock . +# +# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl +# + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/jabberd-irc +CMDLINE=/usr/bin/python/usr/sbin/jabberd-irc +NAME=jabber-irc +DESC=jabber-irc +ARGS='' +PID=/var/run/jabber/$NAME.pid +ENABLED='0' + +# Create needed dir in /var/run. +if [ ! -d /var/run/jabber ] ; then + mkdir /var/run/jabber + chown jabber:adm /var/run/jabber + chmod 0775 /var/run/jabber +fi + +if [ -f /etc/default/jabber-irc ]; then + . /etc/default/jabber-irc +fi + +. /lib/lsb/init-functions + +test -x $DAEMON -a "$ENABLED" -eq "1" || exit 0 + +set -e + +case "$1" in + start) + if [ -e $PID ]; then + PIDDIR=/proc/$(cat $PID) + if [ -d ${PIDDIR} -a "$(cat ${PIDDIR}/cmdline)" = "$CMDLINE" ]; then + log_success_msg "$DESC already started; not starting" + exit + else + log_success_msg "Removing stale PID file $PID" + rm -f $PID + fi + fi + + log_daemon_msg "Starting $DESC: " + export PID + start-stop-daemon -b -c jabber:adm --start --quiet --pidfile $PID\ + --make-pidfile --exec $DAEMON -- $ARGS + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon -o --stop --signal INT --quiet --retry 3 \ + --pidfile $PID --exec /usr/bin/python + echo "$NAME." + rm -f $PID + ;; + #reload) + # + # If the daemon can reload its config files on the fly + # for example by sending it SIGHUP, do it here. + # + # If the daemon responds to changes in its config file + # directly anyway, make this a do-nothing entry. + # + # echo "Reloading $DESC configuration files." + # start-stop-daemon --stop --signal 1 --quiet --pidfile \ + # /var/run/jabber/$NAME.pid --exec $DAEMON + #;; + restart|force-reload) + # + # If the "reload" option is implemented, move the "force-reload" + # option to the "reload" entry above. If not, "force-reload" is + # just the same as "restart". + # + $0 stop + sleep 3 + $0 start + ;; + *) + N=/etc/init.d/$NAME + # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 --- jabber-irc-0.4cvs20080505.orig/debian/default +++ jabber-irc-0.4cvs20080505/debian/default @@ -0,0 +1,5 @@ +# Default settings for jabber-irc. This file is sourced by /bin/sh +# from /etc/init.d/jabber-irc. + +# Change the following to 1 to enable the service +ENABLED='0' --- jabber-irc-0.4cvs20080505.orig/debian/rules +++ jabber-irc-0.4cvs20080505/debian/rules @@ -0,0 +1,84 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + cp irc.py jabberd-irc + cp README.txt README + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp jabber-irc jabberd-irc jabber-irc.conf README + + # Add here commands to clean up after the build process. + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + + # Add here commands to install the package into debian/jabber-irc. + install -o root -g root -m 755 $(CURDIR)/debian/init.d $(CURDIR)/debian/jabber-irc/etc/init.d/jabber-irc + install -o root -g root -m 644 $(CURDIR)/debian/default $(CURDIR)/debian/jabber-irc/etc/default/jabber-irc + install -o root -g root -m 644 $(CURDIR)/config_example.xml $(CURDIR)/debian/jabber-irc/etc/pyirct.conf.xml + install -o root -g root -m 644 $(CURDIR)/????*.py $(CURDIR)/debian/jabber-irc/usr/lib/jabber-irc + +# Build architecture-dependent files here. +binary-arch: build install +# We have nothing to do by default. + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples + dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime + dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_python +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- jabber-irc-0.4cvs20080505.orig/debian/jabberd-irc.8 +++ jabber-irc-0.4cvs20080505/debian/jabberd-irc.8 @@ -0,0 +1,24 @@ +.TH jabberd\-irc 8 "August 21, 2004" +.SH NAME +jabberd\-irc \- IRC gateway for jabber server +.SH SYNOPSIS +\fBjabberd\-irc\fR +.SH DESCRIPTION +jabberd\-irc is written in python language and provides +jabber server with ability to route messages to IRC rooms mapping them onto jabber +world as MUC conferences. +.PP +You can find more info on jabber\-irc at http://xmppppy.sf.net/irc/ +.SH OPTIONS +The jabberd\-irc is not taking any options at command line. +You can configure it by editing the config file: +/etc/jabber/jabber\-irc.conf +.SH AUTHOR +This manual page was written by Alexey Nezhdanov snakeru@users.sourceforge.net for +the Debian system (but may be used by others). Permission is +granted to copy, distribute and/or modify this document under +the terms of the GNU General Public License, Version 2 any +later version published by the Free Software Foundation. +.PP +On Debian systems, the complete text of the GNU General Public +License can be found in /usr/share/common\-licenses/GPL. --- jabber-irc-0.4cvs20080505.orig/debian/manpages +++ jabber-irc-0.4cvs20080505/debian/manpages @@ -0,0 +1 @@ +debian/jabberd-irc.8 --- jabber-irc-0.4cvs20080505.orig/debian/copyright +++ jabber-irc-0.4cvs20080505/debian/copyright @@ -0,0 +1,26 @@ +This package was debianized by Alexey Nezhdanov on +Sat, 21 Aug 2004 07:43:30 +0400. + +It was downloaded from http://xmpppy.sf.net/irc/ + +Upstream Author: Mike Albon + +Jan Copyright 2004 Mike Albon + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 dated June, 1991. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301, USA. + + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. --- jabber-irc-0.4cvs20080505.orig/debian/changelog +++ jabber-irc-0.4cvs20080505/debian/changelog @@ -0,0 +1,102 @@ +jabber-irc (0.4cvs20080505-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Applied patch from Ubuntu (Closes: #516349). Thanks to Miguel Landaeta and + Ilya Barygin. + - debian/control: depend on adduser and on lsb-base (instead of + jabber-common) + - debian/init.d: take into account the substitution of jabber-common with + lsb-base + - debian/postinst, debian/postrm: use "jabber" user creation/deletion + code from jabber-common + - debian/dirs: add var/log/jabber + * Fix binary-arch-rules-but-pkg-is-arch-indep lintian warning + * Depend on ${misc:Depends} for debhelper + * Set debian/compat to 7, update minimum debhelper version, and replace + deprecated ``dh_clean -k'' with dh_prep + * Move init.d script to /etc/init.d/ + * Remove debian/prerm and let dh_installinit generate it instead + * Invoke start-stop-deamon with --make-pidfile + + -- Serafeim Zanikolas Fri, 06 Aug 2010 03:41:27 +0200 + +jabber-irc (0.4cvs20080505-1) unstable; urgency=low + + * New upstream release. (Closes: #370601) + * Manpage type fixed. (Closes: #422789) + * Depend on python-xmpp>=0.4.1. (Closes: #406797) + + -- Cosimo Alfarano Sat, 8 Nov 2008 13:10:42 -0200 + +jabber-irc (0.1cvs20050420-3.2) unstable; urgency=low + + * Non-maintainer upload. + * Depend on python-xmpp instead of python2.3-xmpp and remove python2.3 + dependency (Really closes: #376894). + + -- Luk Claes Mon, 17 Jul 2006 19:15:45 +0200 + +jabber-irc (0.1cvs20050420-3.1) unstable; urgency=high + + * Non-maintainer upload. + * Depend on python-irclib instead of python2.3-irclib, since it was + renamed as part of the Python transition. (Closes: #376894) + + -- Steinar H. Gunderson Fri, 14 Jul 2006 23:35:51 +0200 + +jabber-irc (0.1cvs20050420-3) unstable; urgency=low + + * Added orig file for uploading, forgot last time (-1 wasn't actually + uploaded) + + -- Alexey Nezhdanov Sat, 14 May 2005 14:53:35 +0200 + +jabber-irc (0.1cvs20050420-2) unstable; urgency=low + + * Added 'python' to "Depends:" line to remove lintian warning. + closes: #308766 + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Thu, 12 May 2005 14:15:25 +0400 + +jabber-irc (0.1cvs20050420-1) unstable; urgency=low + + * Sunc with current CVS version (bugfixes since previous snapshot). + closes: #307734 + * Changed architecture from 'any' to 'all'. Again. + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Wed, 4 May 2005 21:43:28 +0400 + +jabber-irc (0.1cvs20050311-1) unstable; urgency=low + + * Sunc with current CVS version. + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Fri, 11 Mar 2005 21:22:56 +0300 + +jabber-irc (0.1cvs20050102-1) unstable; urgency=low + + * Sunc with current CVS version. + * Changed architecture from 'any' to 'all'. + * Changed dependency to python2.3-irclib. + * Sponsored upload by Cosimo Alfarano + + -- Alexey Nezhdanov Sun, 23 Jan 2005 21:21:18 +0300 + +jabber-irc (0.1cvs20040820-2) unstable; urgency=low + + * Sponsored upload by Cosimo Alfarano + * Fixes security bug: insecure permissions on config file containing shared secret. + + -- Alexey Nezhdanov Sun, 19 Dec 2004 09:31:23 +0300 + +jabber-irc (0.1cvs20040820-1) unstable; urgency=low + + * Initial Release. + * Sponsored upload by Cosimo Alfarano + * Closes ITP + closes: #267216 + + -- Alexey Nezhdanov Sat, 21 Aug 2004 07:43:30 +0400 + --- jabber-irc-0.4cvs20080505.orig/debian/control +++ jabber-irc-0.4cvs20080505/debian/control @@ -0,0 +1,19 @@ +Source: jabber-irc +Section: net +Priority: optional +Maintainer: Alexey Nezhdanov +Build-Depends: debhelper (>= 7.0.0) +Standards-Version: 3.8.0 +Uploaders: Cosimo Alfarano , Jamin W. Collins + +Package: jabber-irc +Architecture: all +Depends: ${misc:Depends}, python-irclib, python-xmpp (>=0.4.1), lsb-base, python, adduser +Suggests: jabber +Description: IRC transport for jabber + Provides jabber server with gateway to IRC messaging system. + Written completely in Python language. + . + You will need jabber server to use this gateway. If you have no + deployed server or just want to chat via IRC you may be better + look for IRC client or already deployed jabber IRC gateway. --- jabber-irc-0.4cvs20080505.orig/debian/manpage.xml +++ jabber-irc-0.4cvs20080505/debian/manpage.xml @@ -0,0 +1,113 @@ + +.
will be generated. You may view the +manual page with: nroff -man .
| less'. A +typical entry in a Makefile or Makefile.am is: + +DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\ +manpages/docbook.xsl +XP=xsltproc -''-nonet + +manpage.1: manpage.dbk + $(XP) $(DB2MAN) $< + +The xsltproc binary is found in the xsltproc package. The +XSL files are in docbook-xsl. Please remember that if you +create the nroff version in one of the debian/rules file +targets (such as build), you will need to include xsltproc +and docbook-xsl in your Build-Depends control field. + +--> + + + Alexey"> + Nezhdanov"> + + August 21, 2004"> + + 8"> + snakeru@users.sourceforge.net"> + + jabberd-irc"> + + + Debian"> + GNU"> + GPL"> +]> + + + +
+ &dhemail; +
+ + &dhfirstname; + &dhsurname; + + + 2004 + &dhusername; + + &dhdate; +
+ + &dhucpackage; + + &dhsection; + + + &dhpackage; + + IRC gateway for jabber server + + + + &dhpackage; + + + + + + DESCRIPTION + + &dhpackage; is written in python language and provides + jabber server with ability to route messages to IRC rooms mapping them onto jabber + world as MUC conferences. + + You can find more info on jabber-irc at http://xmppppy.sf.net/irc/ + + + + OPTIONS + + The &dhpackage; is not taking any options at command line. + You can configure it by editing the config file: + /etc/jabber/jabber-irc.conf + + + AUTHOR + + This manual page was written by &dhusername; &dhemail; for + the &debian; system (but may be used by others). Permission is + granted to copy, distribute and/or modify this document under + the terms of the &gnu; General Public License, Version 2 any + later version published by the Free Software Foundation. + + + On Debian systems, the complete text of the GNU General Public + License can be found in /usr/share/common-licenses/GPL. + + + +
--- jabber-irc-0.4cvs20080505.orig/debian/install +++ jabber-irc-0.4cvs20080505/debian/install @@ -0,0 +1 @@ +jabberd-irc usr/sbin --- jabber-irc-0.4cvs20080505.orig/debian/README.Debian +++ jabber-irc-0.4cvs20080505/debian/README.Debian @@ -0,0 +1,47 @@ +jabber-irc for Debian +--------------------- + +To enable this service, you need to edit /etc/default/jabber-irc and +set ENABLED to 1. However before this, you need to edit your main +Jabber server's configuration. + +Main Jabber server configuration files + +In order to have your main Jabber server accept connections from jabber-irc, +you have to configure it accordingly. + +For jabberd server, add the following to the section of its +configuration file. + + + irc.localhost + + 127.0.0.1 + 9000 + secret + 30 + + + +Be sure to replace "localhost" with the full host name of your server +if you want users of other Jabber servers to be able to use this +transport. Also, the host name of the transport has to be resolveable +via DNS then. + +In order to advertise the IRC transport's services to the Jabber +clients, add the following to the section of the main jabberd +configuration file. + + + jabber:iq:gateway + + +Once the above has been done you will need to restart your Jabber server +for it to use the new configuration. Upon restart the new service +(if ENABLED) will start also. + +Note: if you change any of the above settings such as any host (localhost), +port, or secret settings, you will also need to make the same change in +/etc/jabber/jabber-xmpp.conf + + -- Alexey Nezhdanov , Sat, 21 Aug 2004 08:19:00 +0400 --- jabber-irc-0.4cvs20080505.orig/debian/postrm +++ jabber-irc-0.4cvs20080505/debian/postrm @@ -0,0 +1,73 @@ +#! /bin/sh +# postrm script for jabber-irc +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' overwrit>r> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge) + # remove potentially empty directories if they exist + DIRS="/etc/jabber /var/run/jabber" + for DIR in $DIRS; do + if [ -d $DIR ]; then + rmdir --ignore-fail-on-non-empty $DIR + fi + done + + # find first and last SYSTEM_UID numbers + for LINE in `grep SYSTEM_UID /etc/adduser.conf | grep -v "^#"`; do + case $LINE in + FIRST_SYSTEM_UID*) + FIST_SYSTEM_UID=`echo $LINE | cut -f2 -d '='` + ;; + LAST_SYSTEM_UID*) + LAST_SYSTEM_UID=`echo $LINE | cut -f2 -d '='` + ;; + *) + ;; + esac + done + # remove jabber system account if necessary + if [ -n "$FIST_SYSTEM_UID" ] && [ -n "$LAST_SYSTEM_UID" ]; then + if USERID=`getent passwd jabber | cut -f 3 -d ':'`; then + if [ -n "$USERID" ]; then + if [ "$FIST_SYSTEM_UID" -le "$USERID" ] && \ + [ "$USERID" -le "$LAST_SYSTEM_UID" ]; then + deluser --quiet jabber || true + fi + fi + fi + fi + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 --- jabber-irc-0.4cvs20080505.orig/debian/docs +++ jabber-irc-0.4cvs20080505/debian/docs @@ -0,0 +1,2 @@ +README.txt +IRC-Transport-Howtouse.html --- jabber-irc-0.4cvs20080505.orig/debian/postinst +++ jabber-irc-0.4cvs20080505/debian/postinst @@ -0,0 +1,63 @@ +#! /bin/sh +# postinst script for jabber-irc +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in + configure) + # create jabber user if it doesn't exist + if ! getent passwd | grep -q '^jabber:'; then + if [ ! -d /var/run/jabber ]; then + mkdir /var/run/jabber + fi + adduser --quiet --system --disabled-password \ + --no-create-home --home /var/run/jabber jabber + fi + # update permissions on folders + chown jabber:adm /var/run/jabber/ + chmod 0775 /var/run/jabber/ + chown -R jabber:adm /var/log/jabber/ + + chown jabber:adm /etc/pyirct.conf.xml /var/lib/jabber-irc + chmod 0640 /etc/pyirct.conf.xml + # start the service + /etc/init.d/jabber-irc restart + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0