Update debian package configuration

darcs-hash:20071113181137-86b55-80a8c5c5bce363657e947a7e3777a2edd4135cc6.gz
This commit is contained in:
David Rousselie
2007-11-13 19:11:37 +01:00
parent e9a3c54b4f
commit 893aac6eaa
18 changed files with 174 additions and 392 deletions

49
debian/README.Debian vendored
View File

@@ -1,49 +0,0 @@
jmc for Debian
--------------
- edit /etc/jabber/jmc.xml to match jabber server configuration :
- for jabberd2, port must match router.xml port
- for ejabberd, add new listening port :
{5347, ejabberd_service, [{access, all},
{host, "jmc.localhost",
[{password, "secret"}]}]}
- then run:
# /etc/init.d/jmc start
Usage:
- Now you can register new mail server connection with your favorite
jabber client.
- all connection are then listed under your service browser and you
can edit mail server parameters by registering on listed connection.
Feedback:
Send me feedback and comments to dax at happycoders dot org
Utils:
- jmc_converter convert from one storage type to another.
$ jmc_converter
-> give you the list of supported types.
Example of usage :
$ jmc_converter \
DBM \
registered.db \
SQLite \
registered.sqlite
-> converts a DBM file (registered.db) to a SQLite file
(registered.sqlite). Once converted, the new file copied in
${spool_dir}/${service}/registered.db where ${spool_dir} and
${service} are defined in jmc.xml configuration file.
- jmc_dump dump a db file. example :
$ jmc_dump DBM registered.db
-- David Rousselie <dax@happycoders.org>, Wed, 26 Jul 2006 22:04:38 +0200

2
debian/conffiles vendored
View File

@@ -1,2 +0,0 @@
/etc/default/jmc
/etc/jabber/jmc.conf

18
debian/control vendored
View File

@@ -2,12 +2,18 @@ Source: jmc
Section: python
Priority: optional
Maintainer: David Rousselie <dax@happycoders.org>
Build-Depends: debhelper (>= 4.1.0)
Standards-Version: 3.6.2
Build-Depends: python-setuptools (>= 0.6b3-1), python-all-dev (>= 2.3.5-11), debhelper (>= 5.0.38), python-central (>= 0.5.6)
Standards-Version: 3.7.2
XS-Python-Version: all
Package: jmc
Package: python-jmc
Architecture: all
Depends: ${python:Depends}, python-pyxmpp (>= 0.5)
Recommends: python2.4-pysqlite2 (>= 2.0)
Depends: ${python:Depends}, python-jcl (>= 0.1)
Recommends:
Suggests:
XB-Python-Version: ${python:Versions}
Provides: ${python:Provides}
Description: JMC is an email gateway for Jabber
JMC is a jabber service to check email from POP3 and IMAP4 server and retrieve them or just a notification of new emails. Jabber users can register multiple email accounts.
JMC is a jabber service to check email from POP3 and IMAP4 server and
retrieve them or just a notification of new emails. Jabber users can
register multiple email accounts.

2
debian/copyright vendored
View File

@@ -1,7 +1,7 @@
This package was debianized by David Rousselie <dax@happycoders.org> on
Wed, 26 Jul 2006 22:04:38 +0200.
It was downloaded from http://people.happycoders.org/dax/jabber/jmc.html
It was downloaded from http://people.happycoders.org/dax/projects/jmc
Copyright Holder: David Rousselie <dax@happycoders.org>

2
debian/dirs vendored
View File

@@ -1,7 +1,5 @@
var/run/jabber
var/log/jabber
var/spool/jabber
etc/default
etc/jabber
usr/share/jmc
usr/bin

196
debian/init.d vendored
View File

