[Lunar-commits] <moonbase> pymsnt: Version bump to 0.11.3. Module revamped.
Stefan Wold
ratler at lunar-linux.org
Wed Feb 16 09:50:32 CET 2011
commit 971bf764aba4e0d1be48c26697395de0eb898277
Author: Stefan Wold <ratler at lunar-linux.org>
Date: Wed Feb 16 09:50:32 2011 +0100
pymsnt: Version bump to 0.11.3. Module revamped.
---
chat/pymsnt/BUILD | 34 +++++++++++++++-------------------
chat/pymsnt/DETAILS | 10 +++++-----
chat/pymsnt/init.d/pymsnt | 21 ++++++++++++++++++---
3 files changed, 38 insertions(+), 27 deletions(-)
diff --git a/chat/pymsnt/BUILD b/chat/pymsnt/BUILD
index 9c1ebb0..9f274e3 100644
--- a/chat/pymsnt/BUILD
+++ b/chat/pymsnt/BUILD
@@ -1,33 +1,29 @@
(
- python_major=`installed_version Python | cut -d. -f1-2`
- python_dir="/usr/lib/python${python_major}/site-packages/pymsnt"
# Fix pid
sedit 's;PyMSNt.pid;/var/run/pymsnt.pid;' config-example.xml &&
- # Stupid tarballs
- find $SOURCE_DIRECTORY/ -type d -name .svn | xargs rm -rf &&
+
+ # Change spool directory
+ sedit 's;.*<spooldir>.*;<spooldir>/var/spool/pymsnt</spooldir>;' config-example.xml &&
+
+ # Fix MSN protocol version
+ sedit 's;MSNP11 CVR0;MSNP11;' src/legacy/msn/msn.py &&
+
prepare_install &&
- if [ ! -d $python_dir ]; then
- mkdir -p $python_dir
- fi &&
- if [ ! -d /etc/jabber ]; then
- mkdir /etc/jabber
- fi &&
- if [ ! -f /etc/jabber/pymsnt.xml ]; then
- install -m600 config-example.xml /etc/jabber/pymsnt.xml
- fi &&
-
- cp -r {src,data} ${python_dir} &&
- find $python_dir -type d | xargs chmod 755 &&
- find $python_dir -type f | xargs chmod 644 &&
- install -m755 PyMSNt.py ${python_dir}/pymsnt.py &&
+ [ -d /usr/lib/pymsnt ] || install -d -m0755 /usr/lib/pymsnt &&
+ [ -d /var/spool/pymsnt ] || install -d -m0750 /var/spool/pymsnt &&
+ [ -d /etc/jabber ] || mkdir -p /etc/jabber &&
+
+ [ -f /etc/jabber/pymsnt.xml ] || install -m600 -o root -g root config-example.xml /etc/jabber/pymsnt.xml &&
+
+ cp -r {PyMSNt.py,src,data} /usr/lib/pymsnt/ &&
# A bit hackish to byte compile everything
cat <<EOF>> /tmp/$$-compileall.py
import compileall
import re
-compileall.compile_dir('$python_dir', rx=re.compile('/[.]svn'), force=True)
+compileall.compile_dir('/usr/lib/pymsnt', rx=re.compile('/[.]svn'), force=True)
EOF
python /tmp/$$-compileall.py &&
diff --git a/chat/pymsnt/DETAILS b/chat/pymsnt/DETAILS
index 0f2cecb..b411609 100644
--- a/chat/pymsnt/DETAILS
+++ b/chat/pymsnt/DETAILS
@@ -1,12 +1,12 @@
MODULE=pymsnt
- VERSION=0.11.2
+ VERSION=0.11.3
SOURCE=${MODULE}-${VERSION}.tar.gz
- SOURCE_URL=http://delx.cjb.net/pymsnt/tarballs/
+ SOURCE_URL=http://delx.net.au/projects/pymsnt/tarballs
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$MODULE-$VERSION
- SOURCE_VFY=sha1:631743956339435e05d69548142e390fd95263ae
- WEB_SITE="http://delx.cjb.net/pymsnt/"
+ SOURCE_VFY=sha256:777195feb6a70b683d691c54269099d319747fad7195cca36d86df366360ce2c
+ WEB_SITE="http://delx.net.au/projects/pymsnt/"
ENTERED=20071003
- UPDATED=20071003
+ UPDATED=20110216
SHORT="MSN transport for jabber servers"
cat <<EOF
MSN transport for jabber servers
diff --git a/chat/pymsnt/init.d/pymsnt b/chat/pymsnt/init.d/pymsnt
index 1835939..0405c34 100644
--- a/chat/pymsnt/init.d/pymsnt
+++ b/chat/pymsnt/init.d/pymsnt
@@ -6,15 +6,30 @@
# description: MSN jabber transport
# config: /etc/jabber/pymsnt.xml
-
start ()
{
- python /usr/lib/python2.5/site-packages/pymsnt/pymsnt.py -c /etc/jabber/pymsnt.xml
+ echo -n "Starting pymsnt jabber transport: "
+ cd /usr/lib/pymsnt &&
+ exec python ./PyMSNt.py -c /etc/jabber/pymsnt.xml &> /dev/null &
+ if [ $? -eq 0 ]; then
+ echo -e "$RESULT_OK"
+ else
+ echo -e "$RESULT_FAIL"
+ exit 1
+ fi
}
stop ()
{
- kill `cat /var/run/pymsnt.pid`
+ echo -n "Stopping pymsnt jabber transport: "
+ PID=$(cat /var/run/pymsnt.pid)
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -eq 0 ]; then
+ echo -e "$RESULT_OK"
+ else
+ echo -e "$RESULT_FAIL"
+ exit 1
+ fi
}
. /lib/lsb/init-functions
More information about the Lunar-commits
mailing list