summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-im/ejabberd/ejabberd-2.1.3.ebuild')
-rw-r--r--net-im/ejabberd/ejabberd-2.1.3.ebuild81
1 files changed, 49 insertions, 32 deletions
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
}