@@ -1,147 +1,81 @@
#! /bin/bash -e
#! /bin/sh
#
# skeleton example file to build /etc/init.d/ scripts.
# This file should be used to construct scripts for /etc/init.d.
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
#
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/jmc
NAME=jmc
DESC=jmc
# ----- load init-functions if they exist -----
test -x $DAEMON || exit 0
if [ -f /lib/lsb/init-functions ]; then
. /etc/lsb-release
. /lib/lsb/init-functions
# Include jmc defaults if available
if [ -f /etc/default/jmc ] ; then
. /etc/default/jmc
fi
# ----- Functions for printing messages (Works for debian and looks good in ubuntu too)
log_start()
{
case $DISTRIB_ID.$DISTRIB_RELEASE in
Ubuntu.[0-4].*|Ubuntu.5.[0-9]|Ubuntu.5.10)
log_begin_msg $1
;;
Ubuntu.*.*)
log_daemon_msg $1
;;
*)
echo -n $1
;;
esac
}
log_end()
{
case $DISTRIB_ID.$DISTRIB_RELEASE in
Ubuntu.*.*)
log_end_msg $1
;;
*)
if [ "$1" = "0" ]; then
echo "Started"
else
echo "Error starting daemon, check the logs."
fi
;;
esac
}
log_failure()
{
case $DISTRIB_ID.$DISTRIB_RELEASE in
Ubuntu.*.*)
log_failure_msg $1
;;
*)
echo $1
;;
esac
}
# ----- set required environment -----
TRANS_NAME=jmc
TRANS_DESC="Jabber Mail Component"
TRANS_HOME=/usr/share/$TRANS_NAME
TRANS_CONFIG=/etc/jabber/$TRANS_NAME.conf
TRANS_USER=jabber
TRANS_GROUP=daemon
TRANS_PID=`grep "<pidfile>.*</pidfile>" $TRANS_CONFIG | sed 's:.*<pidfile>\(.*\)</pidfile>.*:\1:'`
TRANS_DAEMON=/usr/bin/jmc
TRANS_START="--chuid $TRANS_USER:$TRANS_GROUP --chdir $TRANS_HOME --pidfile $TRANS_PID"
TRANS_STOP="--pidfile $TRANS_PID"
TRANS_OPTIONS="-c $TRANS_CONFIG"
TRANSPORT_DEFAULTS_FILE=/etc/default/$TRANS_NAME
# ----- Check if transport is enabled -----
if [ -s $TRANSPORT_DEFAULTS_FILE ]; then
. $TRANSPORT_DEFAULTS_FILE
case "x$ENABLE" in
xtrue) ;;
xfalse)
exit 0
;;
*)
log_failure "Value of ENABLE in $TRANSPORT_DEFAULTS_FILE must be either 'true' or 'false';"
log_failure "not starting $TRANS_NAME daemon."
exit 0
;;
esac
else
log_failure "$TRANSPORT_DEFAULTS_FILE not found. Not starting $TRANS_NAME daemon."
exit 1
fi
# ----- do the action -----
set -e
case "$1" in
config)
echo "Configuration:"
echo " TRANS_NAME=$TRANS_NAME"
echo " TRANS_DESC=$TRANS_DESC"
echo " TRANS_HOME=$TRANS_HOME"
echo " TRANS_CONFIG=$TRANS_CONFIG"
echo " TRANS_USER=$TRANS_USER"
echo " TRANS_PID=$TRANS_PID"
echo " TRANS_DAEMON=$TRANS_DAEMON"
echo " TRANS_OPTIONS=$TRANS_OPTIONS"
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
console)
$TRANS_DAEMON $TRANS_OPTIONS
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON
echo "$NAME."
;;
start)
log_start "Starting $TRANS_DESC: "
if start-stop-daemon $TRANS_START --start --oknodo --exec $TRANS_DAEMON -- $TRANS_OPTIONS $DAEMON_OPTS >/dev/null 2>&1; then
log_end 0
else
log_end 1
fi
#reload)
#
# If the daemon can reload its config files on the fly
# for example by sending it SIGHUP, do it here.
#
# If the daemon responds to changes in its config file
# directly anyway, make this a do-nothing entry.
#
# echo "Reloading $DESC configuration files."
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
# /var/run/$NAME.pid --exec $DAEMON
#;;
force-reload)
#
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart" except that it does nothing if the
# daemon isn't already running.
# check wether $DAEMON is running. If so, restart
start-stop-daemon --stop --test --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON \
&& $0 restart \
|| exit 0
;;
stop)
log_start "Stopping $TRANS_DESC: "
if start-stop-daemon --stop $TRANS_STOP --retry 10 --oknodo 2>&1; then
log_end 0
else
log_end 1
fi
restart)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON
sleep 1
start-stop-daemon --start --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
reload|force-reload)
log_start "Reloading $TRANS_DESC: "
if start-stop-daemon --stop $TRANS_STOP --signal HUP >/dev/null 2>&1; then
log_end 0
else
log_end 1
fi
;;
restart)
$0 stop
sleep 5
$0 start
;;
*)
echo "Usage: /etc/init.d/$TRANS_NAME {config|console|start|stop|restart|reload|force-reload}" >&2
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0

22
debian/jmc.conf vendored
View File

@@ -1,22 +0,0 @@
<config>
<jabber>
<server>127.0.0.1</server>
<port>5347</port>
<secret>secret</secret>
<service>jmc.localhost</service>
<connectsleep>5</connectsleep>
<!-- check jmc/utils/lang.py for available languages -->
<language>en</language>
<vCard>
<FN>Jabber Mail Component</FN>
<DESC>A Jabber mail server component</DESC>
<URL>http://people.happycoders.org/dax/jabber/jmc/</URL>
</vCard>
</jabber>
<storage>DBM</storage>
<spooldir>/var/spool/jabber</spooldir>
<pidfile>/var/run/jabber/jmc.pid</pidfile>
<!-- default check interval in minutes -->
<check_interval>5</check_interval>
<mail_default_encoding>iso-8859-1</mail_default_encoding>
</config>

3
debian/jmc.sh vendored
View File

@@ -1,3 +0,0 @@
#!/bin/sh
python /usr/share/jmc/jmc.py $* &

3
debian/postinst vendored
View File

