diff options
author | Tony Vroon <chainsaw@gentoo.org> | 2006-10-12 16:26:07 +0000 |
---|---|---|
committer | Tony Vroon <chainsaw@gentoo.org> | 2006-10-12 16:26:07 +0000 |
commit | e9ee27ff281f2ceaf96bd9165b7de5ecda9c24cf (patch) | |
tree | 3e9ebaee0c837c19b1638705da2104c5ce4e75d8 | |
parent | Add statsdx local USE-flag for net-im/ejabberd. (diff) | |
download | gentoo-2-e9ee27ff281f2ceaf96bd9165b7de5ecda9c24cf.tar.gz gentoo-2-e9ee27ff281f2ceaf96bd9165b7de5ecda9c24cf.tar.bz2 gentoo-2-e9ee27ff281f2ceaf96bd9165b7de5ecda9c24cf.zip |
Revision bump, robust start/stop script thanks to Chris Carlin <ccarlin@physics.tamu.edu> and Dustin J. Mitchell <dustin@v.igoro.us> in bug #145373. Statsdx & SOCKS5 proxy support thanks to Nikolaus Polak <nik@linuxlovers.at> in bug #137724. And finally, thanks to Micha Krause <linux@krausam.de> for pointing out that the SSL eclass did not create certificates usable for S2S connections in bug #150088.
(Portage version: 2.1.2_pre2-r8)
-rw-r--r-- | net-im/ejabberd/ChangeLog | 14 | ||||
-rw-r--r-- | net-im/ejabberd/ejabberd-1.1.1-r1.ebuild | 138 | ||||
-rw-r--r-- | net-im/ejabberd/ejabberd-1.1.1.ebuild | 4 | ||||
-rw-r--r-- | net-im/ejabberd/files/digest-ejabberd-1.1.1-r1 | 6 | ||||
-rw-r--r-- | net-im/ejabberd/files/ejabberd-1.1.1-r1.initd | 62 | ||||
-rwxr-xr-x | net-im/ejabberd/files/self-cert-v2.sh | 40 | ||||
-rw-r--r-- | net-im/ejabberd/files/ssl.cnf | 36 |
7 files changed, 297 insertions, 3 deletions
diff --git a/net-im/ejabberd/ChangeLog b/net-im/ejabberd/ChangeLog index 2696664e20e3..c312d3a0431f 100644 --- a/net-im/ejabberd/ChangeLog +++ b/net-im/ejabberd/ChangeLog @@ -1,6 +1,18 @@ # ChangeLog for net-im/ejabberd # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ChangeLog,v 1.7 2006/08/01 04:26:09 tsunam Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ChangeLog,v 1.8 2006/10/12 16:26:07 chainsaw Exp $ + +*ejabberd-1.1.1-r1 (12 Oct 2006) + + 12 Oct 2006; Tony Vroon <chainsaw@gentoo.org> + +files/ejabberd-1.1.1-r1.initd, +files/self-cert-v2.sh, +files/ssl.cnf, + ejabberd-1.1.1.ebuild, +ejabberd-1.1.1-r1.ebuild: + Revision bump, robust start/stop script thanks to Chris Carlin + <ccarlin@physics.tamu.edu> and Dustin J. Mitchell <dustin@v.igoro.us> in bug + #145373. Statsdx & SOCKS5 proxy support thanks to Nikolaus Polak + <nik@linuxlovers.at> in bug #137724. And finally, thanks to Micha Krause + <linux@krausam.de> for pointing out that the SSL eclass did not create + certificates usable for S2S connections in bug #150088. 01 Aug 2006; Joshua Jackson <tsunam@gentoo.org> ejabberd-1.1.1.ebuild: Stable x86; bug #141302 diff --git a/net-im/ejabberd/ejabberd-1.1.1-r1.ebuild b/net-im/ejabberd/ejabberd-1.1.1-r1.ebuild new file mode 100644 index 000000000000..c63a9bc02eab --- /dev/null +++ b/net-im/ejabberd/ejabberd-1.1.1-r1.ebuild @@ -0,0 +1,138 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ejabberd-1.1.1-r1.ebuild,v 1.1 2006/10/12 16:26:07 chainsaw Exp $ + +inherit eutils multilib versionator + +JABBER_ETC="/etc/jabber" +JABBER_RUN="/var/run/jabber" +JABBER_SPOOL="/var/spool/jabber" +JABBER_LOG="/var/log/jabber" + +DESCRIPTION="The Erlang Jabber Daemon" +HOMEPAGE="http://ejabberd.jabber.ru/" +SRC_URI="http://process-one.net/en/projects/${PN}/download/${PV}/${P}.tar.gz mirror://gentoo/ejabberd-patchball-${PVR}.tar.bz2" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86" +IUSE="mod_irc mod_muc mod_pubsub ldap odbc socks5 statsdx ssl web" + +DEPEND=">=net-im/jabber-base-0.01 + >=dev-libs/expat-1.95 + >=dev-lang/erlang-10.2.0 + odbc? ( dev-db/unixODBC ) + ldap? ( =net-nds/openldap-2* )" + +PROVIDE="virtual/jabber-server" +S=${WORKDIR}/${P}/src + +src_unpack() { + unpack ${A} + cd ${S} + if useq socks5 ; then + epatch ${WORKDIR}/patchball/${PVR}-socks5-proxy.patch + fi + if useq statsdx; then + epatch ${WORKDIR}/patchball/${PVR}-statsdx.patch + if useq web; then + epatch ${WORKDIR}/patchball/${PVR}-statsdx-web.patch + fi + fi +} + +src_compile() { + econf ${myconf} \ + $(use_enable mod_irc) \ + $(use_enable ldap eldap) \ + $(use_enable mod_muc) \ + $(use_enable mod_pubsub) \ + $(use_enable ssl tls) \ + $(use_enable web) \ + $(use_enable odbc) \ + || die "econf failed" + + emake || die "compiling ejabberd core failed" +} + +src_install() { + make \ + DESTDIR=${D} \ + EJABBERDDIR=${D}/usr/$(get_libdir)/erlang/lib/${P} \ + ETCDIR=${D}${JABBER_ETC} \ + LOGDIR=${D}${JABBER_LOG} \ + install \ + || die "install failed" + + chown -R jabber:jabber "${D}${JABBER_ETC}" + chown -R jabber:jabber "${D}${JABBER_LOG}" + chown -R jabber:jabber "${D}/usr/$(get_libdir)/erlang/lib/${P}" + + insinto /usr/share/doc/${PF} + cd ${S}/.. + dodoc doc/release_notes_${PV}.txt + dohtml doc/*.{html,png} + + # + # Create /usr/bin/ejabberd + # + cat <<EOF > ${T}/ejabberd +#!/bin/bash + +erl -pa /usr/$(get_libdir)/erlang/lib/${P}/ebin \\ + ${pa} \\ + -sname ejabberd \\ + -s ejabberd \\ + -ejabberd config \"${JABBER_ETC}/ejabberd.cfg\" \\ + log_path \"${JABBER_LOG}/ejabberd.log\" \\ + -kernel inetrc \"${JABBER_ETC}/inetrc\" \\ + -sasl sasl_error_logger \{file,\"${JABBER_LOG}/sasl.log\"\} \\ + -mnesia dir \"${JABBER_SPOOL}\" \\ + \$@ +EOF + + # + # Create /usr/bin/ejabberdctl + # + cat <<EOF > ${T}/ejabberdctl +#!/bin/sh + +exec env HOME=${JABBER_RUN} \\ + erl -pa /usr/$(get_libdir)/erlang/lib/${P}/ebin \\ + ${pa} \\ + -noinput \\ + -sname ejabberdctl \\ + -s ejabberd_ctl \\ + -extra \$@ +EOF + + dobin ${T}/ejabberdctl + dobin ${T}/ejabberd + + newinitd ${FILESDIR}/${PF}.initd ${PN} + newconfd ${FILESDIR}/${P}.confd ${PN} + + insinto ${JABBER_ETC} + doins ${FILESDIR}/inetrc + doins ${FILESDIR}/ssl.cnf + newins ${FILESDIR}/self-cert-v2.sh self-cert.sh +} + +pkg_postinst() { + einfo "For configuration instructions, please see /usr/share/doc/${PF}/html/guide.html" + einfo "or the online version at http://www.process-one.net/en/projects/ejabberd/docs/guide_en.html" + echo + if use ssl ; then + if [ ! -e /etc/jabber/ssl.pem ]; then + ebegin "Creating SSL key" + sh ${JABBER_ETC}/self-cert.sh &> /dev/null + eend $? + fi + chown jabber:jabber ${JABBER_ETC}/ssl.pem + ewarn "Please be sure that your ${JABBER_ETC}/ejabber.cfg points to ${JABBER_ETC}/ssl.pem" + ewarn "You may want to edit ${JABBER_ETC}/ssl.cnf and run ${JABBER_ETC}/self-cert.sh again" + fi + if ! use web ; then + einfo "The web USE flag is off, this will disable the web admin interface," + einfo "if this was not the intention then add web to your USE flags." + fi +} diff --git a/net-im/ejabberd/ejabberd-1.1.1.ebuild b/net-im/ejabberd/ejabberd-1.1.1.ebuild index f6e1a4a8633a..dd9c62227dd1 100644 --- a/net-im/ejabberd/ejabberd-1.1.1.ebuild +++ b/net-im/ejabberd/ejabberd-1.1.1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ejabberd-1.1.1.ebuild,v 1.2 2006/08/01 04:26:09 tsunam Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/ejabberd-1.1.1.ebuild,v 1.3 2006/10/12 16:26:07 chainsaw Exp $ inherit eutils multilib ssl-cert versionator @@ -15,7 +15,7 @@ SRC_URI="http://process-one.net/en/projects/${PN}/download/${PV}/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="x86" -IUSE="mod_irc mod_muc mod_pubsub ldap odbc web" +IUSE="mod_irc mod_muc mod_pubsub ldap odbc ssl web" DEPEND=">=net-im/jabber-base-0.01 >=dev-libs/expat-1.95 diff --git a/net-im/ejabberd/files/digest-ejabberd-1.1.1-r1 b/net-im/ejabberd/files/digest-ejabberd-1.1.1-r1 new file mode 100644 index 000000000000..02e65411ae91 --- /dev/null +++ b/net-im/ejabberd/files/digest-ejabberd-1.1.1-r1 @@ -0,0 +1,6 @@ +MD5 ef6fae4a3f9c7f807f21e9cd3dae195b ejabberd-1.1.1.tar.gz 803278 +RMD160 b9c0b7ab3fe1f1b2dce52e1460bba04b313ea534 ejabberd-1.1.1.tar.gz 803278 +SHA256 52a97275537073066bd352f5718954f6994b272d1efa51187e17edf0c9b11082 ejabberd-1.1.1.tar.gz 803278 +MD5 d93037f28d977f677ca0692ad2f0b741 ejabberd-patchball-1.1.1-r1.tar.bz2 11826 +RMD160 8bee1764940073c807644438914bbbad4548a9a5 ejabberd-patchball-1.1.1-r1.tar.bz2 11826 +SHA256 4bf89e6858e455444bc5a29113f19462e856d1399179cb51bb8e404176eee3de ejabberd-patchball-1.1.1-r1.tar.bz2 11826 diff --git a/net-im/ejabberd/files/ejabberd-1.1.1-r1.initd b/net-im/ejabberd/files/ejabberd-1.1.1-r1.initd new file mode 100644 index 000000000000..3c4770d301be --- /dev/null +++ b/net-im/ejabberd/files/ejabberd-1.1.1-r1.initd @@ -0,0 +1,62 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/files/ejabberd-1.1.1-r1.initd,v 1.1 2006/10/12 16:26:07 chainsaw Exp $ + +opts="${opts} reload" + +depend() { + use dns + need net + provide jabber-server +} + +checkconfig() { + if [ ! -e /etc/jabber/ejabberd.cfg ] ; then + eerror "You need an /etc/jabber/ejabberd.cfg file to run ejabberd" + return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting eJabberd" + start-stop-daemon --start --quiet --chuid jabber:jabber \ + --env HOME=/var/run/jabber \ + --exec /usr/lib/erlang/erts-5.5/bin/beam \ + --startas /usr/bin/ejabberd -- -noshell -detached + eend $? +} + +stop() { + ebegin "Stopping eJabberd" + if [ -z "$EJABBERD_NODE" ]; + then + EJABBERD_NODE="ejabberd@`hostname -s`" + fi + /usr/bin/ejabberdctl $EJABBERD_NODE stop + eend $? +} + +# Work around a bug in /sbin/runscript.sh - it won't run our custom +# restart() unless it finds these two strings in the file. +# svc_start svc_stop +restart() { + ebegin "Restarting eJabberd" + if [ -z "$EJABBERD_NODE" ]; + then + EJABBERD_NODE="ejabberd@`hostname -s`" + fi + /usr/bin/ejabberdctl $EJABBERD_NODE restart + eend $? +} + +reload() { + ebegin "Reloading eJabberd" + if [ -z "$EJABBERD_NODE" ]; + then + EJABBERD_NODE="ejabberd@`hostname -s`" + fi + /usr/bin/ejabberdctl $EJABBERD_NODE reopen-log + eend $? +} diff --git a/net-im/ejabberd/files/self-cert-v2.sh b/net-im/ejabberd/files/self-cert-v2.sh new file mode 100755 index 000000000000..b9bd0aef3c6b --- /dev/null +++ b/net-im/ejabberd/files/self-cert-v2.sh @@ -0,0 +1,40 @@ +#! /bin/sh +# +# self-cert.sh for ejabberd, stolen from: +# mkimapdcert,v 1.1 2001/01/02 03:54:25 drobbins Exp +# +# Copyright 2000 Double Precision, Inc. See COPYING for +# distribution information. +# +# This is a short script to quickly generate a self-signed X.509 key for +# eJabberd. Normally this script would get called by an automatic +# package installation routine. + +test -x /usr/bin/openssl || exit 0 + +prefix="/usr" +pemfile="/etc/jabber/ssl.pem" +randfile="/etc/jabber/ssl.rand" + +if test -f $pemfile +then + echo "$pemfile already exists." + exit 1 +fi + +cp /dev/null $pemfile +chmod 600 $pemfile +chown root $pemfile + +cleanup() { + rm -f $pemfile + rm -f $randfile + exit 1 +} + +dd if=/dev/urandom of=$randfile count=1 2>/dev/null +/usr/bin/openssl req -new -x509 -days 365 -nodes \ + -config /etc/jabber/ssl.cnf -out $pemfile -keyout $pemfile || cleanup +/usr/bin/openssl gendh -rand $randfile 512 >> $pemfile || cleanup +/usr/bin/openssl x509 -subject -dates -fingerprint -noout -in $pemfile || cleanup +rm -f $randfile diff --git a/net-im/ejabberd/files/ssl.cnf b/net-im/ejabberd/files/ssl.cnf new file mode 100644 index 000000000000..7a51d913b85d --- /dev/null +++ b/net-im/ejabberd/files/ssl.cnf @@ -0,0 +1,36 @@ +# $Header: /var/cvsroot/gentoo-x86/net-im/ejabberd/files/ssl.cnf,v 1.1 2006/10/12 16:26:07 chainsaw Exp $ +# This is the openssl config file to generate keys for ejabberd +# It is read by self-cert.sh + +[ req ] +# you can increase this value, but be aware that it will make things much slower +# this should be a power of 2! +default_bits = 1024 +# leave the rest of these alone! +encrypt_key = yes +distinguished_name = req_dn +x509_extensions = cert_type +prompt = no + +[ req_dn ] +# 2-Letter ISO country code +C=UK +# FULL name of state/province/district +# NO abbreviations! +ST=Cambridgeshire +# FULL name of city +# NO abbreviations! +L=Peterborough +# Full Name of your organization +# NO abbreviations! +O=Bits and Bobs Ltd. +# Leave this alone unless specifically need to change it! +OU=Automatically-generated ejabberd SSL key +# This should be a FQDN that resolves to the IP of your server +CN=localhost +# This should be the email address for the administrator of the server +emailAddress=root@localhost + +# Leave this alone! +[ cert_type ] +nsCertType = server |