summaryrefslogtreecommitdiff
path: root/net-im
diff options
context:
space:
mode:
authorHanno Boeck <hanno@gentoo.org>2011-09-04 10:26:35 +0000
committerHanno Boeck <hanno@gentoo.org>2011-09-04 10:26:35 +0000
commitb972b0f0b450057fa65b512939001a29ef81c6a4 (patch)
tree9f75a474f1516dbc4aa5c724d45c47b6b9f19d7f /net-im
parentfix bug reference (diff)
downloadhistorical-b972b0f0b450057fa65b512939001a29ef81c6a4.tar.gz
historical-b972b0f0b450057fa65b512939001a29ef81c6a4.tar.bz2
historical-b972b0f0b450057fa65b512939001a29ef81c6a4.zip
pymsn-t: fix deprecations in python and init-script, port to eapi 3
Package-Manager: portage-2.1.10.13/cvs/Linux x86_64
Diffstat (limited to 'net-im')
-rw-r--r--net-im/pymsn-t/ChangeLog11
-rw-r--r--net-im/pymsn-t/Manifest25
-rw-r--r--net-im/pymsn-t/files/pymsn-t-0.11.3-use-non-deprecated-hashlib.patch163
-rw-r--r--net-im/pymsn-t/files/pymsn-t-initd23
-rw-r--r--net-im/pymsn-t/pymsn-t-0.11.3-r3.ebuild72
5 files changed, 286 insertions, 8 deletions
diff --git a/net-im/pymsn-t/ChangeLog b/net-im/pymsn-t/ChangeLog
index 47cc7eb0a5dc..ab8c357bcd20 100644
--- a/net-im/pymsn-t/ChangeLog
+++ b/net-im/pymsn-t/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-im/pymsn-t
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-im/pymsn-t/ChangeLog,v 1.20 2010/07/06 16:08:47 arfrever Exp $
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-im/pymsn-t/ChangeLog,v 1.21 2011/09/04 10:26:35 hanno Exp $
+
+*pymsn-t-0.11.3-r3 (04 Sep 2011)
+
+ 04 Sep 2011; Hanno Boeck <hanno@gentoo.org> +pymsn-t-0.11.3-r3.ebuild,
+ +files/pymsn-t-0.11.3-use-non-deprecated-hashlib.patch, +files/pymsn-t-initd:
+ Add patch for python 2.6/2.7 warnings, remove deprecated chuid from init
+ script, port to EAPI 3.
06 Jul 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
pymsn-t-0.11.3.ebuild, pymsn-t-0.11.3-r1.ebuild, pymsn-t-0.11.3-r2.ebuild:
diff --git a/net-im/pymsn-t/Manifest b/net-im/pymsn-t/Manifest
index 4c9eef897110..e67fb08cd6c6 100644
--- a/net-im/pymsn-t/Manifest
+++ b/net-im/pymsn-t/Manifest
@@ -1,21 +1,34 @@
-----BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
+Hash: SHA256
AUX pymsn-t-0.11.2-initd 683 RMD160 7dfd35f2d31800e04ffd764efc1b65845311d32f SHA1 878d12e1d722d97eca2a9ba001e2dcc8797b4ceb SHA256 df24c7a7f4e8eb394daea3a5b79b0a861f72a2b56ec5c52871fb514d731231b2
AUX pymsn-t-0.11.3-delete-reactor.patch 361 RMD160 ef4d492ea177658d7f7e867ef11bab3dde273164 SHA1 4a01f2fc80c287da13422532b2c75ccafa012ae0 SHA256 d989d06d9e94f1a2786dfa51e1cf715e4dc0db95583b08ce606b555aef017bae
AUX pymsn-t-0.11.3-protocol-version.patch 609 RMD160 f7cc7e2f6829861f11016db35a98396d5a0cd7c8 SHA1 7144ebaac17a61767aee92ef1b4e972c86eb5325 SHA256 008aedc95f1c2020a156d941c74784ca1385f12426342885fa7ff8474365b5a3
AUX pymsn-t-0.11.3-remove-pid.patch 1173 RMD160 53c9e2cfc63cd86fd5680059e47caa268802cfc0 SHA1 a6dac3945731183f4821e7f09852f17de3aa850a SHA256 b4a09f2af01f752a2703d14204cb954a0641afedb1be391f1b9f6f980b234845
AUX pymsn-t-0.11.3-unexpected-xfr.patch 1984 RMD160 b4439b435857a4bd4eb0ff4a7b75572ef4413f7b SHA1 abccc3a11a7571e6f17de91c001f8f07e300c20e SHA256 0407e9e69684275b11d404e77e9b70e694e461d4c9891ee3c7d79717999a84e9
+AUX pymsn-t-0.11.3-use-non-deprecated-hashlib.patch 5062 RMD160 e975deb1511c6fd105e96b0e14bd65ea719543a3 SHA1 41788e52053c91bedf236d446409092633391faf SHA256 eb3e737fa8717e0cedbed74811f8f000c0e53a6d7ee7bdd803f185fef13582af
+AUX pymsn-t-initd 670 RMD160 6132d34521516f23ffc7ee44bba2c9cc6168822b SHA1 9d04f8e3ff28f12b4c60b296910df0b53f5d57af SHA256 557dc37a1c51b03188623e3b4fd0329eea87ee4428bb397439359656daa3d431
DIST pymsnt-0.11.3.tar.gz 162549 RMD160 59e2af9eee9aa1d5b7a408b05fd520f0355556e1 SHA1 093ce984446f9edeec9d9d35a07a3958f5f656b1 SHA256 777195feb6a70b683d691c54269099d319747fad7195cca36d86df366360ce2c
EBUILD pymsn-t-0.11.3-r1.ebuild 1899 RMD160 c997b7fbdbb26a5fd184342e6ad3009620648c04 SHA1 111944251910f074c67d87d02bf5c0fdc8057d07 SHA256 d2fec985aaeed4cd6581fa71584b832e87afb3c07c18de5709b9a96a11ae28ad
EBUILD pymsn-t-0.11.3-r2.ebuild 2039 RMD160 0c5bdf2c22c8257a772b6208bb0a2881f4dcbb98 SHA1 b17cbc4711ea416ed3153fec74d205ee7ca6c33d SHA256 4db1efb068c2df29e9d7489db926c5d8bfd7584bcd6935d5b3bf7c66d564389b
+EBUILD pymsn-t-0.11.3-r3.ebuild 1990 RMD160 61e5101efb266c86d9d0e18c1682a89115a12cbe SHA1 e9c4a266b41fb929bacfbb8a6633ffa767d03ce8 SHA256 c049b2e4532219fb470028813732ef102ab264e89720f2b586cfd162bd717dad
EBUILD pymsn-t-0.11.3.ebuild 1781 RMD160 821846fc23b131669e851715edd016bf0306cdc6 SHA1 f6462f7190243690d95875fde0cd650db48fbffa SHA256 208a2ae3369dcdb681cb4fe901477e1fd025442018b7d819ffe9dd894428047b
-MISC ChangeLog 4360 RMD160 249963936318b31494bd8ed21705a542137992d2 SHA1 8be59149ba8824dd6f856fb29ae9a0ee11ff4c3c SHA256 b1b6fac30a07d42139be7192ea0b37aae7c763afbc4da8e3034952ded6c62959
+MISC ChangeLog 4646 RMD160 0e7e25c1a2d5c868e4d074fc9210cd1ded8bcd45 SHA1 93dc8dbe127a96d783e17dd21e0a2b9b24d9778f SHA256 ae3ea081706c7a735cd92828dc505f02e71bfa7f6eb88f42fe3f149922b0dd51
MISC metadata.xml 233 RMD160 f084e59937efaafc248fef86ff3d45eaf759760c SHA1 7ca07014d5c7abb57fc2e1916b37c04efdae6772 SHA256 06ee3fd43c4bea5d5528843a5a6fedaeea4ad97807b81ea46c4ba57b8f54b6d0
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.16 (GNU/Linux)
+Version: GnuPG v2.0.18 (GNU/Linux)
-iEYEARECAAYFAkzRzgIACgkQ9/cejkQaxBA7iACfdmj6AcSailfJJcYuloyR4PwZ
-T+MAnij6BugAO0tcgsW6KuOjlKW0pnwW
-=rMg9
+iQIcBAEBCAAGBQJOY1JjAAoJEKWIAHK7tR5CaUMP/3o+Ot9XzW8EfQn6lgVz5ICr
+aIyCNm16bfWUC7sv/KdfQFGCyLKUNgaoiPwMKH/dSQ5Zvr4SCUwA36+nF83OTZxS
+OPdbItaT0PBIamyEnc37D4U+XeSsFw8THKYAUzXm3ZkBu4pCEo7iLVvwC5528XMB
+qvADV2pOVV7TmJmCr1OLwvklTPHka1xVdZ2R0KUkzXx1/EOxWLYfvYffMGheAT1f
+HwkKW8I3xIurwEcbDJXs4RWm0aeIE3L9UJVMMCAwPIxdtm/9wXk1KNPadDahT2Ou
+NQmMP8vz3vqMhTXgMufB2bRdpHHuBmthgNjtcVCKTCpYB7t8mQ+vPv4S9D9bQUxV
+/2gVP6CI1q/vtU3HPNnNpFsJ3scpqkeCh1z7H8mEkPJOibhT0qHBXgjcwJrzduic
+FcmIodg1QOM5DU8OrUMlfyLErnDbjTHHN2yU2Ad9Dl8O4PPQZ9IyRYut/+6q1Hg3
+u077/a0iAmxMpKQiGLWC7GMHVS6AKm8zwmMkkqGmGTzk16sz07Yx8zZygWWvl7d3
+W+1YlcbFa5mQPPDbjW5zldmtVddMnuBw9kQfbNCZnDzUaZAjv8tETuWs0gIh4RM6
+vF5iH2pEzYwRSK2/bX+auJs7fsDsc4uIYeBgBSFLZZFF5rgpR35L0ClkcvUxI3mh
+AJw9b6lNbkaofDEkw1Rh
+=C8Tc
-----END PGP SIGNATURE-----
diff --git a/net-im/pymsn-t/files/pymsn-t-0.11.3-use-non-deprecated-hashlib.patch b/net-im/pymsn-t/files/pymsn-t-0.11.3-use-non-deprecated-hashlib.patch
new file mode 100644
index 000000000000..f02d83fff08c
--- /dev/null
+++ b/net-im/pymsn-t/files/pymsn-t-0.11.3-use-non-deprecated-hashlib.patch
@@ -0,0 +1,163 @@
+From 87d6eac62671152c318ea2cb839a748b06723ee2 Mon Sep 17 00:00:00 2001
+From: Matthew W. S. Bell <matthew@bells23.org.uk>
+Date: Sat, 12 Feb 2011 19:44:18 +0000
+Subject: [PATCH 2/4] Use newer (non-deprecataed) hashlib module, if available.
+
+---
+ src/avatar.py | 9 +++++++--
+ src/legacy/msn/msn.py | 11 +++++++----
+ src/legacy/msn/msnp11chl.py | 8 ++++++--
+ src/utils.py | 12 ++++++------
+ src/xdb.py | 8 ++++++--
+ 5 files changed, 32 insertions(+), 16 deletions(-)
+
+diff --git a/src/avatar.py b/src/avatar.py
+index b9f7dfc..3aa0a3c 100644
+--- a/src/avatar.py
++++ b/src/avatar.py
+@@ -6,7 +6,12 @@ from debug import LogEvent, INFO, WARN, ERROR
+ from twisted.internet import reactor
+ from twisted.words.xish.domish import Element
+
+-import sha, base64, os, os.path
++import base64, os, os.path
++
++try:
++ from hashlib import sha1
++except ImportError:
++ from sha import sha as sha1
+
+ import utils
+ import config
+@@ -34,7 +39,7 @@ def parsePhotoEl(photo):
+ class Avatar:
+ """ Represents an Avatar. Does not store the image in memory. """
+ def __init__(self, imageData, avatarCache):
+- self.__imageHash = sha.sha(imageData).hexdigest()
++ self.__imageHash = sha1(imageData).hexdigest()
+ self.__avatarCache = avatarCache
+
+ def getImageHash(self):
+diff --git a/src/legacy/msn/msn.py b/src/legacy/msn/msn.py
+index cd36aa8..e27e973 100644
+--- a/src/legacy/msn/msn.py
++++ b/src/legacy/msn/msn.py
+@@ -106,9 +106,12 @@ from twisted.words.xish.domish import parseText, unescapeFromXml
+
+
+ # System imports
+-import types, operator, os, sys, base64, random, struct, random, sha, base64, StringIO, array, codecs, binascii
++import types, operator, os, sys, base64, random, struct, random, base64, StringIO, array, codecs, binascii
+ from urllib import quote, unquote
+-
++try:
++ from hashlib import sha1
++except ImportError:
++ from sha import sha as sha1
+
+ MSN_PROTOCOL_VERSION = "MSNP11" # protocol version
+ MSN_PORT = 1863 # default dispatch server port
+@@ -490,7 +493,7 @@ class MSNObject:
+ self.type = 3
+ self.location = "TMP" + str(random.randint(1000,9999))
+ self.friendly = "AAA="
+- self.sha1d = b64enc(sha.sha(imageData).digest())
++ self.sha1d = b64enc(sha1(imageData).digest())
+ self.makeText()
+
+ def setNull(self):
+@@ -518,7 +521,7 @@ class MSNObject:
+ h.append(self.friendly)
+ h.append("SHA1D")
+ h.append(self.sha1d)
+- sha1c = b64enc(sha.sha("".join(h)).digest())
++ sha1c = b64enc(sha1("".join(h)).digest())
+ self.text = '<msnobj Creator="%s" Size="%s" Type="%s" Location="%s" Friendly="%s" SHA1D="%s" SHA1C="%s"/>' % (self.creator, str(self.size), str(self.type), self.location, self.friendly, self.sha1d, sha1c)
+
+ def parse(self, s):
+diff --git a/src/legacy/msn/msnp11chl.py b/src/legacy/msn/msnp11chl.py
+index bbf4c4d..9368df0 100644
+--- a/src/legacy/msn/msnp11chl.py
++++ b/src/legacy/msn/msnp11chl.py
+@@ -1,16 +1,20 @@
+ # Copyright 2005 James Bunton <james@delx.cjb.net>
+ # Licensed for distribution under the GPL version 2, check COPYING for details
+
+-import md5
+ import struct
+
++try:
++ from hashlib import md5
++except ImportError:
++ from md5 import md5
++
+ MSNP11_PRODUCT_ID = "PROD0090YUAUV{2B"
+ MSNP11_PRODUCT_KEY = "YMM8C_H7KCQ2S_KL"
+ MSNP11_MAGIC_NUM = 0x0E79A9C1
+
+
+ def doChallenge(chlData):
+- md5digest = md5.md5(chlData + MSNP11_PRODUCT_KEY).digest()
++ md5digest = md5(chlData + MSNP11_PRODUCT_KEY).digest()
+
+ # Make array of md5 string ints
+ md5Ints = struct.unpack("<llll", md5digest)
+diff --git a/src/utils.py b/src/utils.py
+index cb73ea3..88110ae 100644
+--- a/src/utils.py
++++ b/src/utils.py
+@@ -1,17 +1,17 @@
+ # Copyright 2004-2005 James Bunton <james@delx.cjb.net>
+ # Licensed for distribution under the GPL version 2, check COPYING for details
+
++try:
++ from hashlib import sha1
++except ImportError:
++ from sha import sha as sha1
+
++def socks5Hash(sid, initiator, target):
++ return sha1("%s%s%s" % (sid, initiator, target)).hexdigest()
+
+ def getLang(el):
+ return el.getAttribute((u'http://www.w3.org/XML/1998/namespace', u'lang'))
+
+-
+-import sha
+-def socks5Hash(sid, initiator, target):
+- return sha.new("%s%s%s" % (sid, initiator, target)).hexdigest()
+-
+-
+ import urllib
+ import os.path
+ def getURLBits(url, assumedType=None):
+diff --git a/src/xdb.py b/src/xdb.py
+index a3e3b5d..bd48582 100644
+--- a/src/xdb.py
++++ b/src/xdb.py
+@@ -6,9 +6,13 @@ from debug import LogEvent, INFO, WARN
+ import os
+ import os.path
+ import shutil
+-import md5
+ import config
+
++try:
++ from hashlib import md5
++except ImportError:
++ from md5 import md5
++
+ X = os.path.sep
+ SPOOL_UMASK = 0077
+
+@@ -23,7 +27,7 @@ def mangle(file):
+ return file.replace("@", "%")
+
+ def makeHash(file):
+- return md5.md5(file).hexdigest()[0:3]
++ return md5(file).hexdigest()[0:3]
+
+
+ class XDB:
+--
+1.7.2.3
+
diff --git a/net-im/pymsn-t/files/pymsn-t-initd b/net-im/pymsn-t/files/pymsn-t-initd
new file mode 100644
index 000000000000..7a04be03d3a5
--- /dev/null
+++ b/net-im/pymsn-t/files/pymsn-t-initd
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-im/pymsn-t/files/pymsn-t-initd,v 1.1 2011/09/04 10:26:35 hanno Exp $
+
+depend() {
+ need net
+ use jabber-server
+}
+
+start() {
+ ebegin "Starting MSN Jabber Transport"
+ start-stop-daemon --start --pidfile /var/run/jabber/pymsn-t.pid -u jabber -g jabber \
+ --exec /usr/bin/python INSPATH/pymsn-t.py -- \
+ -b -c /etc/jabber/pymsn-t.xml -l /var/log/jabber/pymsn-t.log
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping MSN Jabber Transport"
+ start-stop-daemon --stop --quiet --pidfile /var/run/jabber/pymsn-t.pid
+ eend $?
+}
diff --git a/net-im/pymsn-t/pymsn-t-0.11.3-r3.ebuild b/net-im/pymsn-t/pymsn-t-0.11.3-r3.ebuild
new file mode 100644
index 000000000000..2f1a18fdd9db
--- /dev/null
+++ b/net-im/pymsn-t/pymsn-t-0.11.3-r3.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-im/pymsn-t/pymsn-t-0.11.3-r3.ebuild,v 1.1 2011/09/04 10:26:35 hanno Exp $
+
+EAPI="3"
+
+inherit eutils multilib python
+
+MY_PN="pymsnt"
+S=${WORKDIR}/${MY_PN}-${PV}
+DESCRIPTION="Python based jabber transport for MSN"
+HOMEPAGE="http://msn-transport.jabberstudio.org/"
+SRC_URI="http://msn-transport.jabberstudio.org/tarballs/${MY_PN}-${PV}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+DEPEND="net-im/jabber-base"
+RDEPEND="${DEPEND}
+ >=dev-python/twisted-2.5.0
+ >=dev-python/twisted-words-0.5.0
+ >=dev-python/twisted-web-0.7.0
+ >=dev-python/imaging-1.1"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-protocol-version.patch"
+ epatch "${FILESDIR}/${P}-unexpected-xfr.patch"
+ epatch "${FILESDIR}/${P}-remove-pid.patch"
+ epatch "${FILESDIR}/${P}-delete-reactor.patch"
+ epatch "${FILESDIR}/${P}-use-non-deprecated-hashlib.patch"
+}
+
+src_install() {
+ local inspath
+
+ inspath=$(python_get_sitedir)/${PN}
+ insinto ${inspath}
+ doins -r data src
+ newins PyMSNt.py ${PN}.py
+
+ insinto /etc/jabber
+ newins config-example.xml ${PN}.xml
+ fperms 600 /etc/jabber/${PN}.xml
+ fowners jabber:jabber /etc/jabber/${PN}.xml
+ dosed \
+ "s:<!-- <spooldir>[^\<]*</spooldir> -->:<spooldir>/var/spool/jabber</spooldir>:" \
+ /etc/jabber/${PN}.xml
+ dosed \
+ "s:<pid>[^\<]*</pid>:<pid>/var/run/jabber/${PN}.pid</pid>:" \
+ /etc/jabber/${PN}.xml
+ dosed \
+ "s:<host>[^\<]*</host>:<host>example.org</host>:" \
+ /etc/jabber/${PN}.xml
+ dosed \
+ "s:<jid>msn</jid>:<jid>msn.example.org</jid>:" \
+ /etc/jabber/${PN}.xml
+
+ newinitd "${FILESDIR}/${PN}-initd" ${PN}
+ dosed "s:INSPATH:${inspath}:" /etc/init.d/${PN}
+}
+
+pkg_postinst() {
+ python_mod_optimize ${PN}
+
+ elog "A sample configuration file has been installed in /etc/jabber/${PN}.xml."
+ elog "Please edit it and the configuration of your Jabber server to match."
+}
+
+pkg_postrm() {
+ python_mod_cleanup ${PN}
+}