@@ -1,5 +1,5 @@
#! /bin/sh
# postinst script for jabber-pyaim
# postinst script for jmc
#
# see: dh_installdeb(1)
@@ -25,7 +25,6 @@ case "$1" in
# the sanit(ar)y checks otherwise we can safely create it.
if [ "$uid" ]; then
# guess??? the checks!!!
if [ $uid -ge 100 ] && [ $uid -le 999 ]; then
echo "jabber uid check: ok"
else

38
debian/postrm vendored
View File

@@ -1,38 +0,0 @@
#! /bin/sh
# postrm script for jabber-pyaim
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

38
debian/preinst vendored
View File

@@ -1,38 +0,0 @@
#! /bin/sh
# preinst script for jabber-pyaim
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <new-preinst> `install'
# * <new-preinst> `install' <old-version>
# * <new-preinst> `upgrade' <old-version>
# * <old-preinst> `abort-upgrade' <new-version>
#
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
install|upgrade)
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

38
debian/prerm vendored
View File

@@ -1,38 +0,0 @@
#! /bin/sh
# prerm script for jabber-pyaim
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <prerm> `remove'
# * <old-prerm> `upgrade' <new-version>
# * <new-prerm> `failed-upgrade' <old-version>
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
# * <deconfigured's-prerm> `deconfigure' `in-favour'
# <package-being-installed> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
remove|upgrade|deconfigure)
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

120
debian/rules vendored
View File

@@ -1,76 +1,76 @@
#!/usr/bin/make -f
# jmc debian/rules file
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
configure: configure-stamp
configure-stamp:
dh_testdir
touch configure-stamp
# This file was automatically generated by stdeb 0.2.a1 at
# Tue, 13 Nov 2007 19:00:04 +0100
PACKAGE_NAME=python-jmc
MODULE_NAME=jmc
DEB_UPSTREAM_VERSION=0.3
PYVERS=$(shell pyversions -vr)
build: build-stamp
build-stamp: configure-stamp
dh_testdir
touch build-stamp
build-stamp: $(PYVERS:%=build-python%)
touch $@
build-python%:
# Force setuptools, but reset sys.argv[0] to 'setup.py' because setup.py files expect that.
python$* -c "import setuptools,sys;f='setup.py';sys.argv[0]=f;execfile(f,{'__file__':f,'__name__':'__main__'})" build
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
rm -f *-stamp
rm -rf dist build
-find -name '*.py[co]' | xargs rm -f
# find . -name *.pyc -exec rm {} \;
dh_clean
# Clean up package tree
rm -f -R $(CURDIR)/debian/jmc
dh_clean
install: build
install: build install-prereq $(PYVERS:%=install-python%)
install-prereq:
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
dh_clean -k
# Create directory tree for package
install-python%:
# Force setuptools, but reset sys.argv[0] to 'setup.py' because setup.py files expect that.
python$* -c "import setuptools,sys;f='setup.py';sys.argv[0]=f;execfile(f,{'__file__':f,'__name__':'__main__'})" install --no-compile --single-version-externally-managed --root $(CURDIR)/debian/${PACKAGE_NAME}
mv debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages/${MODULE_NAME}-${DEB_UPSTREAM_VERSION}-py$*.egg-info debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages/${MODULE_NAME}.egg-info
binary-arch:
cp -R $(CURDIR)/debian/jmc.conf $(CURDIR)/debian/jmc/etc/jabber/jmc.conf
cp -R $(CURDIR)/debian/jmc-default $(CURDIR)/debian/jmc/etc/default/jmc
cp -R $(CURDIR)/debian/jmc.sh $(CURDIR)/debian/jmc/usr/bin/jmc
cp -R $(CURDIR)/src/* $(CURDIR)/debian/jmc/usr/share/jmc
# Build architecture-independent files here.
binary-indep: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
# dh_installexamples
dh_install
# dh_installmenu
# dh_installdebconf
dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
dh_installinit
# dh_installcron
# dh_installinfo
# dh_installman
dh_link
# dh_strip
# dh_compress
dh_fixperms
# dh_perl
dh_python /usr/share/jmc
# dh_makeshlibs
dh_installdeb
# dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.
dh_testdir -i
dh_testroot -i
dh_pycentral -i
dh_installdocs -i
dh_installdirs -i
dh_installexamples -i
dh_strip -i
dh_compress -i -X.py
dh_fixperms -i
: # Replace all '#!' calls to python with $(PYTHON)
: # and make them executable
for i in \
`find debian/python-jmc/usr/bin -type f` \
`find debian/python-jmc/usr/lib -type f`; \
do \
case "$$i" in *-[0-9].[0-9]) continue; esac; \
sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python\1,' \
$$i > $$i.temp; \
if cmp --quiet $$i $$i.temp; then \
rm -f $$i.temp; \
else \
mv -f $$i.temp $$i; \
chmod 755 $$i; \
echo "fixed interpreter: $$i"; \
fi; \
done
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure