From 790c84dfd0dd619c6ab2d9df2152e0fca8e7d1f5 Mon Sep 17 00:00:00 2001 From: garga Date: Thu, 2 Mar 2006 20:59:45 +0000 Subject: - Update to 0.11a [1] - Change it to run as jabber and not more as root, which is an unecessary security risk [2] PR: ports/93982 [1], ports/93994 [2] Submitted by: M. Possamai [1] Neil Darlow [2] Approved by: portmgr (erwin) --- net-im/jabber-pymsn/Makefile | 35 ++++---- net-im/jabber-pymsn/distinfo | 6 +- .../files/jabber-pymsn-transport.sh.in | 11 ++- net-im/jabber-pymsn/files/patch-config-example.xml | 11 --- net-im/jabber-pymsn/files/patch-src_config.py | 17 ---- net-im/jabber-pymsn/files/patch-src_main.py | 28 ------- net-im/jabber-pymsn/files/patch-src_utils.py | 12 --- net-im/jabber-pymsn/pkg-plist | 93 ++++++++++++---------- 8 files changed, 78 insertions(+), 135 deletions(-) delete mode 100644 net-im/jabber-pymsn/files/patch-config-example.xml delete mode 100644 net-im/jabber-pymsn/files/patch-src_config.py delete mode 100644 net-im/jabber-pymsn/files/patch-src_main.py delete mode 100644 net-im/jabber-pymsn/files/patch-src_utils.py (limited to 'net-im') diff --git a/net-im/jabber-pymsn/Makefile b/net-im/jabber-pymsn/Makefile index c73bc0ddea96..a8b0607e26e4 100644 --- a/net-im/jabber-pymsn/Makefile +++ b/net-im/jabber-pymsn/Makefile @@ -5,7 +5,7 @@ # $FreeBSD$ PORTNAME= pymsn -PORTVERSION= 0.10.3 +PORTVERSION= 0.11a CATEGORIES= net-im MASTER_SITES= http://msn-transport.jabberstudio.org/tarballs/ PKGNAMEPREFIX= jabber- @@ -17,7 +17,10 @@ MAINTAINER= garga@FreeBSD.org COMMENT= Python MSN-Transport for Jabber RUN_DEPENDS= ${PYTHON_SITELIBDIR}/OpenSSL/__init__.py:${PORTSDIR}/security/py-openssl \ - ${PYTHON_SITELIBDIR}/twisted/__init__.py:${PORTSDIR}/devel/py-twisted + ${PYTHON_SITELIBDIR}/twisted/__init__.py:${PORTSDIR}/devel/py-twisted \ + ${PYTHON_SITELIBDIR}/PIL/__init__.py::${PORTSDIR}/graphics/py-imaging + +WRKSRC= ${WRKDIR}/${PORTNAME}t-0.11 NO_BUILD= yes USE_PYTHON= yes @@ -34,26 +37,28 @@ post-extract: @${FIND} ${WRKSRC}/ -type d \( -name CVS -or -name .svn \) | ${XARGS} ${RM} -rf post-patch: - @${REINPLACE_CMD} -i "" '/spooldir/s|/path/to/data|/var/spool/jabber|' \ + @${REINPLACE_CMD} -i "" -e '/spooldir/s|/path/to/data|/var/spool/jabber|' \ + -e 's|PyMSNt.pid|/var/jabberd/pid/PyMSNt.pid|' \ ${WRKSRC}/config-example.xml @${REINPLACE_CMD} -i "" 's|../config.xml|${PREFIX}/etc/jabber-pymsn.xml|g' \ ${WRKSRC}/src/xmlconfig.py - @${REINPLACE_CMD} -i "" 's|src/legacy|legacy|g' \ - ${WRKSRC}/src/legacy/glue.py \ - ${WRKSRC}/src/legacy/legacylist.py - @${REINPLACE_CMD} -i "" 's|%%PREFIX%%|${PREFIX}|g' \ + @${REINPLACE_CMD} -i "" -e 's|spooldir = ""|spooldir = "/tmp/jabber-pymsn"|g' \ + -e 's|pid = ""|pid = "/var/jabberd/pid/PyMSNt.pid"|g' \ ${WRKSRC}/src/config.py + @${REINPLACE_CMD} -i "" 's|"config.xml"|"${PREFIX}/etc/jabber-pymsn.xml"|' \ + ${WRKSRC}/src/main.py + @${REINPLACE_CMD} -i "" 's|#!/usr/bin/python|#!${PYTHON_CMD}|' \ + ${WRKSRC}/PyMSNt.py @${RM} -f ${WRKSRC}/src/*.orig - @${ECHO} '#!${PYTHON_CMD}' > ${WRKSRC}/src/main.py.new - @${CAT} ${WRKSRC}/src/main.py >> ${WRKSRC}/src/main.py.new - @${MV} ${WRKSRC}/src/main.py.new ${WRKSRC}/src/main.py - @${MV} ${WRKSRC}/src/config.py ${WRKSRC}/src/config.py.sample do-install: - ${INSTALL} -d ${INST_DIR} - @${CP} -pPRv ${WRKSRC}/src/* ${INST_DIR}/ - ${CHMOD} 755 ${INST_DIR}/main.py - @[ -f ${INST_DIR}/config.py ] || ${CP} -v ${INST_DIR}/config.py.sample ${INST_DIR}/config.py + ${MKDIR} ${INST_DIR}/src ${INST_DIR}/data + ${INSTALL_SCRIPT} ${WRKSRC}/PyMSNt.py ${INST_DIR} + ${INSTALL_DATA} ${WRKSRC}/data/defaultJabberAvatar.png ${INST_DIR}/data + ${INSTALL_DATA} ${WRKSRC}/data/defaultMSNAvatar.png ${INST_DIR}/data + @${CP} -Rv ${WRKSRC}/src/* ${INST_DIR}/src/ + @${FIND} ${INST_DIR}/src/ -type d -exec ${CHMOD} 755 "{}" \; + @${FIND} ${INST_DIR}/src/ -type f -exec ${CHMOD} 644 "{}" \; ${MKDIR} ${EXAMPLESDIR}/etc ${INSTALL_DATA} ${WRKSRC}/config-example.xml ${EXAMPLESDIR}/etc/jabber-pymsn.xml @[ -f ${PREFIX}/etc/jabber-pymsn.xml ] || ${CP} -v ${EXAMPLESDIR}/etc/jabber-pymsn.xml ${PREFIX}/etc/jabber-pymsn.xml diff --git a/net-im/jabber-pymsn/distinfo b/net-im/jabber-pymsn/distinfo index 92692d1fffc1..8879be86490b 100644 --- a/net-im/jabber-pymsn/distinfo +++ b/net-im/jabber-pymsn/distinfo @@ -1,3 +1,3 @@ -MD5 (jabber/pymsnt-0.10.3.tar.gz) = 02e2de762c2bb890c8cec2c4222ffa5f -SHA256 (jabber/pymsnt-0.10.3.tar.gz) = ecd836fc27b50acf5c8c774b208c3dbf51207decfc5183654dc09fc1cfa673f2 -SIZE (jabber/pymsnt-0.10.3.tar.gz) = 235140 +MD5 (jabber/pymsnt-0.11a.tar.gz) = 58afdee2a1e1a9a4aca38c1cd892028d +SHA256 (jabber/pymsnt-0.11a.tar.gz) = e083a4ca50a074bfd9fd924279b27379e1cf042c90355bb25eb7f40328bdccce +SIZE (jabber/pymsnt-0.11a.tar.gz) = 257753 diff --git a/net-im/jabber-pymsn/files/jabber-pymsn-transport.sh.in b/net-im/jabber-pymsn/files/jabber-pymsn-transport.sh.in index 1e395925c01f..9d286a93cd01 100644 --- a/net-im/jabber-pymsn/files/jabber-pymsn-transport.sh.in +++ b/net-im/jabber-pymsn/files/jabber-pymsn-transport.sh.in @@ -19,15 +19,14 @@ rcvar=`set_rcvar` load_rc_config $name +: ${jabber_pymsn_enable="NO"} : ${jabber_pymsn_dir="%%PREFIX%%/lib/jabber/pymsn"} : ${jabber_pymsn_piddir="/var/jabberd/pid"} -: ${jabber_pymsn_enable="NO"} - -jabber_pymsn_chdir=${jabber_pymsn_dir} +: ${jabber_pymsn_user="jabber"} -pidfile="${jabber_pymsn_piddir}/pymsn.pid" +pidfile="${jabber_pymsn_piddir}/PyMSNt.pid" command_interpreter="%%PYTHON_CMD%%" -command="${jabber_pymsn_dir}/main.py" -command_args="-o pid=${pidfile} &" +command_args="-p ${pidfile}" +command="${jabber_pymsn_dir}/PyMSNt.py" run_rc_command "$1" diff --git a/net-im/jabber-pymsn/files/patch-config-example.xml b/net-im/jabber-pymsn/files/patch-config-example.xml deleted file mode 100644 index bd4a2c625424..000000000000 --- a/net-im/jabber-pymsn/files/patch-config-example.xml +++ /dev/null @@ -1,11 +0,0 @@ ---- config-example.xml.orig Tue Dec 6 07:11:29 2005 -+++ config-example.xml Tue Dec 6 07:12:36 2005 -@@ -12,6 +12,8 @@ - Do not include the jid of the transport --> - - -+ -+/var/jabberd/pid/pymsn.pid - - - 127.0.0.1 diff --git a/net-im/jabber-pymsn/files/patch-src_config.py b/net-im/jabber-pymsn/files/patch-src_config.py deleted file mode 100644 index 46173846741a..000000000000 --- a/net-im/jabber-pymsn/files/patch-src_config.py +++ /dev/null @@ -1,17 +0,0 @@ ---- src/config.py.orig Mon Dec 5 16:43:57 2005 -+++ src/config.py Mon Dec 5 16:45:18 2005 -@@ -1,11 +1,12 @@ - # This file contains the default settings for various options. - # Please edit config.xml instead of this file - --configFile = "config.xml" -+configFile = "%%PREFIX%%/etc/jabber-pymsn.xml" - - jid = "msn" - compjid = "" --spooldir = "" -+spooldir = "/tmp/jabber-pymsn" -+pid = "/var/jabberd/pid/pymsn.pid" - - mainServer = "127.0.0.1" - mainServerJID = "" diff --git a/net-im/jabber-pymsn/files/patch-src_main.py b/net-im/jabber-pymsn/files/patch-src_main.py deleted file mode 100644 index e7879f61f293..000000000000 --- a/net-im/jabber-pymsn/files/patch-src_main.py +++ /dev/null @@ -1,28 +0,0 @@ ---- src/main.py.orig Mon Dec 5 16:39:23 2005 -+++ src/main.py Mon Dec 5 16:41:07 2005 -@@ -233,6 +233,17 @@ - - class App: - def __init__(self): -+ # Check that there isn't already a PID file -+ if(os.path.isfile(utils.doPath(config.pid))): -+ print "PID file exists at that location. Please check for running PyMSNt and try again." -+ sys.exit(1) -+ -+ # Create a PID file -+ pid = str(os.getpid()) -+ pf = file(utils.doPath(config.pid),'w') -+ pf.write("%s\n" % pid); -+ pf.close() -+ - jid = config.jid - if config.compjid: jid = config.compjid - self.c = component.buildServiceManager(jid, config.secret, "tcp:%s:%s" % (config.mainServer, config.port)) -@@ -248,6 +259,7 @@ - - def shuttingDown(self): - self.transportSvc.removeMe() -+ os.remove(utils.doPath(config.pid)) - # Keep the transport running for another 3 seconds - def cb(ignored=None): - pass diff --git a/net-im/jabber-pymsn/files/patch-src_utils.py b/net-im/jabber-pymsn/files/patch-src_utils.py deleted file mode 100644 index f3da375e78bb..000000000000 --- a/net-im/jabber-pymsn/files/patch-src_utils.py +++ /dev/null @@ -1,12 +0,0 @@ ---- src/utils.py.orig Mon Dec 5 16:41:53 2005 -+++ src/utils.py Mon Dec 5 16:42:18 2005 -@@ -180,4 +180,8 @@ - def flush(self): - self.lst = [] - -- -+def doPath(path): -+ if(path and path[0] == "/"): -+ return path -+ else: -+ return "../" + path diff --git a/net-im/jabber-pymsn/pkg-plist b/net-im/jabber-pymsn/pkg-plist index b715affee63b..3ad853670623 100644 --- a/net-im/jabber-pymsn/pkg-plist +++ b/net-im/jabber-pymsn/pkg-plist @@ -1,49 +1,56 @@ @unexec if cmp -s %D/%%EXAMPLESDIR%%/etc/jabber-pymsn.xml %D/etc/jabber-pymsn.xml; then rm -f %D/etc/jabber-pymsn.xml; fi %%EXAMPLESDIR%%/etc/jabber-pymsn.xml @exec [ -f %D/etc/jabber-pymsn.xml ] || cp %B/%f %D/etc/jabber-pymsn.xml -lib/jabber/pymsn/avatar.py -lib/jabber/pymsn/baseproto/__init__.py -lib/jabber/pymsn/baseproto/glue.py -@unexec if cmp -s %D/lib/jabber/pymsn/config.py.sample %D/lib/jabber/pymsn/config.py; then rm -f %D/lib/jabber/pymsn/config.py; fi -lib/jabber/pymsn/config.py.sample -@exec [ -f %D/lib/jabber/pymsn/config.py ] || cp %B/%f %D/lib/jabber/pymsn/config.py -lib/jabber/pymsn/contact.py -lib/jabber/pymsn/debug.py -lib/jabber/pymsn/disco.py -lib/jabber/pymsn/groupchat.py -lib/jabber/pymsn/housekeep.py -lib/jabber/pymsn/jabw.py -lib/jabber/pymsn/lang.py -lib/jabber/pymsn/legacy/__init__.py -lib/jabber/pymsn/legacy/defaultAvatar.png -lib/jabber/pymsn/legacy/defaultJabberAvatar.png -lib/jabber/pymsn/legacy/glue.py -lib/jabber/pymsn/legacy/legacylist.py -lib/jabber/pymsn/legacy/msnw.py -lib/jabber/pymsn/main.py -lib/jabber/pymsn/misciq.py -lib/jabber/pymsn/register.py -lib/jabber/pymsn/session.py -lib/jabber/pymsn/tlib/__init__.py -lib/jabber/pymsn/tlib/domish.py -lib/jabber/pymsn/tlib/jabber/__init__.py -lib/jabber/pymsn/tlib/jabber/client.py -lib/jabber/pymsn/tlib/jabber/component.py -lib/jabber/pymsn/tlib/jabber/jid.py -lib/jabber/pymsn/tlib/jabber/jstrports.py -lib/jabber/pymsn/tlib/jabber/xmpp_stringprep.py -lib/jabber/pymsn/tlib/msn.py -lib/jabber/pymsn/tlib/msnp11chl.py -lib/jabber/pymsn/tlib/msnp2p.py -lib/jabber/pymsn/tlib/xmlstream.py -lib/jabber/pymsn/tlib/xmlw.py -lib/jabber/pymsn/utils.py -lib/jabber/pymsn/xdb.py -lib/jabber/pymsn/xmlconfig.py -@dirrm lib/jabber/pymsn/tlib/jabber -@dirrm lib/jabber/pymsn/tlib -@dirrm lib/jabber/pymsn/legacy -@dirrm lib/jabber/pymsn/baseproto +lib/jabber/pymsn/PyMSNt.py +lib/jabber/pymsn/data/defaultJabberAvatar.png +lib/jabber/pymsn/data/defaultMSNAvatar.png +lib/jabber/pymsn/src/avatar.py +lib/jabber/pymsn/src/baseproto/__init__.py +lib/jabber/pymsn/src/baseproto/glue.py +lib/jabber/pymsn/src/config.py +lib/jabber/pymsn/src/contact.py +lib/jabber/pymsn/src/debug.py +lib/jabber/pymsn/src/disco.py +lib/jabber/pymsn/src/ft.py +lib/jabber/pymsn/src/groupchat.py +lib/jabber/pymsn/src/housekeep.py +lib/jabber/pymsn/src/jabw.py +lib/jabber/pymsn/src/lang.py +lib/jabber/pymsn/src/legacy/__init__.py +lib/jabber/pymsn/src/legacy/glue.py +lib/jabber/pymsn/src/main.py +lib/jabber/pymsn/src/misciq.py +lib/jabber/pymsn/src/register.py +lib/jabber/pymsn/src/session.py +lib/jabber/pymsn/src/tlib/__init__.py +lib/jabber/pymsn/src/tlib/domish.py +lib/jabber/pymsn/src/tlib/jabber/__init__.py +lib/jabber/pymsn/src/tlib/jabber/client.py +lib/jabber/pymsn/src/tlib/jabber/component.py +lib/jabber/pymsn/src/tlib/jabber/jid.py +lib/jabber/pymsn/src/tlib/jabber/jstrports.py +lib/jabber/pymsn/src/tlib/jabber/xmpp_stringprep.py +lib/jabber/pymsn/src/tlib/msn/__init__.py +lib/jabber/pymsn/src/tlib/msn/msn.py +lib/jabber/pymsn/src/tlib/msn/msnft.py +lib/jabber/pymsn/src/tlib/msn/msnp11chl.py +lib/jabber/pymsn/src/tlib/msn/msnw.py +lib/jabber/pymsn/src/tlib/msn/test_msn.py +lib/jabber/pymsn/src/tlib/msn/test_msnw.py +lib/jabber/pymsn/src/tlib/socks5.py +lib/jabber/pymsn/src/tlib/throttle.py +lib/jabber/pymsn/src/tlib/xmlstream.py +lib/jabber/pymsn/src/tlib/xmlw.py +lib/jabber/pymsn/src/utils.py +lib/jabber/pymsn/src/xdb.py +lib/jabber/pymsn/src/xmlconfig.py +@dirrm lib/jabber/pymsn/src/tlib/msn +@dirrm lib/jabber/pymsn/src/tlib/jabber +@dirrm lib/jabber/pymsn/src/tlib +@dirrm lib/jabber/pymsn/src/legacy +@dirrm lib/jabber/pymsn/src/baseproto +@dirrm lib/jabber/pymsn/src +@dirrm lib/jabber/pymsn/data @dirrm lib/jabber/pymsn @dirrmtry lib/jabber @dirrm %%EXAMPLESDIR%%/etc -- cgit