summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2010-05-25 19:38:46 +0000
committerPeter Volkov <pva@gentoo.org>2010-05-25 19:38:46 +0000
commit2baa004c307c99ef9013c6227c4f6bd4c9a39208 (patch)
treea30953f63c0e0b83d71bc326ce70c77b6703daa4
parentdev-php5/ezc-*: tested and move to the main tree. Drop from overlay. (diff)
downloadpva-2baa004c307c99ef9013c6227c4f6bd4c9a39208.tar.gz
pva-2baa004c307c99ef9013c6227c4f6bd4c9a39208.tar.bz2
pva-2baa004c307c99ef9013c6227c4f6bd4c9a39208.zip
net-im/ejabberd: updated upgrading path to mv ssl cert and cookie. Other cleanups.
svn path=/; revision=424
-rw-r--r--net-im/ejabberd/Manifest2
-rw-r--r--net-im/ejabberd/ejabberd-2.1.3.ebuild81
2 files changed, 50 insertions, 33 deletions
diff --git a/net-im/ejabberd/Manifest b/net-im/ejabberd/Manifest
index 2f86887..ec388bc 100644
--- a/net-im/ejabberd/Manifest
+++ b/net-im/ejabberd/Manifest
@@ -2,6 +2,6 @@ AUX 2.1.1-mod_statsdx.patch 66647 RMD160 b4563c29a827d1452ca70b68bb8cb1989e6104d
AUX ejabberd-3.confd 161 RMD160 3b2c2b2a871c42c75e854a3c592c0d399a5dd387 SHA1 01e72bda178e7bf26a66321c4330bbcc1607e540 SHA256 0296d3d281a321cd7380772c1d89a94e4a86f85b7f43bf9dc1af74935c2e6386
AUX ejabberd-3.initd 624 RMD160 a315e82cea8fa741d885b6e4134990747b328f67 SHA1 ac105a4ca8616cd7e3edb6ebaaa1806b7f2bfc3e SHA256 1253510256c3627115ce909ed88cf46cf2148996fc44c65777067c83d483422d
DIST ejabberd-2.1.3.tar.gz 2243874 RMD160 c57672928e30f71ec66636dd5e76adb802f17b03 SHA1 77fdf18c0bb3b25cf9045e0c833ba4d82f180469 SHA256 602c6e4e742c4cab8594e9f049f08d0bf2125fa84af491e0ceb6d6f2f3854ef6
-EBUILD ejabberd-2.1.3.ebuild 6940 RMD160 3d6c8bcb6d7a119f9f4db44286e32230191bb108 SHA1 5e47cc0f617fa4a71c7f53e8d9a16e426fbdfa9c SHA256 921bfa40f58c44cea0537595087ac86dab3e7ab98aa8663a891c33e410cd7708
+EBUILD ejabberd-2.1.3.ebuild 7647 RMD160 4653f6f753518bb73ed94e10354722de6b9aa77c SHA1 3816b1211df8a57b63030c43b4e3bf7db221f972 SHA256 2dfa281c6cfcaeae3e5e1f7c6220a16ccd420df2f6a96437f712e5504a487130
MISC ChangeLog 8965 RMD160 325a316bff3eb3d4c61170084e81dcebef9ad71c SHA1 f9b2b52117fc679eaf49884eae4cd059e40bf8f8 SHA256 016e4ed223c68bd48b80c59d0780c7b7e68753046da8dd83c59fb6eeec83683a
MISC metadata.xml 876 RMD160 48f50045291f78f0dbd699136b8546b5dfa55d85 SHA1 48dbaf3f6c2eaf5db190c04c881502b4da18a779 SHA256 25fd9d709d98bcfaba02200e29e07b1cc34d6241be0ffa2a7ea1abb52c05d282
diff --git a/net-im/ejabberd/ejabberd-2.1.3.ebuild b/net-im/ejabberd/ejabberd-2.1.3.ebuild
index b81e9bf..462f079 100644
--- a/net-im/ejabberd/ejabberd-2.1.3.ebuild
+++ b/net-im/ejabberd/ejabberd-2.1.3.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: $
-EAPI=2
+EAPI=3
inherit eutils multilib pam ssl-cert
@@ -87,8 +87,8 @@ src_prepare() {
src_configure() {
econf \
- --docdir=/usr/share/doc/"${PF}"/html \
- --libdir=/usr/$(get_libdir)/erlang/lib/ \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
+ --libdir="${EPREFIX}/usr/$(get_libdir)/erlang/lib/" \
$(use_enable mod_irc) \
$(use_enable ldap eldap) \
$(use_enable mod_muc) \
@@ -107,7 +107,7 @@ src_compile() {
}
src_install() {
- emake DESTDIR="${D}" install || die "install failed"
+ emake DESTDIR="${ED}" install || die "install failed"
# Pam helper module permissions
# http://www.process-one.net/docs/ejabberd/guide_en.html
@@ -131,23 +131,10 @@ pkg_postinst() {
if ! use web ; then
elog
- elog "The web USE flag is off, this has disabled the web admin interface."
+ ewarn "The web USE flag is off, this has disabled the web admin interface."
elog
fi
- if use ssl && [[ ! -e ${ROOT}/etc/ssl/ejabberd/server.pem ]]; then
- SSL_ORGANIZATION="${SSL_ORGANIZATION:-Ejabberd XMPP Server}"
- install_cert /etc/ssl/ejabberd/server
- if [[ -e ${ROOT}/etc/jabber/ssl.pem ]]; then
- ewarn
- ewarn "The location of SSL certificates has changed. If you are"
- ewarn "upgrading from ${CATEGORY}/${PN}-2.0.5* or earlier you might"
- ewarn "want to move your old certificates from /etc/jabber, update"
- ewarn "config files and rm /etc/jabber/ssl.pem to avoid this message."
- ewarn
- fi
- fi
-
elog
elog '===================================================================='
elog 'Quick Start Guide:'
@@ -161,32 +148,62 @@ pkg_postinst() {
elog ' # /usr/sbin/ejabberdctl register theadmin thehost thepassword'
elog '5) Log in with your favourite jabber client or using the web admin'
- # To keep ejabberd bootable we need to move EJABBERD_NODE from
+ # Upgrading from ejabberd-2.0.x:
+ # 1. To keep ejabberd bootable we need to move EJABBERD_NODE from
# /etc/conf.d/ejebberd into ERLANG_NODE inside /etc/jabberd/ejabberdctl.cfg
- # /etc/conf.d/ejabberd is handled by PM but everything else is our job.
- if grep -E '^[^#]*EJABBERD_NODE=' "${ROOT}/etc/conf.d/ejabberd" >/dev/null 2>&1; then
- source "${ROOT}/etc/conf.d/ejabberd"
- echo
+ # /etc/conf.d/ejabberd is handled by PM but everything else is our job
+ # 2. Copy cookie
+ # 3. Copy ssl certificate
+ if grep -E '^[^#]*EJABBERD_NODE=' "${EROOT}/etc/conf.d/ejabberd" >/dev/null 2>&1; then
+ source "${EROOT}/etc/conf.d/ejabberd"
+ ewarn
ewarn "!!! WARNING !!! WARNING !!! WARNING !!! WARNING !!!"
- ewarn "Now ejabberd requires correct value of ERLANG_NODE"
- ewarn "in ${ROOT}/etc/jabber/ejabberdctl.cfg. *with the value* of"
- ewarn "EJABBERD_NODE from ${ROOT}/etc/conf.d/ejabberd (${EJABBERD_NODE})."
- ewarn "We will handle this automagically but it's your job to run"
- ewarn "'etc-update' and check everything."
+ ewarn "Starting with 2.1.x some pathes and configuration files were"
+ ewarn "changed to better reflect upstream intentions. Notable changes are:"
+ ewarn
+ ewarn "1. Everything (even init scripts) are now handled by ejabberdctl script."
+ ewarn "Thus main configuration file became /etc/jabberd/ejabberdctl.cfg"
+ ewarn "You must update ERLANG_NODE there with the value of EJABBERD_NODE"
+ ewarn "from /etc/conf.d/ejebberd or ejabberd will refuse to start."
+ ewarn
+ ewarn "2. SSL certificate is now generated with ssl-cert eclass and resides"
+ ewarn "at standard location: /etc/ssl/ejabberd/server.pem."
+ ewarn
+ ewarn "3. Cookie now resides at /var/spool/jabber/.erlang.cookie"
+ ewarn
+ ewarn "We'll try to handle upgrade automagically but, please, do your"
+ ewarn "own checks and do not forget to run 'etc-update'!"
local i ctlcfg new_ctlcfg
i=0
- ctlcfg=${ROOT}/etc/jabber/ejabberdctl.cfg
+ ctlcfg=${EROOT}/etc/jabber/ejabberdctl.cfg
while :; do
- new_ctlcfg=$(printf "${ROOT}/etc/jabber/._cfg%04d_ejabberdctl.cfg.conf" ${i})
+ new_ctlcfg=$(printf "${EROOT}/etc/jabber/._cfg%04d_ejabberdctl.cfg" ${i})
[[ ! -e ${new_ctlcfg} ]] && break
ctlcfg=${new_ctlcfg}
((i++))
done
- einfo "ctlcfg=${ctlcfg}, new_ctlcfg=${new_ctlcfg}"
- einfo "Updating ${ctlcfg}"
+ ewarn
+ ewarn "Updating ${ctlcfg} (debug: ${new_ctlcfg})"
sed -e "/#ERLANG_NODE=/aERLANG_NODE=$EJABBERD_NODE" "${ctlcfg}" > "${new_ctlcfg}" || die
+
+ if [[ -e ${EROOT}/var/run/jabber/.erlang.cookie ]]; then
+ einfo "Moving .erlang.cookie..."
+ if [[ -e ${EROOT}/var/spool/jabber/.erlang.cookie ]]; then
+ mv -v "${EROOT}"/var/spool/jabber/.erlang.cookie{,bak}
+ fi
+ mv -v "${EROOT}"/var/{run/jabber,spool/jabber}/.erlang.cookie
+ fi
fi
+ if use ssl; then
+ SSL_ORGANIZATION="${SSL_ORGANIZATION:-Ejabberd XMPP Server}"
+ if [[ -e ${EROOT}/etc/jabber/ssl.pem ]]; then
+ einfo "Moving SSL certificate to new location..."
+ mkdir -p "${EROOT}/etc/ssl/ejabberd/"
+ mv -v "${EROOT}/etc/jabber/ssl.pem" "${EROOT}/etc/ssl/ejabberd/server.pem"
+ fi
+ install_cert /etc/ssl/ejabberd/server
+ fi
}