updated hashlib patch; added updated ebuild with PYTHON_DEPEND variable
This commit is contained in:
parent
76d9b983da
commit
0cd39f1560
4 changed files with 87 additions and 109 deletions
|
@ -1,8 +1,9 @@
|
|||
AUX pymsn-t-0.11.3-delete-reactor.patch 361 RMD160 ef4d492ea177658d7f7e867ef11bab3dde273164 SHA1 4a01f2fc80c287da13422532b2c75ccafa012ae0 SHA256 d989d06d9e94f1a2786dfa51e1cf715e4dc0db95583b08ce606b555aef017bae
|
||||
AUX pymsn-t-0.11.3-hashlib.patch 4575 RMD160 06bf319a8e526fc8bfbab9a7f82dbbd58fc5d4da SHA1 86acdd0209689b09e8e3887c642aebf9c5202108 SHA256 9595ae8eac2acbd156f63929a18f0d90f40077d37a732074337e9020588763d3
|
||||
AUX pymsn-t-0.11.3-initd 686 RMD160 9c5e1aaa99a2d4899a878841e27084beea669dcd SHA1 50c70df0ffd09a89aa8f7d23fb4050c5ab33fe2d SHA256 e4a27743c6727922d6fd9b0c728ee013ab25668c30de896d61d527aee4af2c57
|
||||
AUX pymsn-t-0.11.3-hashlib.patch 790 RMD160 c3c98536843373f2ff76688bb356171070569740 SHA1 128cf6c5902305585abdb1ac03f9146042d625be SHA256 c211374d0fe79c0e03495e86e13786fa2673f3179cdcd5965a5edb7aaf4f4f2a
|
||||
AUX pymsn-t-0.11.3-initd 683 RMD160 7dfd35f2d31800e04ffd764efc1b65845311d32f SHA1 878d12e1d722d97eca2a9ba001e2dcc8797b4ceb SHA256 df24c7a7f4e8eb394daea3a5b79b0a861f72a2b56ec5c52871fb514d731231b2
|
||||
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
|
||||
DIST pymsnt-0.11.3.tar.gz 162549 RMD160 59e2af9eee9aa1d5b7a408b05fd520f0355556e1 SHA1 093ce984446f9edeec9d9d35a07a3958f5f656b1 SHA256 777195feb6a70b683d691c54269099d319747fad7195cca36d86df366360ce2c
|
||||
EBUILD pymsn-t-0.11.3-r3.ebuild 2172 RMD160 64bcd8d754bf1e1881b7893b2669721756998053 SHA1 81e0a9766d6b24b41b5ab2f7f3a362e5cd730686 SHA256 095f17f1d0ed4f4d591cd2ff70694100379f846cf309919bbfe56c32e19ef912
|
||||
EBUILD pymsn-t-0.11.3-r4.ebuild 2174 RMD160 b93a535176329e08dc1992c103365252fafed146 SHA1 4f9cdf89edeaac7636b3677f1c29214f5feabe74 SHA256 f0caef470d85ce3bb33dee154fdc85ec6977acc2dfe77f99edd4943cc7ea1be2
|
||||
|
|
|
@ -1,122 +1,24 @@
|
|||
diff -ru pymsnt-0.11.3-vanilla/src/avatar.py pymsnt-0.11.3/src/avatar.py
|
||||
--- pymsnt-0.11.3-vanilla/src/avatar.py 2008-02-08 13:55:07.000000000 +0000
|
||||
+++ pymsnt-0.11.3/src/avatar.py 2010-01-20 17:18:44.000000000 +0000
|
||||
@@ -6,7 +6,7 @@
|
||||
from twisted.internet import reactor
|
||||
from twisted.words.xish.domish import Element
|
||||
|
||||
-import sha, base64, os, os.path
|
||||
+import hashlib, base64, os, os.path
|
||||
|
||||
import utils
|
||||
import config
|
||||
@@ -34,7 +34,7 @@
|
||||
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 = hashlib.sha1(imageData).hexdigest()
|
||||
self.__avatarCache = avatarCache
|
||||
|
||||
def getImageHash(self):
|
||||
diff -ru pymsnt-0.11.3-vanilla/src/legacy/msn/msn.py pymsnt-0.11.3/src/legacy/msn/msn.py
|
||||
--- pymsnt-0.11.3-vanilla/src/legacy/msn/msn.py 2008-02-08 13:55:07.000000000 +0000
|
||||
+++ pymsnt-0.11.3/src/legacy/msn/msn.py 2010-01-20 17:18:25.000000000 +0000
|
||||
@@ -106,7 +106,7 @@
|
||||
|
||||
|
||||
# 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, hashlib, base64, StringIO, array, codecs, binascii
|
||||
from urllib import quote, unquote
|
||||
|
||||
|
||||
@@ -490,7 +490,7 @@
|
||||
self.type = 3
|
||||
self.location = "TMP" + str(random.randint(1000,9999))
|
||||
self.friendly = "AAA="
|
||||
- self.sha1d = b64enc(sha.sha(imageData).digest())
|
||||
+ self.sha1d = b64enc(hashlib.sha1(imageData).digest())
|
||||
self.makeText()
|
||||
|
||||
def setNull(self):
|
||||
@@ -518,7 +518,7 @@
|
||||
h.append(self.friendly)
|
||||
h.append("SHA1D")
|
||||
h.append(self.sha1d)
|
||||
- sha1c = b64enc(sha.sha("".join(h)).digest())
|
||||
+ sha1c = b64enc(hashlib.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 -ru pymsnt-0.11.3-vanilla/src/legacy/msn/msnp11chl.py pymsnt-0.11.3/src/legacy/msn/msnp11chl.py
|
||||
--- pymsnt-0.11.3-vanilla/src/legacy/msn/msnp11chl.py 2008-02-08 13:55:07.000000000 +0000
|
||||
+++ pymsnt-0.11.3/src/legacy/msn/msnp11chl.py 2010-01-20 17:20:28.000000000 +0000
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright 2005 James Bunton <james@delx.cjb.net>
|
||||
# Licensed for distribution under the GPL version 2, check COPYING for details
|
||||
|
||||
-import md5
|
||||
+import hashlib
|
||||
import struct
|
||||
|
||||
MSNP11_PRODUCT_ID = "PROD0090YUAUV{2B"
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
def doChallenge(chlData):
|
||||
- md5digest = md5.md5(chlData + MSNP11_PRODUCT_KEY).digest()
|
||||
+ md5digest = hashlib.md5(chlData + MSNP11_PRODUCT_KEY).digest()
|
||||
|
||||
# Make array of md5 string ints
|
||||
md5Ints = struct.unpack("<llll", md5digest)
|
||||
diff -ru pymsnt-0.11.3-vanilla/src/twistfix/words/xish/xmlstream.py pymsnt-0.11.3/src/twistfix/words/xish/xmlstream.py
|
||||
--- pymsnt-0.11.3-vanilla/src/twistfix/words/xish/xmlstream.py 2008-02-08 13:56:54.000000000 +0000
|
||||
+++ pymsnt-0.11.3/src/twistfix/words/xish/xmlstream.py 2010-01-20 17:19:09.000000000 +0000
|
||||
@@ -29,8 +29,8 @@
|
||||
|
||||
def hashPassword(sid, password):
|
||||
"""Create a SHA1-digest string of a session identifier and password """
|
||||
- import sha
|
||||
- return sha.new("%s%s" % (sid, password)).hexdigest()
|
||||
+ import hashlib
|
||||
+ return hashlib.sha1("%s%s" % (sid, password)).hexdigest()
|
||||
|
||||
class Authenticator:
|
||||
""" Base class for business logic of authenticating an XmlStream
|
||||
diff -ru pymsnt-0.11.3-vanilla/src/utils.py pymsnt-0.11.3/src/utils.py
|
||||
--- pymsnt-0.11.3-vanilla/src/utils.py 2008-02-08 13:55:07.000000000 +0000
|
||||
+++ pymsnt-0.11.3/src/utils.py 2010-01-20 17:19:40.000000000 +0000
|
||||
@@ -7,9 +7,9 @@
|
||||
--- pymsnt-0.11.3-vanilla/src/utils.py 2008-02-08 14:55:07.000000000 +0100
|
||||
+++ pymsnt-0.11.3/src/utils.py 2010-08-15 21:46:32.000000000 +0200
|
||||
@@ -7,7 +7,7 @@
|
||||
return el.getAttribute((u'http://www.w3.org/XML/1998/namespace', u'lang'))
|
||||
|
||||
|
||||
-import sha
|
||||
+import hashlib
|
||||
+from hashlib import sha
|
||||
def socks5Hash(sid, initiator, target):
|
||||
- return sha.new("%s%s%s" % (sid, initiator, target)).hexdigest()
|
||||
+ return hashlib.sha1("%s%s%s" % (sid, initiator, target)).hexdigest()
|
||||
return sha.new("%s%s%s" % (sid, initiator, target)).hexdigest()
|
||||
|
||||
|
||||
import urllib
|
||||
diff -ru pymsnt-0.11.3-vanilla/src/xdb.py pymsnt-0.11.3/src/xdb.py
|
||||
--- pymsnt-0.11.3-vanilla/src/xdb.py 2008-02-08 13:55:07.000000000 +0000
|
||||
+++ pymsnt-0.11.3/src/xdb.py 2010-01-20 17:21:01.000000000 +0000
|
||||
--- pymsnt-0.11.3-vanilla/src/xdb.py 2008-02-08 14:55:07.000000000 +0100
|
||||
+++ pymsnt-0.11.3/src/xdb.py 2010-08-15 21:46:57.000000000 +0200
|
||||
@@ -6,7 +6,7 @@
|
||||
import os
|
||||
import os.path
|
||||
import shutil
|
||||
-import md5
|
||||
+import hashlib
|
||||
+from hashlib import md5
|
||||
import config
|
||||
|
||||
X = os.path.sep
|
||||
@@ -23,7 +23,7 @@
|
||||
return file.replace("@", "%")
|
||||
|
||||
def makeHash(file):
|
||||
- return md5.md5(file).hexdigest()[0:3]
|
||||
+ return hashlib.md5(file).hexdigest()[0:3]
|
||||
|
||||
|
||||
class XDB:
|
||||
|
|
|
@ -11,7 +11,7 @@ depend() {
|
|||
start() {
|
||||
ebegin "Starting MSN Jabber Transport"
|
||||
start-stop-daemon --start --pidfile /var/run/jabber/pymsn-t.pid --chuid jabber:jabber \
|
||||
--exec /usr/bin/python2.6 INSPATH/pymsn-t.py -- \
|
||||
--exec /usr/bin/python INSPATH/pymsn-t.py -- \
|
||||
-b -c /etc/jabber/pymsn-t.xml -l /var/log/jabber/pymsn-t.log
|
||||
eend $?
|
||||
}
|
||||
|
|
75
net-im/pymsn-t/pymsn-t-0.11.3-r4.ebuild
Normal file
75
net-im/pymsn-t/pymsn-t-0.11.3-r4.ebuild
Normal file
|
@ -0,0 +1,75 @@
|
|||
# Copyright 1999-2009 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-r2.ebuild,v 1.3 2009/03/09 14:12:04 armin76 Exp $
|
||||
|
||||
PYTHON_DEPEND="2"
|
||||
|
||||
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-9.0.0
|
||||
>=dev-python/twisted-words-9.0.0
|
||||
>=dev-python/twisted-web-9.0.0
|
||||
>=dev-python/imaging-1.1"
|
||||
|
||||
src_unpack() {
|
||||
unpack ${A} && cd "${S}" || die "unpack failed"
|
||||
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}-hashlib.patch"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local inspath
|
||||
|
||||
python_version
|
||||
inspath=/usr/$(get_libdir)/python${PYVER}/site-packages/${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}/${P}-initd" ${PN}
|
||||
dosed "s:INSPATH:${inspath}:" /etc/init.d/${PN}
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
python_version
|
||||
python_mod_optimize /usr/$(get_libdir)/python${PYVER}/site-packages/${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 /usr/$(get_libdir)/python*/site-packages/${PN}
|
||||
}
|
Loading…
Reference in a new issue