diff options
-rw-r--r-- | net-im/jabber/Makefile | 12 | ||||
-rw-r--r-- | net-im/jabber/distinfo | 2 | ||||
-rw-r--r-- | net-im/jabber/files/jabberd.sh | 27 | ||||
-rw-r--r-- | net-im/jabber/files/jserver.sh | 27 | ||||
-rw-r--r-- | net-im/jabber/files/patch-aa | 17 | ||||
-rw-r--r-- | net-im/jabber/pkg-deinstall | 71 | ||||
-rw-r--r-- | net-im/jabber/pkg-install | 146 | ||||
-rw-r--r-- | net-im/jabber/pkg-plist | 2 | ||||
-rw-r--r-- | net/jabber-transport/Makefile | 12 | ||||
-rw-r--r-- | net/jabber-transport/distinfo | 2 | ||||
-rw-r--r-- | net/jabber-transport/files/jserver.sh | 27 | ||||
-rw-r--r-- | net/jabber-transport/files/patch-aa | 17 | ||||
-rw-r--r-- | net/jabber-transport/pkg-deinstall | 71 | ||||
-rw-r--r-- | net/jabber-transport/pkg-install | 146 | ||||
-rw-r--r-- | net/jabber-transport/pkg-plist | 2 | ||||
-rw-r--r-- | net/jabber/Makefile | 12 | ||||
-rw-r--r-- | net/jabber/distinfo | 2 | ||||
-rw-r--r-- | net/jabber/files/jabberd.sh | 27 | ||||
-rw-r--r-- | net/jabber/files/jserver.sh | 27 | ||||
-rw-r--r-- | net/jabber/files/patch-aa | 17 | ||||
-rw-r--r-- | net/jabber/pkg-deinstall | 71 | ||||
-rw-r--r-- | net/jabber/pkg-install | 146 | ||||
-rw-r--r-- | net/jabber/pkg-plist | 2 |
23 files changed, 852 insertions, 33 deletions
diff --git a/net-im/jabber/Makefile b/net-im/jabber/Makefile index 59f343e24b52..27ee846f97d5 100644 --- a/net-im/jabber/Makefile +++ b/net-im/jabber/Makefile @@ -6,14 +6,20 @@ # PORTNAME= jabber-transport -PORTVERSION= 0.9 +PORTVERSION= 1.0 CATEGORIES= net -MASTER_SITES= http://download.jabber.org/dists/0.9/final/ +MASTER_SITES= http://download.jabber.org/dists/1.0/ MAINTAINER= lukin@okbmei.msk.su -LIB_DEPENDS= etherx.0:${PORTSDIR}/net/libetherx +LIB_DEPENDS= etherx.1:${PORTSDIR}/net/libetherx USE_LIBTOOL= yes +rc=${PREFIX}/etc/rc.d + +post-install: + @PREFIX=${PREFIX} ${PERL5} ${PKGDIR}/INSTALL ${PKGNAME} POST-INSTALL + @${INSTALL_SCRIPT} ${FILESDIR}/jserver.sh ${rc} + .include <bsd.port.mk> diff --git a/net-im/jabber/distinfo b/net-im/jabber/distinfo index 7a67e2528c99..f2207116824a 100644 --- a/net-im/jabber/distinfo +++ b/net-im/jabber/distinfo @@ -1 +1 @@ -MD5 (jabber-transport-0.9.tar.gz) = dd38ad2b2641ed40ebd45a03a6ce1ffc +MD5 (jabber-transport-1.0.tar.gz) = 5f901c1dee7bf433b0409d4996f744c4 diff --git a/net-im/jabber/files/jabberd.sh b/net-im/jabber/files/jabberd.sh new file mode 100644 index 000000000000..c550ee513139 --- /dev/null +++ b/net-im/jabber/files/jabberd.sh @@ -0,0 +1,27 @@ +#! /bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/jserver\.sh\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi +user=jserver +rundir=/tmp +out=${rundir}/jserver.out + +export PATH=/bin:/usr/bin:${PREFIX}/bin +umask 077 + +test -x ${PREFIX}/bin/jserver || exit 1 +echo -n " jserver" +cd ${rundir} || exit + +arg=${1:-start} +case $arg in +start) + su -f -m ${user} -c \ + "jserver" \ + >>${out} 2>&1 &;; + +stop) + killall jserver;; +esac diff --git a/net-im/jabber/files/jserver.sh b/net-im/jabber/files/jserver.sh new file mode 100644 index 000000000000..c550ee513139 --- /dev/null +++ b/net-im/jabber/files/jserver.sh @@ -0,0 +1,27 @@ +#! /bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/jserver\.sh\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi +user=jserver +rundir=/tmp +out=${rundir}/jserver.out + +export PATH=/bin:/usr/bin:${PREFIX}/bin +umask 077 + +test -x ${PREFIX}/bin/jserver || exit 1 +echo -n " jserver" +cd ${rundir} || exit + +arg=${1:-start} +case $arg in +start) + su -f -m ${user} -c \ + "jserver" \ + >>${out} 2>&1 &;; + +stop) + killall jserver;; +esac diff --git a/net-im/jabber/files/patch-aa b/net-im/jabber/files/patch-aa index 535dc726f039..20549a78e67d 100644 --- a/net-im/jabber/files/patch-aa +++ b/net-im/jabber/files/patch-aa @@ -1,17 +1,22 @@ ---- src/jserver.xml.in.orig Mon Mar 20 11:01:32 2000 -+++ src/jserver.xml.in Mon Apr 10 16:39:16 2000 -@@ -24,16 +24,16 @@ - The session log, make sure the folder exists! - +--- src/jserver.xml.in.orig Mon May 1 11:30:00 2000 ++++ src/jserver.xml.in Wed May 10 18:22:14 2000 +@@ -37,12 +37,12 @@ <log> + + <!-- replace with <error>syslog</error> to log to syslog instead, remove to log to STDERR --> +- <error>@prefix@/var/log/jserver.error</error> ++ <error>/var/log/jserver.error</error> + - <session>@prefix@/var/log/jserver.log</session> + <session>/var/log/jserver.log</session> + <!-- This will log some basic tracking information about every packet of data (TONS!) - <packet>@prefix@/var/log/jserver_packet.log</packet> + <packet>/var/log/jserver_packet.log</packet> --> - </log> + </log> +@@ -50,7 +50,7 @@ Data is stored on the filesystem for each user, make sure the folder exists! diff --git a/net-im/jabber/pkg-deinstall b/net-im/jabber/pkg-deinstall new file mode 100644 index 000000000000..355d51ea398d --- /dev/null +++ b/net-im/jabber/pkg-deinstall @@ -0,0 +1,71 @@ +#! /bin/sh + +ask() { + local question default answer + + question=$1 + default=$2 + if [ -z "${PACKAGE_BUILDING}" ]; then + read -p "${question} [${default}]? " answer + fi + if [ x${answer} = x ]; then + answer=${default} + fi + echo ${answer} +} + +yesno() { + local dflt question answer + + question=$1 + dflt=$2 + while :; do + answer=$(ask "${question}" "${dflt}") + case "${answer}" in + [Yy]*) return 0;; + [Nn]*) return 1;; + esac + echo "Please answer yes or no." + done +} + +delete_account() { + local u g home + + u=$1 + g=$2 + if yesno "Do you want me to remove group \"${g}\"" y; then + pw groupdel -n ${g} + echo "Done." + fi + if yesno "Do you want me to remove user \"${u}\"" y; then + eval home=~${u} + pw userdel -n ${u} + echo "Done." + if [ -d "${home}" ]; then + echo "Please remember to remove the home directory \"${home}\" as" + echo "well as the mirrored files." + fi + fi +} + +if [ x$2 != xDEINSTALL ]; then + exit +fi + +export PATH=/bin:/usr/bin:/usr/sbin + +user=jserver +group=jserver + +if ps -axc | grep -q jserver; then + if yesno "There are some jserver processes running. Shall I kill them" y + then + killall jserver + sleep 2 + else + echo "OK ... I hope you know what you are doing." + fi +fi + +delete_account ${user} ${group} diff --git a/net-im/jabber/pkg-install b/net-im/jabber/pkg-install new file mode 100644 index 000000000000..794315549287 --- /dev/null +++ b/net-im/jabber/pkg-install @@ -0,0 +1,146 @@ +#! /bin/sh + +chmods_done=" " + +ask() { + local question default answer + + question=$1 + default=$2 + if [ -z "${PACKAGE_BUILDING}" ]; then + read -p "${question} [${default}]? " answer + fi + if [ x${answer} = x ]; then + answer=${default} + fi + echo ${answer} +} + +yesno() { + local dflt question answer + + question=$1 + dflt=$2 + while :; do + answer=$(ask "${question}" "${dflt}") + case "${answer}" in + [Yy]*) return 0;; + [Nn]*) return 1;; + esac + echo "Please answer yes or no." + done +} + +make_account() { + local u g gcos homeopt home + + u=$1 + g=$2 + gcos=$3 + homeopt=${4:+"-d $4"} + + if pw group show "${g}" >/dev/null 2>&1; then + echo "You already have a group \"${g}\", so I will use it." + else + echo "You need a group \"${g}\"." + if which -s pw && yesno "Would you like me to create it" y; then + pw groupadd ${g} || exit + echo "Done." + else + echo "Please create it, and try again." + if ! grep -q "^${u}:" /etc/passwd; then + echo "While you're at it, please create a user \"${u}\" too," + echo "with a default group of \"${g}\"." + fi + exit 1 + fi + fi + + if pw user show "${u}" >/dev/null 2>&1; then + echo "You already have a user \"${u}\", so I will use it." + else + echo "You need a user \"${u}\"." + if which -s pw && yesno "Would you like me to create it" y; then + pw useradd ${u} -g ${g} -h - ${homeopt} \ + -s /nonexistent -c "${gcos}" || exit + echo "Done." + else + echo "Please create it, and try again." + exit 1 + fi + fi + + if [ x"$homeopt" = x ]; then + eval home=~${u} + if [ ! -d "${home}" ]; then + if yesno \ + "Would you like me to create ${u}'s home directory (${home})" y + then + (umask 77 && \ + mkdir -p ${home}) || exit + chown -R ${u}:${g} ${home} || exit + else + echo "Please create it, and try again." + exit 1 + fi + fi + fi +} + +case $2 in + +POST-INSTALL) + if which -s pw && which -s lockf; then + : + else + cat <<EOF + +This system looks like a pre-2.2 version of FreeBSD. I see that it +is missing the "lockf" and/or "pw" utilities. I need these utilities. +Please get them and install them, and try again. You can get the +sources from: + + ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.bin/lockf.tar.gz + ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.sbin/pw.tar.gz + +EOF + exit 1 + fi + + user=jserver + group=jserver + spooldir="/var/jspool" + etcdir=${PREFIX}/etc + + echo "" + make_account ${user} ${group} "Jabber Daemon" "/nonexistent" + + echo "Fixing ownerships and modes in \"${spooldir}\"." + chown -R ${user}:${group} ${spooldir} + chmod -R go= ${spooldir} + + echo "Fixing config files ownerships and modes." + chown root:${group} ${etcdir}/jserver.xml ${etcdir}/jserver.xml.default + chmod 640 ${etcdir}/jserver.xml ${etcdir}/jserver.xml.default + + if [ ! -f /var/log/jserver.log ]; then + echo "Creating \"/var/log/jserver.log\"." + cp /dev/null /var/log/jserver.log + fi + + if [ ! -f /var/log/jserver.error ]; then + echo "Creating \"/var/log/jserver.error\"." + cp /dev/null /var/log/jserver.error + fi + + if [ ! -f /var/log/jserver_packet.log ]; then + echo "Creating \"/var/log/jserver_packet.log\"." + cp /dev/null /var/log/jserver_packet.log + fi + + echo "Fixing log files ownerships and modes." + chown ${user}:${group} /var/log/jserver.log /var/log/jserver.error /var/log/jserver_packet.log + chmod 600 /var/log/jserver.log /var/log/jserver.error /var/log/jserver_packet.log + + ;; +esac diff --git a/net-im/jabber/pkg-plist b/net-im/jabber/pkg-plist index c34dbbc3c064..57544b72a86f 100644 --- a/net-im/jabber/pkg-plist +++ b/net-im/jabber/pkg-plist @@ -1,6 +1,6 @@ bin/jserver etc/jserver.xml.default -lib/jabber/mod_auth_sha1.so +etc/rc.d/jserver.sh lib/jabber/mod_echo.so lib/jabber/mod_time.so lib/jabber/mod_version.so diff --git a/net/jabber-transport/Makefile b/net/jabber-transport/Makefile index 59f343e24b52..27ee846f97d5 100644 --- a/net/jabber-transport/Makefile +++ b/net/jabber-transport/Makefile @@ -6,14 +6,20 @@ # PORTNAME= jabber-transport -PORTVERSION= 0.9 +PORTVERSION= 1.0 CATEGORIES= net -MASTER_SITES= http://download.jabber.org/dists/0.9/final/ +MASTER_SITES= http://download.jabber.org/dists/1.0/ MAINTAINER= lukin@okbmei.msk.su -LIB_DEPENDS= etherx.0:${PORTSDIR}/net/libetherx +LIB_DEPENDS= etherx.1:${PORTSDIR}/net/libetherx USE_LIBTOOL= yes +rc=${PREFIX}/etc/rc.d + +post-install: + @PREFIX=${PREFIX} ${PERL5} ${PKGDIR}/INSTALL ${PKGNAME} POST-INSTALL + @${INSTALL_SCRIPT} ${FILESDIR}/jserver.sh ${rc} + .include <bsd.port.mk> diff --git a/net/jabber-transport/distinfo b/net/jabber-transport/distinfo index 7a67e2528c99..f2207116824a 100644 --- a/net/jabber-transport/distinfo +++ b/net/jabber-transport/distinfo @@ -1 +1 @@ -MD5 (jabber-transport-0.9.tar.gz) = dd38ad2b2641ed40ebd45a03a6ce1ffc +MD5 (jabber-transport-1.0.tar.gz) = 5f901c1dee7bf433b0409d4996f744c4 diff --git a/net/jabber-transport/files/jserver.sh b/net/jabber-transport/files/jserver.sh new file mode 100644 index 000000000000..c550ee513139 --- /dev/null +++ b/net/jabber-transport/files/jserver.sh @@ -0,0 +1,27 @@ +#! /bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/jserver\.sh\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi +user=jserver +rundir=/tmp +out=${rundir}/jserver.out + +export PATH=/bin:/usr/bin:${PREFIX}/bin +umask 077 + +test -x ${PREFIX}/bin/jserver || exit 1 +echo -n " jserver" +cd ${rundir} || exit + +arg=${1:-start} +case $arg in +start) + su -f -m ${user} -c \ + "jserver" \ + >>${out} 2>&1 &;; + +stop) + killall jserver;; +esac diff --git a/net/jabber-transport/files/patch-aa b/net/jabber-transport/files/patch-aa index 535dc726f039..20549a78e67d 100644 --- a/net/jabber-transport/files/patch-aa +++ b/net/jabber-transport/files/patch-aa @@ -1,17 +1,22 @@ ---- src/jserver.xml.in.orig Mon Mar 20 11:01:32 2000 -+++ src/jserver.xml.in Mon Apr 10 16:39:16 2000 -@@ -24,16 +24,16 @@ - The session log, make sure the folder exists! - +--- src/jserver.xml.in.orig Mon May 1 11:30:00 2000 ++++ src/jserver.xml.in Wed May 10 18:22:14 2000 +@@ -37,12 +37,12 @@ <log> + + <!-- replace with <error>syslog</error> to log to syslog instead, remove to log to STDERR --> +- <error>@prefix@/var/log/jserver.error</error> ++ <error>/var/log/jserver.error</error> + - <session>@prefix@/var/log/jserver.log</session> + <session>/var/log/jserver.log</session> + <!-- This will log some basic tracking information about every packet of data (TONS!) - <packet>@prefix@/var/log/jserver_packet.log</packet> + <packet>/var/log/jserver_packet.log</packet> --> - </log> + </log> +@@ -50,7 +50,7 @@ Data is stored on the filesystem for each user, make sure the folder exists! diff --git a/net/jabber-transport/pkg-deinstall b/net/jabber-transport/pkg-deinstall new file mode 100644 index 000000000000..355d51ea398d --- /dev/null +++ b/net/jabber-transport/pkg-deinstall @@ -0,0 +1,71 @@ +#! /bin/sh + +ask() { + local question default answer + + question=$1 + default=$2 + if [ -z "${PACKAGE_BUILDING}" ]; then + read -p "${question} [${default}]? " answer + fi + if [ x${answer} = x ]; then + answer=${default} + fi + echo ${answer} +} + +yesno() { + local dflt question answer + + question=$1 + dflt=$2 + while :; do + answer=$(ask "${question}" "${dflt}") + case "${answer}" in + [Yy]*) return 0;; + [Nn]*) return 1;; + esac + echo "Please answer yes or no." + done +} + +delete_account() { + local u g home + + u=$1 + g=$2 + if yesno "Do you want me to remove group \"${g}\"" y; then + pw groupdel -n ${g} + echo "Done." + fi + if yesno "Do you want me to remove user \"${u}\"" y; then + eval home=~${u} + pw userdel -n ${u} + echo "Done." + if [ -d "${home}" ]; then + echo "Please remember to remove the home directory \"${home}\" as" + echo "well as the mirrored files." + fi + fi +} + +if [ x$2 != xDEINSTALL ]; then + exit +fi + +export PATH=/bin:/usr/bin:/usr/sbin + +user=jserver +group=jserver + +if ps -axc | grep -q jserver; then + if yesno "There are some jserver processes running. Shall I kill them" y + then + killall jserver + sleep 2 + else + echo "OK ... I hope you know what you are doing." + fi +fi + +delete_account ${user} ${group} diff --git a/net/jabber-transport/pkg-install b/net/jabber-transport/pkg-install new file mode 100644 index 000000000000..794315549287 --- /dev/null +++ b/net/jabber-transport/pkg-install @@ -0,0 +1,146 @@ +#! /bin/sh + +chmods_done=" " + +ask() { + local question default answer + + question=$1 + default=$2 + if [ -z "${PACKAGE_BUILDING}" ]; then + read -p "${question} [${default}]? " answer + fi + if [ x${answer} = x ]; then + answer=${default} + fi + echo ${answer} +} + +yesno() { + local dflt question answer + + question=$1 + dflt=$2 + while :; do + answer=$(ask "${question}" "${dflt}") + case "${answer}" in + [Yy]*) return 0;; + [Nn]*) return 1;; + esac + echo "Please answer yes or no." + done +} + +make_account() { + local u g gcos homeopt home + + u=$1 + g=$2 + gcos=$3 + homeopt=${4:+"-d $4"} + + if pw group show "${g}" >/dev/null 2>&1; then + echo "You already have a group \"${g}\", so I will use it." + else + echo "You need a group \"${g}\"." + if which -s pw && yesno "Would you like me to create it" y; then + pw groupadd ${g} || exit + echo "Done." + else + echo "Please create it, and try again." + if ! grep -q "^${u}:" /etc/passwd; then + echo "While you're at it, please create a user \"${u}\" too," + echo "with a default group of \"${g}\"." + fi + exit 1 + fi + fi + + if pw user show "${u}" >/dev/null 2>&1; then + echo "You already have a user \"${u}\", so I will use it." + else + echo "You need a user \"${u}\"." + if which -s pw && yesno "Would you like me to create it" y; then + pw useradd ${u} -g ${g} -h - ${homeopt} \ + -s /nonexistent -c "${gcos}" || exit + echo "Done." + else + echo "Please create it, and try again." + exit 1 + fi + fi + + if [ x"$homeopt" = x ]; then + eval home=~${u} + if [ ! -d "${home}" ]; then + if yesno \ + "Would you like me to create ${u}'s home directory (${home})" y + then + (umask 77 && \ + mkdir -p ${home}) || exit + chown -R ${u}:${g} ${home} || exit + else + echo "Please create it, and try again." + exit 1 + fi + fi + fi +} + +case $2 in + +POST-INSTALL) + if which -s pw && which -s lockf; then + : + else + cat <<EOF + +This system looks like a pre-2.2 version of FreeBSD. I see that it +is missing the "lockf" and/or "pw" utilities. I need these utilities. +Please get them and install them, and try again. You can get the +sources from: + + ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.bin/lockf.tar.gz + ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.sbin/pw.tar.gz + +EOF + exit 1 + fi + + user=jserver + group=jserver + spooldir="/var/jspool" + etcdir=${PREFIX}/etc + + echo "" + make_account ${user} ${group} "Jabber Daemon" "/nonexistent" + + echo "Fixing ownerships and modes in \"${spooldir}\"." + chown -R ${user}:${group} ${spooldir} + chmod -R go= ${spooldir} + + echo "Fixing config files ownerships and modes." + chown root:${group} ${etcdir}/jserver.xml ${etcdir}/jserver.xml.default + chmod 640 ${etcdir}/jserver.xml ${etcdir}/jserver.xml.default + + if [ ! -f /var/log/jserver.log ]; then + echo "Creating \"/var/log/jserver.log\"." + cp /dev/null /var/log/jserver.log + fi + + if [ ! -f /var/log/jserver.error ]; then + echo "Creating \"/var/log/jserver.error\"." + cp /dev/null /var/log/jserver.error + fi + + if [ ! -f /var/log/jserver_packet.log ]; then + echo "Creating \"/var/log/jserver_packet.log\"." + cp /dev/null /var/log/jserver_packet.log + fi + + echo "Fixing log files ownerships and modes." + chown ${user}:${group} /var/log/jserver.log /var/log/jserver.error /var/log/jserver_packet.log + chmod 600 /var/log/jserver.log /var/log/jserver.error /var/log/jserver_packet.log + + ;; +esac diff --git a/net/jabber-transport/pkg-plist b/net/jabber-transport/pkg-plist index c34dbbc3c064..57544b72a86f 100644 --- a/net/jabber-transport/pkg-plist +++ b/net/jabber-transport/pkg-plist @@ -1,6 +1,6 @@ bin/jserver etc/jserver.xml.default -lib/jabber/mod_auth_sha1.so +etc/rc.d/jserver.sh lib/jabber/mod_echo.so lib/jabber/mod_time.so lib/jabber/mod_version.so diff --git a/net/jabber/Makefile b/net/jabber/Makefile index 59f343e24b52..27ee846f97d5 100644 --- a/net/jabber/Makefile +++ b/net/jabber/Makefile @@ -6,14 +6,20 @@ # PORTNAME= jabber-transport -PORTVERSION= 0.9 +PORTVERSION= 1.0 CATEGORIES= net -MASTER_SITES= http://download.jabber.org/dists/0.9/final/ +MASTER_SITES= http://download.jabber.org/dists/1.0/ MAINTAINER= lukin@okbmei.msk.su -LIB_DEPENDS= etherx.0:${PORTSDIR}/net/libetherx +LIB_DEPENDS= etherx.1:${PORTSDIR}/net/libetherx USE_LIBTOOL= yes +rc=${PREFIX}/etc/rc.d + +post-install: + @PREFIX=${PREFIX} ${PERL5} ${PKGDIR}/INSTALL ${PKGNAME} POST-INSTALL + @${INSTALL_SCRIPT} ${FILESDIR}/jserver.sh ${rc} + .include <bsd.port.mk> diff --git a/net/jabber/distinfo b/net/jabber/distinfo index 7a67e2528c99..f2207116824a 100644 --- a/net/jabber/distinfo +++ b/net/jabber/distinfo @@ -1 +1 @@ -MD5 (jabber-transport-0.9.tar.gz) = dd38ad2b2641ed40ebd45a03a6ce1ffc +MD5 (jabber-transport-1.0.tar.gz) = 5f901c1dee7bf433b0409d4996f744c4 diff --git a/net/jabber/files/jabberd.sh b/net/jabber/files/jabberd.sh new file mode 100644 index 000000000000..c550ee513139 --- /dev/null +++ b/net/jabber/files/jabberd.sh @@ -0,0 +1,27 @@ +#! /bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/jserver\.sh\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi +user=jserver +rundir=/tmp +out=${rundir}/jserver.out + +export PATH=/bin:/usr/bin:${PREFIX}/bin +umask 077 + +test -x ${PREFIX}/bin/jserver || exit 1 +echo -n " jserver" +cd ${rundir} || exit + +arg=${1:-start} +case $arg in +start) + su -f -m ${user} -c \ + "jserver" \ + >>${out} 2>&1 &;; + +stop) + killall jserver;; +esac diff --git a/net/jabber/files/jserver.sh b/net/jabber/files/jserver.sh new file mode 100644 index 000000000000..c550ee513139 --- /dev/null +++ b/net/jabber/files/jserver.sh @@ -0,0 +1,27 @@ +#! /bin/sh + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/jserver\.sh\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi +user=jserver +rundir=/tmp +out=${rundir}/jserver.out + +export PATH=/bin:/usr/bin:${PREFIX}/bin +umask 077 + +test -x ${PREFIX}/bin/jserver || exit 1 +echo -n " jserver" +cd ${rundir} || exit + +arg=${1:-start} +case $arg in +start) + su -f -m ${user} -c \ + "jserver" \ + >>${out} 2>&1 &;; + +stop) + killall jserver;; +esac diff --git a/net/jabber/files/patch-aa b/net/jabber/files/patch-aa index 535dc726f039..20549a78e67d 100644 --- a/net/jabber/files/patch-aa +++ b/net/jabber/files/patch-aa @@ -1,17 +1,22 @@ ---- src/jserver.xml.in.orig Mon Mar 20 11:01:32 2000 -+++ src/jserver.xml.in Mon Apr 10 16:39:16 2000 -@@ -24,16 +24,16 @@ - The session log, make sure the folder exists! - +--- src/jserver.xml.in.orig Mon May 1 11:30:00 2000 ++++ src/jserver.xml.in Wed May 10 18:22:14 2000 +@@ -37,12 +37,12 @@ <log> + + <!-- replace with <error>syslog</error> to log to syslog instead, remove to log to STDERR --> +- <error>@prefix@/var/log/jserver.error</error> ++ <error>/var/log/jserver.error</error> + - <session>@prefix@/var/log/jserver.log</session> + <session>/var/log/jserver.log</session> + <!-- This will log some basic tracking information about every packet of data (TONS!) - <packet>@prefix@/var/log/jserver_packet.log</packet> + <packet>/var/log/jserver_packet.log</packet> --> - </log> + </log> +@@ -50,7 +50,7 @@ Data is stored on the filesystem for each user, make sure the folder exists! diff --git a/net/jabber/pkg-deinstall b/net/jabber/pkg-deinstall new file mode 100644 index 000000000000..355d51ea398d --- /dev/null +++ b/net/jabber/pkg-deinstall @@ -0,0 +1,71 @@ +#! /bin/sh + +ask() { + local question default answer + + question=$1 + default=$2 + if [ -z "${PACKAGE_BUILDING}" ]; then + read -p "${question} [${default}]? " answer + fi + if [ x${answer} = x ]; then + answer=${default} + fi + echo ${answer} +} + +yesno() { + local dflt question answer + + question=$1 + dflt=$2 + while :; do + answer=$(ask "${question}" "${dflt}") + case "${answer}" in + [Yy]*) return 0;; + [Nn]*) return 1;; + esac + echo "Please answer yes or no." + done +} + +delete_account() { + local u g home + + u=$1 + g=$2 + if yesno "Do you want me to remove group \"${g}\"" y; then + pw groupdel -n ${g} + echo "Done." + fi + if yesno "Do you want me to remove user \"${u}\"" y; then + eval home=~${u} + pw userdel -n ${u} + echo "Done." + if [ -d "${home}" ]; then + echo "Please remember to remove the home directory \"${home}\" as" + echo "well as the mirrored files." + fi + fi +} + +if [ x$2 != xDEINSTALL ]; then + exit +fi + +export PATH=/bin:/usr/bin:/usr/sbin + +user=jserver +group=jserver + +if ps -axc | grep -q jserver; then + if yesno "There are some jserver processes running. Shall I kill them" y + then + killall jserver + sleep 2 + else + echo "OK ... I hope you know what you are doing." + fi +fi + +delete_account ${user} ${group} diff --git a/net/jabber/pkg-install b/net/jabber/pkg-install new file mode 100644 index 000000000000..794315549287 --- /dev/null +++ b/net/jabber/pkg-install @@ -0,0 +1,146 @@ +#! /bin/sh + +chmods_done=" " + +ask() { + local question default answer + + question=$1 + default=$2 + if [ -z "${PACKAGE_BUILDING}" ]; then + read -p "${question} [${default}]? " answer + fi + if [ x${answer} = x ]; then + answer=${default} + fi + echo ${answer} +} + +yesno() { + local dflt question answer + + question=$1 + dflt=$2 + while :; do + answer=$(ask "${question}" "${dflt}") + case "${answer}" in + [Yy]*) return 0;; + [Nn]*) return 1;; + esac + echo "Please answer yes or no." + done +} + +make_account() { + local u g gcos homeopt home + + u=$1 + g=$2 + gcos=$3 + homeopt=${4:+"-d $4"} + + if pw group show "${g}" >/dev/null 2>&1; then + echo "You already have a group \"${g}\", so I will use it." + else + echo "You need a group \"${g}\"." + if which -s pw && yesno "Would you like me to create it" y; then + pw groupadd ${g} || exit + echo "Done." + else + echo "Please create it, and try again." + if ! grep -q "^${u}:" /etc/passwd; then + echo "While you're at it, please create a user \"${u}\" too," + echo "with a default group of \"${g}\"." + fi + exit 1 + fi + fi + + if pw user show "${u}" >/dev/null 2>&1; then + echo "You already have a user \"${u}\", so I will use it." + else + echo "You need a user \"${u}\"." + if which -s pw && yesno "Would you like me to create it" y; then + pw useradd ${u} -g ${g} -h - ${homeopt} \ + -s /nonexistent -c "${gcos}" || exit + echo "Done." + else + echo "Please create it, and try again." + exit 1 + fi + fi + + if [ x"$homeopt" = x ]; then + eval home=~${u} + if [ ! -d "${home}" ]; then + if yesno \ + "Would you like me to create ${u}'s home directory (${home})" y + then + (umask 77 && \ + mkdir -p ${home}) || exit + chown -R ${u}:${g} ${home} || exit + else + echo "Please create it, and try again." + exit 1 + fi + fi + fi +} + +case $2 in + +POST-INSTALL) + if which -s pw && which -s lockf; then + : + else + cat <<EOF + +This system looks like a pre-2.2 version of FreeBSD. I see that it +is missing the "lockf" and/or "pw" utilities. I need these utilities. +Please get them and install them, and try again. You can get the +sources from: + + ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.bin/lockf.tar.gz + ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.sbin/pw.tar.gz + +EOF + exit 1 + fi + + user=jserver + group=jserver + spooldir="/var/jspool" + etcdir=${PREFIX}/etc + + echo "" + make_account ${user} ${group} "Jabber Daemon" "/nonexistent" + + echo "Fixing ownerships and modes in \"${spooldir}\"." + chown -R ${user}:${group} ${spooldir} + chmod -R go= ${spooldir} + + echo "Fixing config files ownerships and modes." + chown root:${group} ${etcdir}/jserver.xml ${etcdir}/jserver.xml.default + chmod 640 ${etcdir}/jserver.xml ${etcdir}/jserver.xml.default + + if [ ! -f /var/log/jserver.log ]; then + echo "Creating \"/var/log/jserver.log\"." + cp /dev/null /var/log/jserver.log + fi + + if [ ! -f /var/log/jserver.error ]; then + echo "Creating \"/var/log/jserver.error\"." + cp /dev/null /var/log/jserver.error + fi + + if [ ! -f /var/log/jserver_packet.log ]; then + echo "Creating \"/var/log/jserver_packet.log\"." + cp /dev/null /var/log/jserver_packet.log + fi + + echo "Fixing log files ownerships and modes." + chown ${user}:${group} /var/log/jserver.log /var/log/jserver.error /var/log/jserver_packet.log + chmod 600 /var/log/jserver.log /var/log/jserver.error /var/log/jserver_packet.log + + ;; +esac diff --git a/net/jabber/pkg-plist b/net/jabber/pkg-plist index c34dbbc3c064..57544b72a86f 100644 --- a/net/jabber/pkg-plist +++ b/net/jabber/pkg-plist @@ -1,6 +1,6 @@ bin/jserver etc/jserver.xml.default -lib/jabber/mod_auth_sha1.so +etc/rc.d/jserver.sh lib/jabber/mod_echo.so lib/jabber/mod_time.so lib/jabber/mod_version.so |