Index: build/debian/control =================================================================== --- build/debian/control (Revision 7980) +++ build/debian/control (Arbeitskopie) @@ -2,7 +2,7 @@ Section: net Priority: optional Maintainer: Jive Software -Build-Depends: debhelper (>= 5), sun-java5-jdk, ant +Build-Depends: debhelper (>= 5), cdbs, sun-java5-jdk, ant Standards-Version: 3.7.2 Package: openfire Index: build/debian/changelog =================================================================== --- build/debian/changelog (Revision 7980) +++ build/debian/changelog (Arbeitskopie) @@ -1,4 +1,4 @@ -wildfire (@version@) unstable; urgency=medium +openfire (@version@) unstable; urgency=medium * For full changelog, see http://www.igniterealtime.org/builds/wildfire/docs/latest/changelog.html Index: build/debian/openfire.dirs =================================================================== --- build/debian/openfire.dirs (Revision 7980) +++ build/debian/openfire.dirs (Arbeitskopie) @@ -1,3 +1,4 @@ /etc/ -/opt/ +/usr/share/ /var/log/openfire +/var/lib/openfire Index: build/debian/openfire.postinst =================================================================== --- build/debian/openfire.postinst (Revision 0) +++ build/debian/openfire.postinst (Revision 0) @@ -0,0 +1,54 @@ +#! /bin/sh +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +case "$1" in + configure) + if ! getent passwd openfire >/dev/null; then + adduser --disabled-password --quiet --system \ + --home /var/lib/openfire \ + --gecos "Openfire XMPP server" --group openfire + fi + + mkdir -p /var/log/openfire + mkdir -p /var/lib/openfire/embedded-db + chown -R openfire:openfire /var/lib/openfire + chown -R openfire:openfire /var/log/openfire + chown -R openfire:openfire /etc/openfire + chmod -R o-rwx /etc/openfire + + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + *) + echo "postinst 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 Index: build/debian/openfire.postrm =================================================================== --- build/debian/openfire.postrm (Revision 7980) +++ build/debian/openfire.postrm (Arbeitskopie) @@ -20,7 +20,9 @@ case "$1" in purge) - rm -Rf /opt/openfire + rm -Rf /etc/openfire + rm -Rf /var/lib/openfire + rm -Rf /var/log/openfire ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) Index: build/debian/rules =================================================================== --- build/debian/rules (Revision 7980) +++ build/debian/rules (Arbeitskopie) @@ -1,67 +1,38 @@ #!/usr/bin/make -f -# -*- makefile -*- -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. -# Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -DESTINATION=${CURDIR}/debian/openfire/ +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/ant.mk -build: build-stamp -build-stamp: - dh_testdir - dh_installdirs - - ant -f build/build.xml - touch $@ +DEST := $(CURDIR)/debian/openfire +OPENFIRE := $(DEST)/usr/share/openfire +ETCDIR := /etc/openfire +LOGDIR := /var/log/openfire +VARDIR := /var/lib/openfire -clean: - dh_testdir - dh_testroot +JAVA_HOME := /usr/lib/jvm/java-1.5.0-sun +DEB_ANT_BUILDFILE := build/build.xml +DEB_ANT_CLEAN_TARGET := clean - rm -f build-stamp configure-stamp install-stamp +install/openfire:: + mv $(CURDIR)/target/openfire $(OPENFIRE) + rm -rf $(OPENFIRE)/resources/nativeAuth/osx-ppc + rm -rf $(OPENFIRE)/resources/nativeAuth/solaris-sparc + rm -rf $(OPENFIRE)/resources/nativeAuth/win32-x86 - -ant -f build/build.xml clean - - dh_clean - -install: install-stamp -install-stamp: - mv $(CURDIR)/target/openfire $(DESTINATION)/opt/ - # Move the conf-dir to etc an create a symlink back. - mv ${DESTINATION}/opt/openfire/conf ${DESTINATION}/etc/openfire - ln -s /etc/openfire ${DESTINATION}/opt/openfire/conf + mv $(OPENFIRE)/conf $(DEST)/$(ETCDIR) + ln -s $(ETCDIR) $(OPENFIRE)/conf # Move the resource dir to etc and symlink back. - mv ${DESTINATION}/opt/openfire/resources/security ${DESTINATION}/etc/openfire/security - ln -s /etc/openfire/security ${DESTINATION}/opt/openfire/resources/security + mv $(OPENFIRE)/resources/security $(DEST)/$(ETCDIR)/security + ln -s $(ETCDIR)/security $(OPENFIRE)/resources/security - # Move the logs dir to /var/log an symlink back. - mv ${DESTINATION}/opt/openfire/logs ${DESTINATION}/var/log/openfire - ln -s /var/log/openfire ${DESTINATION}/opt/openfire/logs + # Remove standard log dir and symlink to /var/log/openfire + rm -rf $(OPENFIRE)/logs + ln -s $(LOGDIR) $(OPENFIRE)/logs - touch $@ - - -# Build architecture-dependent files here. -binary-indep: install - dh_testdir - dh_testroot - dh_installdocs - dh_installexamples - dh_installdebconf - dh_installinit - dh_link - dh_compress - dh_fixperms - dh_installdeb - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep -.PHONY: build clean binary-indep binary install configure + # Create the embedded database directory and a symlink. + mkdir -p $(DEST)/$(VARDIR)/embedded-db + ln -s $(VARDIR)/embedded-db $(OPENFIRE)/embedded-db Index: build/debian/openfire.init.d =================================================================== --- build/debian/openfire.init.d (Revision 7980) +++ build/debian/openfire.init.d (Arbeitskopie) @@ -7,11 +7,12 @@ # Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl # -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/bin/java +JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun +PATH=/sbin:/bin:/usr/sbin:/usr/bin:$JAVA_HOME/bin +DAEMON=$JAVA_HOME/bin/java NAME=openfire DESC=openfire -DAEMON_DIR=/opt/openfire +DAEMON_DIR=/usr/share/openfire DAEMON_LIB=${DAEMON_DIR}/lib test -x $DAEMON || exit 0 @@ -32,6 +33,7 @@ echo -n "Starting $DESC: " start-stop-daemon --start --quiet --oknodo --background \ --pidfile /var/run/$NAME.pid --make-pidfile \ + --chuid openfire:openfire \ --exec $DAEMON -- $DAEMON_OPTS echo "$NAME." ;; Index: build/debian/openfire.conffiles =================================================================== --- build/debian/openfire.conffiles (Revision 7980) +++ build/debian/openfire.conffiles (Arbeitskopie) @@ -1,3 +1,3 @@ -/etc/openfire/wildfire.xml +/etc/openfire/openfire.xml /etc/openfire/security/keystore /etc/openfire/security/truststore Index: src/java/org/jivesoftware/util/JiveGlobals.java =================================================================== --- src/java/org/jivesoftware/util/JiveGlobals.java (Revision 7980) +++ src/java/org/jivesoftware/util/JiveGlobals.java (Arbeitskopie) @@ -243,10 +243,10 @@ if (!mh.exists()) { Log.error("Error - the specified home directory does not exist (" + pathname + ")"); } - else if (!mh.canRead() || !mh.canWrite()) { + else if (!mh.canRead()) { Log.error("Error - the user running this application can not read " + - "and write to the specified home directory (" + pathname + "). " + - "Please grant the executing user read and write permissions."); + "to the specified home directory (" + pathname + "). " + + "Please grant the executing user read permissions."); } else { home = pathname;