--- jabber-muc-0.8.orig/debian/preinst
+++ jabber-muc-0.8/debian/preinst
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+    upgrade)
+    ;;
+
+    install|abort-upgrade)
+    ;;
+
+    *)
+        echo "preinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+if ! getent group | grep -q "^jabber:"
+then
+   addgroup --system jabber
+fi
+
+if ! getent passwd | grep -q "^jabber:"
+then
+   adduser --system --home /var/lib/jabberd2 --no-create-home \
+   --quiet --disabled-password --ingroup jabber jabber
+fi
+
+#DEBHELPER#
+
+exit 0
--- jabber-muc-0.8.orig/debian/dirs
+++ jabber-muc-0.8/debian/dirs
@@ -0,0 +1,8 @@
+usr/sbin
+usr/share/doc/jabber-muc
+etc/default
+etc/jabberd2/component.d
+var/log/jabberd2
+var/run/jabberd2
+var/spool/jabber-muc/rooms
+var/spool/jabber-muc/rooms-logs
--- jabber-muc-0.8.orig/debian/jabberd2-muc.xml
+++ jabber-muc-0.8/debian/jabberd2-muc.xml
@@ -0,0 +1,46 @@
+<jcr>
+
+  <name>conference.localhost</name> <!-- the jid of your component -->
+  <host>conference.localhost</host> <!-- this should be the same as above -->
+  <ip>localhost</ip> <!-- adress of the jabber server -->
+  <port>5347</port>  <!-- port used to connect the service to the jabber server -->
+  <secret>secret</secret> <!-- secret shared with the jabber server -->
+
+  <spool>/var/spool/jabber-muc/rooms/</spool> <!-- directory containing the rooms data -->
+  <logdir>/var/log/jabberd2/</logdir> <!-- directory containing the debug log (the file is called mu-conference.log) -->
+  <pidfile>/var/run/jabberd2/muc.pid</pidfile> <!-- file that will contain the PID of the process -->
+
+  <!--   <logstderr/> --> <!-- uncomment to also send log to stderr -->
+
+  <loglevel>124</loglevel> <!-- log verbosity, 255 for very verbose, 0 for quiet -->
+
+    <conference xmlns="jabber:config:conference">
+      <public/> <!-- rooms are public when created, comment to make them private by default -->
+      <!-- the vCard section contains the vCard of the service -->
+      <vCard>
+        <FN>Public Chatrooms</FN>
+        <DESC>This service is for public chatrooms.</DESC>
+        <URL>http://localhost/</URL>
+      </vCard>
+      <history>40</history> <!-- maximum numbers of history lines send when joining a room -->
+      <logdir>/var/spool/jabber-muc/rooms-logs/</logdir> <!-- where to store the room logs, comment to disable logging -->
+      <!--logsubdirs/--> <!-- uncomment to stores the room logs in subdirs (for example 2007/08/02) -->
+      <stylesheet>../style.css</stylesheet> <!--URL of the log stylesheet -->
+      <!-- default text to send to legacy clients, will also be used in the logs -->
+      <notice>
+        <join>has become available</join>
+        <leave>has left</leave>
+        <rename>is now known as</rename>
+      </notice>
+      <!-- lists of admins of the service, add a <user/> tag by admin -->
+      <sadmin>
+        <user>admin@localhost</user>
+      </sadmin>
+      <!-- <dynamic/> --> <!-- when uncommented, only dynamic rooms can be created -->
+      <!-- <persistent/> --> <!-- persistent rooms will be created, overide <dynamic/> -->
+      <!-- <locknicks/> --> <!-- enforce the user nickname to the user part of his jid -->
+      <!-- <roomlock/> --> <!-- uncomment to allow only admins to create rooms -->
+      <!-- <hideempty/> --> <!-- uncomment to hide rooms with no participants -->
+    </conference>
+
+</jcr>
--- jabber-muc-0.8.orig/debian/lintian-overrides
+++ jabber-muc-0.8/debian/lintian-overrides
@@ -0,0 +1 @@
+jabber-muc binary: dir-or-file-in-var-run
--- jabber-muc-0.8.orig/debian/docs
+++ jabber-muc-0.8/debian/docs
@@ -0,0 +1,4 @@
+FAQ
+README
+TODO
+XEP0045_SUPPORT
--- jabber-muc-0.8.orig/debian/compat
+++ jabber-muc-0.8/debian/compat
@@ -0,0 +1 @@
+7
--- jabber-muc-0.8.orig/debian/rules
+++ jabber-muc-0.8/debian/rules
@@ -0,0 +1,77 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2
+endif
+
+configure: configure-stamp
+
+configure-stamp:
+	dh_testdir
+
+	touch $@
+
+build: build-stamp
+
+build-stamp: configure-stamp
+	dh_testdir
+
+	make
+
+	touch $@
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+
+	make clean
+
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	dh_installdirs
+	# misc installs
+	install -m 755 $(CURDIR)/src/mu-conference $(CURDIR)/debian/jabber-muc/usr/sbin/mu-conference
+	install -m 644 $(CURDIR)/debian/jabberd2-muc.xml $(CURDIR)/debian/jabber-muc/etc/jabberd2/muc.xml
+	install -m 644 $(CURDIR)/debian/default $(CURDIR)/debian/jabber-muc/etc/default/jabber-muc
+	install -m 755 $(CURDIR)/debian/component.d/60muc $(CURDIR)/debian/jabber-muc/etc/jabberd2/component.d/60muc
+	# lintian overrides
+	install -D -m 644 $(CURDIR)/debian/lintian-overrides $(CURDIR)/debian/jabber-muc/usr/share/lintian/overrides/jabber-muc
+
+binary-indep:
+
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs ChangeLog
+	dh_installdocs
+	dh_installexamples
+	dh_install
+#	dh_installdebconf
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
--- jabber-muc-0.8.orig/debian/postinst
+++ jabber-muc-0.8/debian/postinst
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+    configure)
+        chown jabber:jabber /var/spool/jabber-muc
+        chmod 750 /var/spool/jabber-muc
+        chown jabber:jabber /var/spool/jabber-muc/rooms
+        chmod 750 /var/spool/jabber-muc/rooms
+        chown jabber:jabber /var/spool/jabber-muc/rooms-logs
+        chmod 750 /var/spool/jabber-muc/rooms-logs
+        chown jabber:jabber /etc/jabberd2
+        chmod 750 /etc/jabberd2
+        chown jabber:jabber /var/log/jabberd2
+        chmod 750 /var/log/jabberd2
+        chown jabber:jabber /var/run/jabberd2
+        chmod 755 /var/run/jabberd2
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- jabber-muc-0.8.orig/debian/prerm
+++ jabber-muc-0.8/debian/prerm
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+    remove|upgrade)
+    if [ -f /var/run/jabberd2/muc.pid ]; then
+        invoke-rc.d jabberd2 stop muc || true
+    fi
+    ;;
+
+    deconfigure|failed-upgrade)
+    ;;
+
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- jabber-muc-0.8.orig/debian/copyright
+++ jabber-muc-0.8/debian/copyright
@@ -0,0 +1,45 @@
+This package was debianized by Jorge Salamero Sanz <bencer@debian.org> on
+Wed, 15 Apr 2009 15:35:06 +0100.
+
+Jamin W. Collins <jcollins@asgardsrealm.net> was the previous maintainer.
+
+It was downloaded from http://download.gna.org/mu-conference/
+
+Upstream Authors:
+
+    David Sutton jid: peregrine@legend.net.uk
+    Grégoire Menuel jid: mega@im.apinc.org
+
+Copyright:
+
+    Copyright © 1999-2002 Jabber.com, Inc.
+    Copyright © 1998-1999 Jeremie Miller
+    Copyright © 2003 Paul Curtis <pfc@terrapin.com>
+    Copyright © 2002-2005 David Sutton jid: peregrine@legend.net.uk
+    Copyright © 2007 Grégoire Menuel jid: mega@im.apinc.org
+
+License:
+
+   This package is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the license, or
+   (at your option) any later version.
+
+   This package is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this package; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+   MA 02110-1301, USA.
+
+   src/jabberd/sha.c is Mozilla Public License Version 1.1
+   src/jabberd/snprintf.c is Apache License Version 1.0
+
+On Debian systems, the complete text of the GNU General Public License
+can be found in the file `/usr/share/common-licenses/GPL-2'.
+
+The Debian packaging is © 2009, Jorge Salamero Sanz <bencer@debian.org>
+and is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
--- jabber-muc-0.8.orig/debian/postrm
+++ jabber-muc-0.8/debian/postrm
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+    purge)
+        # remove the user database
+        rm -f /var/spool/jabber-muc/rooms/*
+        # the application should remove these on exit
+        rm -f /var/run/jabberd2/muc.pid
+        # need better way of detecting whether these exist or not
+        rm -f /var/log/jabberd2/mu-conference.log*
+        # remove any empty directories
+        for DIR in /var/spool/jabber-muc/rooms /var/spool/jabber-muc \
+           /etc/jabberd2/component.d /etc/jabberd2 \
+           /var/run/jabberd2 /var/log/jabberd2; do
+              if [ -d ${DIR} ]; then
+                 #rmdir -p --ignore-fail-on-non-empty ${DIR} > /dev/null 2>&1
+                 rmdir --ignore-fail-on-non-empty ${DIR} > /dev/null 2>&1
+              fi
+        done
+    ;;
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- jabber-muc-0.8.orig/debian/control
+++ jabber-muc-0.8/debian/control
@@ -0,0 +1,16 @@
+Source: jabber-muc
+Section: net
+Priority: optional
+Maintainer: Debian XMPP Maintainers <pkg-xmpp-devel@lists.alioth.debian.org>
+Uploaders: Jorge Salamero Sanz <bencer@debian.org>
+Build-Depends: debhelper (>= 7.0.0), libglib2.0-dev, libexpat1-dev, libidn11-dev
+Homepage: https://gna.org/projects/mu-conference/
+Standards-Version: 3.8.3
+
+Package: jabber-muc
+Architecture: any
+Depends: ${shlibs:Depends}, adduser, ${misc:Depends}
+Recommends: jabberd14 | jabberd2
+Description: Multi User Conference component for the Jabber IM server
+ Multi User Conference component provides an implementation of XEP-0045
+ which allow the creation of multi-users chat.
--- jabber-muc-0.8.orig/debian/changelog
+++ jabber-muc-0.8/debian/changelog
@@ -0,0 +1,108 @@
+jabber-muc (0.8-3) unstable; urgency=low
+
+  * jabberd2-muc.xml:
+    - Changed default jabberd2 port to connect to.
+    - Give a proper path to the room log dir.
+  * prerm:
+    - Prevent an exit if invoke-rc.d fails.
+  * postinst:
+    - Give proper owner and permissions to the room dir and room log dir.
+
+ -- Jorge Salamero Sanz <bencer@debian.org>  Mon, 28 Dec 2009 17:45:43 +0100
+
+jabber-muc (0.8-2) unstable; urgency=low
+
+  * We get rid of dpkg-statoverride and we use chmod an chown instead.
+  * Nicer fix for the pidpath creation and chown.
+
+ -- Jorge Salamero Sanz <bencer@debian.org>  Fri, 17 Apr 2009 20:17:19 +0100
+
+jabber-muc (0.8-1) unstable; urgency=low
+
+  * New Upstream Version (Closes: #341499).
+  * New maintainer Debian XMPP Maintainers.
+  * Debian packaging has been completly rewritten supporting only jabberd2.
+
+ -- Jorge Salamero Sanz <bencer@debian.org>  Wed, 15 Apr 2009 15:35:06 +0100
+
+jabber-muc (0.6.0-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/rules
+    - fixed FTBFS if built twice in a row (Closes: #424423)
+  * debian/patches/20_bts-457730.dpatch
+    - added from BTS (Closes: #457730)
+
+ -- Sandro Tosi <matrixhasu@gmail.com>  Wed, 09 Apr 2008 18:51:13 +0200
+
+jabber-muc (0.6.0-2) unstable; urgency=low
+
+  * added needed build depends on libglib2.0-dev (Closes: #228877)
+
+ -- Jamin W. Collins <jcollins@asgardsrealm.net>  Wed, 21 Jan 2004 21:54:57 -0700
+
+jabber-muc (0.6.0-1) unstable; urgency=low
+
+  * new upstream version (Closes: #228148) 
+
+ -- Jamin W. Collins <jcollins@asgardsrealm.net>  Fri, 16 Jan 2004 15:27:01 -0700
+
+jabber-muc (0.5.2-7) unstable; urgency=low
+
+  * added support for get-orig-source debian/rules target
+  * updated standards version to 3.6.1.0
+  * daemon now runs as jabber:adm like current jabber server
+  * tightened default permissions on jabber-muc.xml
+   - now owned by jabber:adm and 0640
+
+ -- Jamin W. Collins <jcollins@asgardsrealm.net>  Fri, 17 Oct 2003 15:56:24 -0600
+
+jabber-muc (0.5.2-6) unstable; urgency=low
+
+  * updated postinst to start the service
+  * updated prerm to stop the service
+  * added /etc/default file to control whether service starts
+
+ -- Jamin W. Collins <jcollins@asgardsrealm.net>  Fri, 29 Aug 2003 10:12:11 -0600
+
+jabber-muc (0.5.2-5) unstable; urgency=low
+
+  * updated jabber.d script to start process as daemon
+  * updated jabber.d script to call stop/start for restart
+    
+ -- Jamin W. Collins <jcollins@asgardsrealm.net>  Thu,  7 Aug 2003 14:29:02 -0600
+
+jabber-muc (0.5.2-4) unstable; urgency=low
+
+  * updated postrm to check for and remove potentially emptry directories
+  * updated jabber.d script to 
+      - handle stale pid files
+      - handle stop request when not started
+      - ensure running process stops
+
+ -- Jamin W. Collins <jcollins@asgardsrealm.net>  Wed, 23 Jul 2003 12:27:26 -0600
+
+jabber-muc (0.5.2-3) unstable; urgency=low
+
+  * updated default configuration to run as external process 
+
+ -- Jamin W. Collins <jcollins@asgardsrealm.net>  Fri,  4 Jul 2003 12:23:46 -0600
+
+jabber-muc (0.5.2-2) unstable; urgency=low
+
+  * conference module packaged (Closes: #156507) 
+
+ -- Jamin W. Collins <jcollins@asgardsrealm.net>  Sat, 31 May 2003 12:47:53 -0600
+
+jabber-muc (0.5.2-1) unstable; urgency=low
+
+  * new upstream version 
+
+ -- Jamin W. Collins <jcollins@asgardsrealm.net>  Fri, 30 May 2003 16:29:48 -0600
+
+jabber-muc (0.5.1-1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Jamin W. Collins <jcollins@asgardsrealm.net>  Sat, 19 Apr 2003 13:03:33 -0600
+
--- jabber-muc-0.8.orig/debian/default
+++ jabber-muc-0.8/debian/default
@@ -0,0 +1,8 @@
+# /etc/default/jabber-muc
+
+# user and group
+USER=jabber
+GROUP=jabber
+
+# run muc
+MUC_RUN=1
--- jabber-muc-0.8.orig/debian/component.d/60muc
+++ jabber-muc-0.8/debian/component.d/60muc
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+set -e
+
+test -f /etc/default/jabber-muc && . /etc/default/jabber-muc
+
+NAME=muc
+COMMAND=/usr/sbin/mu-conference
+PIDPATH=/var/run/jabberd2
+PIDFILE=${PIDPATH}/${NAME}.pid
+CONFFILE=/etc/jabberd2/${NAME}.xml
+
+if [ ! -d ${PIDPATH} ]; then
+    mkdir -p ${PIDPATH}
+    chown ${USER}:${GROUP} ${PIDPATH}
+fi
+
+# exit now if we are not ment to run
+test "${MUC_RUN}" != 0 || exit 0
+
+# check for executable
+test -f ${COMMAND} || exit 0
+
+case "$1" in
+   start)
+	   echo -n " ${NAME}"
+      if [ ! `pidof ${COMMAND}` ]; then
+      	start-stop-daemon -b -c ${USER}:${GROUP} \
+            --start --pidfile ${PIDFILE} --quiet \
+            --exec ${COMMAND} -- -c ${CONFFILE} || echo -n "<Failed>"
+      fi
+	;;
+   stop)
+	   echo -n " ${NAME}"
+      start-stop-daemon -o -u ${USER} --stop --quiet \
+         --signal 15 --retry 3 --pidfile ${PIDFILE} \
+         --exec ${COMMAND} || echo -n "<Failed>"
+	;;
+   restart)
+      $0 stop
+      sleep 1
+      $0 start
+   ;;
+   *)
+      echo "`basename $0` called with unknown option {$1}"
+      exit 1
+   ;;
+esac
+
+exit 0
