1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00

Python ICQ-Transport for Jabber.

The purpose of this transport is to provide a way for users to be logged into
ICQ via their Jabber account. It is implemented in Python, using the Twisted
framework. This project is just getting off the ground, and so it does not have
quite the functionality of other transports yet. That will come in time.

PR:		ports/81994
Submitted by:	Renato Botelho <freebsd@galle.com.br>
This commit is contained in:
Pav Lucistnik 2005-06-07 15:18:15 +00:00
parent ab32e20b45
commit afe46a3a17
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=136996
15 changed files with 403 additions and 0 deletions

View File

@ -0,0 +1,66 @@
# New ports collection makefile for: Jabber Python ICQ Transport
# Date created: 2005-06-07
# Whom: Renato Botelho <freebsd@galle.com.br>
#
# $FreeBSD$
PORTNAME= pyicq
PORTVERSION= 0.6
CATEGORIES= net
MASTER_SITES= http://www.blathersource.org/download.php/pyicq-t/
PKGNAMEPREFIX= jabber-
PKGNAMESUFFIX= -transport
DISTNAME= ${PORTNAME}-t-${PORTVERSION}
DIST_SUBDIR= jabber
MAINTAINER= freebsd@galle.com.br
COMMENT= Python ICQ-Transport for Jabber
RUN_DEPENDS= ${PYTHON_SITELIBDIR}/OpenSSL/__init__.py:${PORTSDIR}/security/py-openssl \
${PYTHON_SITELIBDIR}/twisted/__init__.py:${PORTSDIR}/devel/py-twisted
NO_BUILD= yes
USE_PYTHON= yes
USE_REINPLACE= yes
USE_RC_SUBR= jabber-pyicq-transport.sh
SUB_FILES= pkg-message
SUB_LIST= PYTHON_CMD=${PYTHON_CMD}
INST_DIR= ${PREFIX}/lib/jabber/${PORTNAME}
PORTDOCS= COPYING README TODO
post-extract:
@${FIND} ${WRKSRC}/src -type d -name '.svn' | ${XARGS} ${RM} -rf
post-patch:
@${REINPLACE_CMD} -e '/spooldir/s|\.|/var/spool/jabber|' \
-e '/pid/s|PyICQt.pid|/var/jabberd/pid/${PORTNAME}.pid|' \
-e '/<debugOn>/s|<debugOn>|<!--<debugOn>-->|' \
${WRKSRC}/config_example.xml
@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g; s|%%PYTHON_CMD%%|${PYTHON_CMD}|g' \
${WRKSRC}/src/main.py
@${RM} ${WRKSRC}/src/main.py.*
@${MV} ${WRKSRC}/src/config.py ${WRKSRC}/src/config.py.sample
do-install:
${INSTALL} -d ${INST_DIR}
${CP} -pPR ${WRKSRC}/src/* ${INST_DIR}/
${CHMOD} 755 ${INST_DIR}/main.py
[ -f ${INST_DIR}/config.py ] || ${CP} ${INST_DIR}/config.py.sample ${INST_DIR}/config.py
${INSTALL_SCRIPT} -m 751 ${WRKDIR}/${PKGBASE}.sh ${PREFIX}/etc/rc.d/${PKGBASE}.sh
@${MKDIR} ${EXAMPLESDIR}/etc
${INSTALL_DATA} ${WRKSRC}/config_example.xml ${EXAMPLESDIR}/etc/jabber-pyicq.xml
[ -f ${PREFIX}/etc/jabber-pyicq.xml ] || ${CP} ${EXAMPLESDIR}/etc/jabber-pyicq.xml ${PREFIX}/etc/jabber-pyicq.xml
.if !defined(NOPORTDOCS)
.for portdoc in ${PORTDOCS}
@${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/${portdoc} ${DOCSDIR}/
.endfor
.endif
post-install:
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
MD5 (jabber/pyicq-t-0.6.tar.gz) = 5c6f8cd598465124d886f1c47f88c809
SIZE (jabber/pyicq-t-0.6.tar.gz) = 140654

View File

@ -0,0 +1,34 @@
#!/bin/sh
# Start or stop jabber-pyicq
# $FreeBSD$
# PROVIDE: jabber_pyicq
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: FreeBSD shutdown
#
# Define these jabber_pyicq_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
jabber_pyicq_dir=${jabberd_pyicq_dir-"%%PREFIX%%/lib/jabber/pyicq"}
jabber_pyicq_piddir=${jabberd_pyicq_piddir-"/var/jabberd/pid"}
jabber_pyicq_enable=${jabberd_pyicq_enable-"NO"}
. %%RC_SUBR%%
name="jabber_pyicq"
rcvar=`set_rcvar`
command_interpreter="%%PYTHON_CMD%%"
command="${jabber_pyicq_dir}/main.py"
command_args="&"
#procname="${PYTHON} ${jabber_pyicq_dir}/main.py"
pidfile="${jabber_pyicq_piddir}/pyicq.pid"
load_rc_config $name
run_rc_command "$1"

View File

@ -0,0 +1,24 @@
--- src/main.py.orig Tue Jun 7 09:54:58 2005
+++ src/main.py Tue Jun 7 09:56:26 2005
@@ -1,3 +1,4 @@
+#!%%PYTHON_CMD%%
# Copyright 2004 James Bunton <james@delx.cjb.net>
# Licensed for distribution under the GPL version 2, check COPYING for details
@@ -13,15 +14,9 @@
print("You are using version %s of Python, at least 2.3 is required." % (sys.version[:3]))
os._exit(0)
-name = "PyICQt"
-exe = os.path.realpath(sys.executable)
-if (exe.find("python") >= 0):
- print("Restarting with process name %s..." % (name))
- os.execv(exe, [name, sys.argv[0]]+sys.argv[1:])
-
import config
import xmlconfig
-conffile = "config.xml"
+conffile = "%%PREFIX%%/etc/jabber-pyicq.xml"
options = {}
opts, args = getopt.getopt(sys.argv[1:], "c:o:dDl:h", ["config=", "option=", "debug", "Debug", "log=", "help"])
for o, v in opts:

View File

@ -0,0 +1,22 @@
******************************************************************************
Remember to edit %%PREFIX%%/etc/jabber-pyicq.xml to suit your needs.
* The 'jid' setting should be what ID you want PyICQt to take on the network.
* The 'mainServer' setting should be the IP address or DNS of the main Jabberd
server.
* The 'secret' setting should match the secret specified for component
connections in your main Jabberd server.
* The 'port' setting is the port that PyICQt is to connect to (more details on
this below.
* You can also turn on debugging options, and customise some of the text that
is sent to the users in this file.
If you are using Jabberd2 then you shouldn't have to do much configuration.
Make sure the 'mainServer' setting is the IP or DNS of your Jabber server, and
leave the 'port' setting alone. Double-check that the secret for legacy
components in router.xml (for Jabberd2) is the same as the secret setting in
config.py. That should be all. You don't even need to restart Jabberd2.
If you are using Jabberd1.4.x, it's a bit more complicated. Follow the setup
instructions at http://pyicq-t.blathersource.org/install.php
******************************************************************************

View File

@ -0,0 +1,8 @@
Python ICQ-Transport for Jabber.
The purpose of this transport is to provide a way for users to be logged into
ICQ via their Jabber account. It is implemented in Python, using the Twisted
framework. This project is just getting off the ground, and so it does not have
quite the functionality of other transports yet. That will come in time.
WWW: http://pyicq-t.blathersource.org/

View File

@ -0,0 +1,45 @@
@comment $FreeBSD$
@unexec if cmp -s %D/%%EXAMPLESDIR%%/etc/jabber-pyicq.xml %D/etc/jabber-pyicq.xml; then rm -f %D/etc/jabber-pyicq.xml; fi
%%EXAMPLESDIR%%/etc/jabber-pyicq.xml
@exec [ -f %D/etc/jabber-pyicq.xml ] || cp %B/%f %D/etc/jabber-pyicq.xml
@unexec if cmp -s %D/lib/jabber/pyicq/config.py.sample %D/lib/jabber/pyicq/config.py; then rm -f %D/lib/jabber/pyicq/config.py; fi
lib/jabber/pyicq/config.py.sample
@exec [ -f %D/lib/jabber/pyicq/config.py ] || cp %B/%f %D/lib/jabber/pyicq/config.py
lib/jabber/pyicq/debug.py
lib/jabber/pyicq/disco.py
lib/jabber/pyicq/jabw.py
lib/jabber/pyicq/lang.py
lib/jabber/pyicq/legacy/__init__.py
lib/jabber/pyicq/legacy/glue.py
lib/jabber/pyicq/legacy/icqt.py
lib/jabber/pyicq/main.py
lib/jabber/pyicq/misciq.py
lib/jabber/pyicq/register.py
lib/jabber/pyicq/session.py
lib/jabber/pyicq/stats.py
lib/jabber/pyicq/tlib/__init__.py
lib/jabber/pyicq/tlib/countrycodes.py
lib/jabber/pyicq/tlib/domish.py
lib/jabber/pyicq/tlib/jabber/__init__.py
lib/jabber/pyicq/tlib/jabber/client.py
lib/jabber/pyicq/tlib/jabber/component.py
lib/jabber/pyicq/tlib/jabber/jid.py
lib/jabber/pyicq/tlib/jabber/jstrports.py
lib/jabber/pyicq/tlib/langcodes.py
lib/jabber/pyicq/tlib/oscar.py
lib/jabber/pyicq/tlib/socks5.py
lib/jabber/pyicq/tlib/sockserror.py
lib/jabber/pyicq/tlib/xmlstream.py
lib/jabber/pyicq/utils.py
lib/jabber/pyicq/webadmin/__init__.py
lib/jabber/pyicq/webadmin/handler.py
lib/jabber/pyicq/xdb.py
lib/jabber/pyicq/xmlconfig.py
@dirrm lib/jabber/pyicq/legacy
@dirrm lib/jabber/pyicq/tlib/jabber
@dirrm lib/jabber/pyicq/tlib
@dirrm lib/jabber/pyicq/webadmin
@dirrm lib/jabber/pyicq
@unexec rmdir %D/lib/jabber 2>/dev/null || true
@dirrm %%EXAMPLESDIR%%/etc
@dirrm %%EXAMPLESDIR%%

View File

@ -261,6 +261,7 @@
SUBDIR += jabber-conference
SUBDIR += jabber-jud
SUBDIR += jabber-msn
SUBDIR += jabber-pyicq
SUBDIR += jabber-pymsn
SUBDIR += jabber-xdb_ldap
SUBDIR += jabber-yahoo

66
net/jabber-pyicq/Makefile Normal file
View File

@ -0,0 +1,66 @@
# New ports collection makefile for: Jabber Python ICQ Transport
# Date created: 2005-06-07
# Whom: Renato Botelho <freebsd@galle.com.br>
#
# $FreeBSD$
PORTNAME= pyicq
PORTVERSION= 0.6
CATEGORIES= net
MASTER_SITES= http://www.blathersource.org/download.php/pyicq-t/
PKGNAMEPREFIX= jabber-
PKGNAMESUFFIX= -transport
DISTNAME= ${PORTNAME}-t-${PORTVERSION}
DIST_SUBDIR= jabber
MAINTAINER= freebsd@galle.com.br
COMMENT= Python ICQ-Transport for Jabber
RUN_DEPENDS= ${PYTHON_SITELIBDIR}/OpenSSL/__init__.py:${PORTSDIR}/security/py-openssl \
${PYTHON_SITELIBDIR}/twisted/__init__.py:${PORTSDIR}/devel/py-twisted
NO_BUILD= yes
USE_PYTHON= yes
USE_REINPLACE= yes
USE_RC_SUBR= jabber-pyicq-transport.sh
SUB_FILES= pkg-message
SUB_LIST= PYTHON_CMD=${PYTHON_CMD}
INST_DIR= ${PREFIX}/lib/jabber/${PORTNAME}
PORTDOCS= COPYING README TODO
post-extract:
@${FIND} ${WRKSRC}/src -type d -name '.svn' | ${XARGS} ${RM} -rf
post-patch:
@${REINPLACE_CMD} -e '/spooldir/s|\.|/var/spool/jabber|' \
-e '/pid/s|PyICQt.pid|/var/jabberd/pid/${PORTNAME}.pid|' \
-e '/<debugOn>/s|<debugOn>|<!--<debugOn>-->|' \
${WRKSRC}/config_example.xml
@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g; s|%%PYTHON_CMD%%|${PYTHON_CMD}|g' \
${WRKSRC}/src/main.py
@${RM} ${WRKSRC}/src/main.py.*
@${MV} ${WRKSRC}/src/config.py ${WRKSRC}/src/config.py.sample
do-install:
${INSTALL} -d ${INST_DIR}
${CP} -pPR ${WRKSRC}/src/* ${INST_DIR}/
${CHMOD} 755 ${INST_DIR}/main.py
[ -f ${INST_DIR}/config.py ] || ${CP} ${INST_DIR}/config.py.sample ${INST_DIR}/config.py
${INSTALL_SCRIPT} -m 751 ${WRKDIR}/${PKGBASE}.sh ${PREFIX}/etc/rc.d/${PKGBASE}.sh
@${MKDIR} ${EXAMPLESDIR}/etc
${INSTALL_DATA} ${WRKSRC}/config_example.xml ${EXAMPLESDIR}/etc/jabber-pyicq.xml
[ -f ${PREFIX}/etc/jabber-pyicq.xml ] || ${CP} ${EXAMPLESDIR}/etc/jabber-pyicq.xml ${PREFIX}/etc/jabber-pyicq.xml
.if !defined(NOPORTDOCS)
.for portdoc in ${PORTDOCS}
@${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/${portdoc} ${DOCSDIR}/
.endfor
.endif
post-install:
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
MD5 (jabber/pyicq-t-0.6.tar.gz) = 5c6f8cd598465124d886f1c47f88c809
SIZE (jabber/pyicq-t-0.6.tar.gz) = 140654

View File

@ -0,0 +1,34 @@
#!/bin/sh
# Start or stop jabber-pyicq
# $FreeBSD$
# PROVIDE: jabber_pyicq
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: FreeBSD shutdown
#
# Define these jabber_pyicq_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
jabber_pyicq_dir=${jabberd_pyicq_dir-"%%PREFIX%%/lib/jabber/pyicq"}
jabber_pyicq_piddir=${jabberd_pyicq_piddir-"/var/jabberd/pid"}
jabber_pyicq_enable=${jabberd_pyicq_enable-"NO"}
. %%RC_SUBR%%
name="jabber_pyicq"
rcvar=`set_rcvar`
command_interpreter="%%PYTHON_CMD%%"
command="${jabber_pyicq_dir}/main.py"
command_args="&"
#procname="${PYTHON} ${jabber_pyicq_dir}/main.py"
pidfile="${jabber_pyicq_piddir}/pyicq.pid"
load_rc_config $name
run_rc_command "$1"

View File

@ -0,0 +1,24 @@
--- src/main.py.orig Tue Jun 7 09:54:58 2005
+++ src/main.py Tue Jun 7 09:56:26 2005
@@ -1,3 +1,4 @@
+#!%%PYTHON_CMD%%
# Copyright 2004 James Bunton <james@delx.cjb.net>
# Licensed for distribution under the GPL version 2, check COPYING for details
@@ -13,15 +14,9 @@
print("You are using version %s of Python, at least 2.3 is required." % (sys.version[:3]))
os._exit(0)
-name = "PyICQt"
-exe = os.path.realpath(sys.executable)
-if (exe.find("python") >= 0):
- print("Restarting with process name %s..." % (name))
- os.execv(exe, [name, sys.argv[0]]+sys.argv[1:])
-
import config
import xmlconfig
-conffile = "config.xml"
+conffile = "%%PREFIX%%/etc/jabber-pyicq.xml"
options = {}
opts, args = getopt.getopt(sys.argv[1:], "c:o:dDl:h", ["config=", "option=", "debug", "Debug", "log=", "help"])
for o, v in opts:

View File

@ -0,0 +1,22 @@
******************************************************************************
Remember to edit %%PREFIX%%/etc/jabber-pyicq.xml to suit your needs.
* The 'jid' setting should be what ID you want PyICQt to take on the network.
* The 'mainServer' setting should be the IP address or DNS of the main Jabberd
server.
* The 'secret' setting should match the secret specified for component
connections in your main Jabberd server.
* The 'port' setting is the port that PyICQt is to connect to (more details on
this below.
* You can also turn on debugging options, and customise some of the text that
is sent to the users in this file.
If you are using Jabberd2 then you shouldn't have to do much configuration.
Make sure the 'mainServer' setting is the IP or DNS of your Jabber server, and
leave the 'port' setting alone. Double-check that the secret for legacy
components in router.xml (for Jabberd2) is the same as the secret setting in
config.py. That should be all. You don't even need to restart Jabberd2.
If you are using Jabberd1.4.x, it's a bit more complicated. Follow the setup
instructions at http://pyicq-t.blathersource.org/install.php
******************************************************************************

View File

@ -0,0 +1,8 @@
Python ICQ-Transport for Jabber.
The purpose of this transport is to provide a way for users to be logged into
ICQ via their Jabber account. It is implemented in Python, using the Twisted
framework. This project is just getting off the ground, and so it does not have
quite the functionality of other transports yet. That will come in time.
WWW: http://pyicq-t.blathersource.org/

View File

@ -0,0 +1,45 @@
@comment $FreeBSD$
@unexec if cmp -s %D/%%EXAMPLESDIR%%/etc/jabber-pyicq.xml %D/etc/jabber-pyicq.xml; then rm -f %D/etc/jabber-pyicq.xml; fi
%%EXAMPLESDIR%%/etc/jabber-pyicq.xml
@exec [ -f %D/etc/jabber-pyicq.xml ] || cp %B/%f %D/etc/jabber-pyicq.xml
@unexec if cmp -s %D/lib/jabber/pyicq/config.py.sample %D/lib/jabber/pyicq/config.py; then rm -f %D/lib/jabber/pyicq/config.py; fi
lib/jabber/pyicq/config.py.sample
@exec [ -f %D/lib/jabber/pyicq/config.py ] || cp %B/%f %D/lib/jabber/pyicq/config.py
lib/jabber/pyicq/debug.py
lib/jabber/pyicq/disco.py
lib/jabber/pyicq/jabw.py
lib/jabber/pyicq/lang.py
lib/jabber/pyicq/legacy/__init__.py
lib/jabber/pyicq/legacy/glue.py
lib/jabber/pyicq/legacy/icqt.py
lib/jabber/pyicq/main.py
lib/jabber/pyicq/misciq.py
lib/jabber/pyicq/register.py
lib/jabber/pyicq/session.py
lib/jabber/pyicq/stats.py
lib/jabber/pyicq/tlib/__init__.py
lib/jabber/pyicq/tlib/countrycodes.py
lib/jabber/pyicq/tlib/domish.py
lib/jabber/pyicq/tlib/jabber/__init__.py
lib/jabber/pyicq/tlib/jabber/client.py
lib/jabber/pyicq/tlib/jabber/component.py
lib/jabber/pyicq/tlib/jabber/jid.py
lib/jabber/pyicq/tlib/jabber/jstrports.py
lib/jabber/pyicq/tlib/langcodes.py
lib/jabber/pyicq/tlib/oscar.py
lib/jabber/pyicq/tlib/socks5.py
lib/jabber/pyicq/tlib/sockserror.py
lib/jabber/pyicq/tlib/xmlstream.py
lib/jabber/pyicq/utils.py
lib/jabber/pyicq/webadmin/__init__.py
lib/jabber/pyicq/webadmin/handler.py
lib/jabber/pyicq/xdb.py
lib/jabber/pyicq/xmlconfig.py
@dirrm lib/jabber/pyicq/legacy
@dirrm lib/jabber/pyicq/tlib/jabber
@dirrm lib/jabber/pyicq/tlib
@dirrm lib/jabber/pyicq/webadmin
@dirrm lib/jabber/pyicq
@unexec rmdir %D/lib/jabber 2>/dev/null || true
@dirrm %%EXAMPLESDIR%%/etc
@dirrm %%EXAMPLESDIR%%