summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmadeusz Żołnowski <aidecoe@gentoo.org>2016-06-07 22:25:53 +0100
committerAmadeusz Żołnowski <aidecoe@gentoo.org>2016-06-07 23:20:59 +0100
commit20ab4701fdfda1cd492f6b3f649c089514a8d624 (patch)
tree35ca1a742ec711ac3eaf11aa10f11cfb0aca9a8b /net-im/ejabberd
parentdev-erlang/stun: Add new package (diff)
downloadgentoo-20ab4701fdfda1cd492f6b3f649c089514a8d624.tar.gz
gentoo-20ab4701fdfda1cd492f6b3f649c089514a8d624.tar.bz2
gentoo-20ab4701fdfda1cd492f6b3f649c089514a8d624.zip
net-im/ejabberd: Bump version
Remove obsolete flags. 'ssl' flag is removed because TLS support is not optional. 'tools' flag is temporarily removed because of problematic dependency. It may be restored in the future, although it just controls whether development tools should be installed. Debundle ejabberd dependencies. Use system rebar instead of bundled one. Access epam binary via wrapper with ejabberd user ownership. Fix epam binary localisation. Correct path to captcha command. Skip installing docs from Makefile, because this only install COPYING. Restrict test because test suite doesn't work out of the box. It needs database set up first. Rebase ejabberctl patch. Refactor ebuild and bump EAPI to 6. Correct funny capitalization in description. Package-Manager: portage-2.3.0_rc1
Diffstat (limited to 'net-im/ejabberd')
-rw-r--r--net-im/ejabberd/Manifest1
-rw-r--r--net-im/ejabberd/ejabberd-16.04.ebuild240
-rw-r--r--net-im/ejabberd/files/ejabberd-16.04-ejabberdctl.patch49
-rw-r--r--net-im/ejabberd/files/epam-wrapper21
-rw-r--r--net-im/ejabberd/metadata.xml24
5 files changed, 328 insertions, 7 deletions
diff --git a/net-im/ejabberd/Manifest b/net-im/ejabberd/Manifest
index d0c30fc0b3a9..8d57afa90978 100644
--- a/net-im/ejabberd/Manifest
+++ b/net-im/ejabberd/Manifest
@@ -2,6 +2,7 @@ DIST cache_tab-1.0.1.zip 16719 SHA256 149eff4dfb01f633cab643f368e5f96825c26c85ae
DIST eiconv-0.9.0.zip 101407 SHA256 fdaa09bcc79b556f2250c4693bc57c89ce474a5ea6ea12429cbb6c2d4ed3619b SHA512 44d0af378b9873dede92657c53557a565050cd4259598a1fe92e1c9bddc8219922ff093bfc20e380f3e39fc0d5648d6d6f72766a5847781cf2101dbd4b922fb6 WHIRLPOOL 97d97f527aaf4d0fb0176723bde464ab003b49b12acca1f657efe83f8c03186e6b4819f4aadedebb8e703e16cc4af23d317b6ebebe96a9a794e6aa78c8e6fc80
DIST ejabberd-15.03.tar.xz 6274856 SHA256 3a6fd6e94d6f24575dcaff1aa7ca319944eb76970a9d3b6bf5f30819824143fc SHA512 b292b596094aeab576d9d4aadea47042eeda130881de5dd523985dc60cd0644726dae8d525364ec72992c0c45ba9e0673b7a6ffc2bc20613ba0092e2b285e16f WHIRLPOOL 630feba542f5d4bac1e4c17f453b2298a500c0d18159e8f09a4f11e9d372f7ffbf6e2e600c0ee849c689868872644404c03ebfb375d4852f3bbbd966417d951e
DIST ejabberd-16.01.tgz 1651587 SHA256 e2cc479d5870539b2e6756690b227969c88a541d464d1fc6e1cbf7270ad7d681 SHA512 f0614db0d0eaf6d4f25b75b8eefbcf93260549876535fd5d82498c75779d182b19ec249ffb9b1b168cb5a887e8e6933eb868892b4aa5cd2933b739d263adca8a WHIRLPOOL 65bc13ba5e380a999ed2ae9c816856f90e24393343d16ae52349350687dfdb15857a3358d856de5694c30718cefc5513b9d3c75871bb368cac54547becc1607a
+DIST ejabberd-16.04.tar.gz 1715963 SHA256 3d964fe74e438253c64c8498eb7465d2440823614a23df8d33bdf40126d72cc3 SHA512 5975d5a164060cca59b6d92de2c432f063061e832b2e03cae351fe3c16b178259489dc0b82ea800f1c2388eeb7e3aa4340630ad3c10a22cc6d6f0b4eef8fa0f2 WHIRLPOOL d9018835aaa736040f63222c73b54ea65385532989390c007f4cb736b474da40d9fdceb6c377a251398fb6de87869a13dec0ac160fe9a0d081337efd35dc66b4
DIST ejabberd-2.1.13.tgz 1999853 SHA256 a80d1c72e435da31758261cb0c04fe750ac71fc3e33a3b606123efd3b3abc86d SHA512 9348271f0cf1d9a7e6c53204121568e77820afc50fff1271e7b7ef66c5c5d7d067034c46472250423c4e9052046b18c1c8178f09eda0b0bfe25a1eac465fd07b WHIRLPOOL 2c366d2f7c4371db56f47f5492ef27028a589186eeddb7a6b4e8aac0537b1b80ee31a9760f0551063ce2c2a658b9b5eafb7ed25294e00eb69480231a599a7b10
DIST ejabberd-mod_statsdx-1118.patch.gz 13989 SHA256 5e5d975e44248cf2b0d6dd0ecf4c477e8479b2b4d0bd531e80f4623fd787320e SHA512 99399323150990cda15e707385f0f26fa790d4ba188a97ac46daaaab9c25e72a7ec72a875573136f17a18648017074d76e4e267b544dc4c95a5101ed9ad6815d WHIRLPOOL 05997f03bb70136ee5e829ea9c55e3aeb0704150f1ed54f11c6cce382a82106129fc1a6ef35a62780837cd2b59fbb384fa10f3bb49813acaee8c5edc22ae3702
DIST elixir-f2a9c7016633ca63541a8160c63a53eb7edbccdb.zip 1335681 SHA256 4ef8cd93e68a314bb4702547629f9be7a6bb840f6b7956aead6f51700e73c41a SHA512 a6e5170f8d3efc1d31aa82477f4ff377ea7205d106bbf633075df5bef0b22a276cc6897c2a8b7fcbbff269c9fe8378f4802876e0e2aecb90012c0c2165c2b8e8 WHIRLPOOL 716e45804df24b7a4a55e0ad81f72c9961e4066dd3e24b1e3cd1ba041c6c1dc8426d0feaf97580eaf9b369d0fee33cb9e3c26b71eaf6c91d318590e9e6b5ab0c
diff --git a/net-im/ejabberd/ejabberd-16.04.ebuild b/net-im/ejabberd/ejabberd-16.04.ebuild
new file mode 100644
index 000000000000..5c718138708c
--- /dev/null
+++ b/net-im/ejabberd/ejabberd-16.04.ebuild
@@ -0,0 +1,240 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+SSL_CERT_MANDATORY=1
+
+inherit eutils pam rebar ssl-cert systemd
+
+DESCRIPTION="Robust, scalable and extensible XMPP server"
+HOMEPAGE="http://www.ejabberd.im/ https://github.com/processone/ejabberd/"
+SRC_URI="http://www.process-one.net/downloads/${PN}/${PV}/${P}.tgz
+ -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~x86"
+REQUIRED_USE="mssql? ( odbc )"
+# TODO: Add 'tools' flag.
+IUSE="captcha debug full-xml hipe ldap mssql mysql nls odbc pam postgres redis
+ riak roster-gw sqlite zlib"
+
+RESTRICT="test"
+
+# TODO: Add dependencies for 'tools' flag enabled.
+# TODO: tools? (
+# TODO: >=dev-erlang/meck-0.8.4
+# TODO: >=dev-erlang/moka-1.0.5b
+# TODO: )
+CDEPEND="
+ >=dev-erlang/cache_tab-1.0.2
+ >=dev-erlang/esip-1.0.4
+ >=dev-erlang/fast_tls-1.0.3
+ >=dev-erlang/fast_xml-1.1.3
+ >=dev-erlang/fast_yaml-1.0.3
+ >=dev-erlang/jiffy-0.14.7
+ >=dev-erlang/lager-3.0.2
+ >=dev-erlang/luerl-0.2
+ >=dev-erlang/p1_oauth2-0.6.1
+ >=dev-erlang/p1_utils-1.0.4
+ >=dev-erlang/p1_xmlrpc-1.15.1
+ >=dev-erlang/stringprep-1.0.3
+ >=dev-erlang/stun-1.0.3
+ >=dev-lang/erlang-17.1[hipe?,odbc?,ssl]
+ >=net-im/jabber-base-0.01
+ ldap? ( =net-nds/openldap-2* )
+ mysql? ( >=dev-erlang/p1_mysql-1.0.1 )
+ nls? ( >=dev-erlang/iconv-1.0.0 )
+ odbc? ( dev-db/unixODBC )
+ pam? ( >=dev-erlang/p1_pam-1.0.0 )
+ postgres? ( >=dev-erlang/p1_pgsql-1.1.0 )
+ redis? ( >=dev-erlang/eredis-1.0.8 )
+ riak? (
+ >=dev-erlang/hamcrest-0.1.0_p20150103
+ >=dev-erlang/riakc-2.1.1_p20151111
+ )
+ sqlite? ( >=dev-erlang/sqlite3-1.1.5 )
+ zlib? ( >=dev-erlang/ezlib-1.0.1 )"
+DEPEND="${CDEPEND}
+ >=sys-apps/gawk-4.1"
+RDEPEND="${CDEPEND}
+ captcha? ( media-gfx/imagemagick[truetype,png] )"
+
+PATCHES=( "${FILESDIR}/${P}-ejabberdctl.patch" )
+
+# Paths in net-im/jabber-base
+JABBER_ETC="${EPREFIX}/etc/jabber"
+JABBER_LOG="${EPREFIX}/var/log/jabber"
+JABBER_SPOOL="${EPREFIX}/var/spool/jabber"
+
+# Adjust example configuration file to Gentoo.
+# - Use our sample certificates.
+# - Correct PAM service name.
+adjust_config() {
+ sed -e "s|/path/to/ssl.pem|/etc/ssl/ejabberd/server.pem|g" \
+ -e "s|pamservicename|xmpp|" \
+ -i "${S}/ejabberd.yml.example" \
+ || die 'failed to adjust example config'
+}
+
+# Set paths to ejabberd lib directory consistently to point always to directory
+# suffixed with version.
+correct_ejabberd_paths() {
+ sed -e "/^EJABBERDDIR[[:space:]]*=/{s:ejabberd:${P}:}" \
+ -i "${S}/Makefile.in" \
+ || die 'failed to set ejabberd path in Makefile.in'
+ sed -e "/EJABBERD_BIN_PATH=/{s:ejabberd:${P}:}" \
+ -i "${S}/ejabberdctl.template" \
+ || die 'failed to set ejabberd path in ejabberdctl.template'
+ sed -e 's|\(captcha_cmd:[[:space:]]*"\).\+"|\1'$(get_ejabberd_path)'/priv/bin/captcha.sh"|' \
+ -i "${S}/ejabberd.yml.example" \
+ || die 'failed to correct path to captcha.sh in example config'
+}
+
+# Get epam-wrapper from 'files' directory and correct path to lib directory in
+# it. epam-wrapper is placed into work directory. It is assumed no epam-wrapper
+# file exists there already.
+customize_epam_wrapper() {
+ local epam_wrapper_src="$1"
+ local epam_wrapper_dst="${S}/epam-wrapper"
+
+ [[ -e ${epam_wrapper_dst} ]] && die 'epam-wrapper already exists'
+ sed -r -e "s@^(ERL_LIBS=).*\$@\1${EPREFIX}$(get_erl_libs)@" \
+ "${epam_wrapper_src}" >"${epam_wrapper_dst}" \
+ || die 'failed to install epam-wrapper'
+}
+
+# Get path to ejabberd lib directory.
+get_ejabberd_path() {
+ echo "$(get_erl_libs)/${P}"
+}
+
+# Set paths to defined by net-im/jabber-base.
+set_jabberbase_paths() {
+ sed -e "/^ETCDIR[[:space:]]*=/{s:@sysconfdir@/ejabberd:${JABBER_ETC}:}" \
+ -e "/^LOGDIR[[:space:]]*=/{s:@localstatedir@/log/ejabberd:${JABBER_LOG}:}" \
+ -e "/^SPOOLDIR[[:space:]]*=/{s:@localstatedir@/lib/ejabberd:${JABBER_SPOOL}:}" \
+ -i "${S}/Makefile.in" \
+ || die 'failed to set paths in Makefile.in'
+ sed -e "s|\(ETC_DIR=\){{sysconfdir}}.*|\1${JABBER_ETC}|" \
+ -e "s|\(LOGS_DIR=\){{localstatedir}}.*|\1${JABBER_LOG}|" \
+ -e "s|\(SPOOL_DIR=\){{localstatedir}}.*|\1${JABBER_SPOOL}|" \
+ -i "${S}/ejabberdctl.template" \
+ || die 'failed to set paths ejabberdctl.template'
+}
+
+# Skip installing docs because it's only COPYING that's installed by Makefile.
+skip_docs() {
+ gawk -i inplace '
+/# Documentation/, /^[[:space:]]*#?[[:space:]]*$/ {
+ if ($0 ~ /^[[:space:]]*#?[[:space:]]*$/) {
+ print $0;
+ } else {
+ next;
+ }
+}
+1
+' "${S}/Makefile.in" || die 'failed to remove docs section from Makefile.in'
+}
+
+# Generate and install sample ejabberd certificate.
+install_sample_ejabberd_cert() {
+ SSL_ORGANIZATION="${SSL_ORGANIZATION:-ejabberd XMPP Server}"
+ install_cert /etc/ssl/ejabberd/server || return
+ # Fix ssl cert permissions (bug #369809).
+ chown root:jabber "${EROOT}/etc/ssl/ejabberd/server.pem" || return
+ chmod 0440 "${EROOT}/etc/ssl/ejabberd/server.pem"
+}
+
+src_prepare() {
+ default
+
+ rebar_remove_deps
+ correct_ejabberd_paths
+ set_jabberbase_paths
+ skip_docs
+ adjust_config
+ customize_epam_wrapper "${FILESDIR}/epam-wrapper"
+}
+
+src_configure() {
+ econf \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
+ --libdir="${EPREFIX}$(get_erl_libs)" \
+ --enable-user=jabber \
+ $(use_enable debug) \
+ $(use_enable full-xml) \
+ $(use_enable hipe) \
+ $(use_enable mssql) \
+ $(use_enable mysql) \
+ $(use_enable nls iconv) \
+ $(use_enable odbc) \
+ $(use_enable pam) \
+ $(use_enable postgres pgsql) \
+ $(use_enable redis) \
+ $(use_enable riak) \
+ $(use_enable roster-gw roster-gateway-workaround) \
+ $(use_enable sqlite) \
+ $(use_enable zlib)
+}
+
+src_compile() {
+ emake REBAR='rebar -v' src
+}
+
+src_install() {
+ default
+
+ if use pam; then
+ local epam_path="$(get_ejabberd_path)/priv/bin/epam"
+
+ pamd_mimic_system xmpp auth account || die "cannot create pam.d file"
+ into "$(get_ejabberd_path)/priv"
+ newbin epam-wrapper epam
+ # PAM helper module permissions
+ # https://www.process-one.net/docs/ejabberd/guide_en.html#pam
+ fperms 4750 "${epam_path}"
+ fowners root:jabber "${epam_path}"
+ fi
+
+ newconfd "${FILESDIR}/${PN}-3.confd" "${PN}"
+ newinitd "${FILESDIR}/${PN}-3.initd" "${PN}"
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_dotmpfilesd "${FILESDIR}/${PN}.tmpfiles.conf"
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${PN}.logrotate" "${PN}"
+}
+
+pkg_postinst() {
+ if [[ ! ${REPLACING_VERSIONS} ]]; then
+ elog "For configuration instructions, please see"
+ elog " /usr/share/doc/${PF}/html/guide.html"
+ elog "or the online version at"
+ elog " http://www.process-one.net/en/ejabberd/docs/"
+ elif [[ -f ${EROOT}/etc/jabber/ejabberd.cfg ]]; then
+ elog "Ejabberd now defaults to using a YAML format for its config file."
+ elog "The old ejabberd.cfg file can be converted using the following instructions:"
+ echo
+ elog "1. Make sure all processes related to the previous version of ejabberd aren't"
+ elog " running. Usually this just means the ejabberd and epmd daemons and possibly"
+ elog " the pam-related process (epam) if pam support is enabled."
+ elog "2. Run \`ejabberdctl start\` with sufficient permissions. Note that this can"
+ elog " fail to start ejabberd properly for various reasons. Check ejabberd's main"
+ elog " log file at /var/log/jabber/ejabberd.log to confirm it started successfully."
+ elog "3. Run"
+ elog " \`ejabberdctl convert_to_yaml /etc/jabber/ejabberd.cfg /etc/jabber/ejabberd.yml.new\`"
+ elog " with sufficient permissions, edit and rename /etc/jabber/ejabberd.yml.new to"
+ elog " /etc/jabber/ejabberd.yml, and finally restart ejabberd with the new config"
+ elog " file."
+ echo
+ fi
+
+ if ! install_sample_ejabberd_cert; then
+ eerror
+ eerror "Failed to install sample ejabberd certificate"
+ eerror
+ fi
+}
diff --git a/net-im/ejabberd/files/ejabberd-16.04-ejabberdctl.patch b/net-im/ejabberd/files/ejabberd-16.04-ejabberdctl.patch
new file mode 100644
index 000000000000..de2acd5aa017
--- /dev/null
+++ b/net-im/ejabberd/files/ejabberd-16.04-ejabberdctl.patch
@@ -0,0 +1,49 @@
+Set SHELL since the generic jabber user used on Gentoo for jabber servers
+doesn't have a valid shell set by default and fix EXEC_CMD otherwise it fails
+with "This account is currently not available" again due to jabber not having
+a valid shell.
+
+Also, workaround the assumption that jabber's $HOME is a directory when instead
+it defaults to /dev/null on Gentoo.
+
+--- a/ejabberdctl.template 2016-01-12 11:07:58.000000000 +0000
++++ b/ejabberdctl.template 2016-02-15 21:36:27.508297627 +0000
+@@ -16,6 +16,7 @@
+ EPMD={{bindir}}/epmd
+ INSTALLUSER={{installuser}}
+ ERL_LIBS={{libdir}}
++SHELL=/bin/sh
+
+ # check the proper system user is used if defined
+ if [ "$INSTALLUSER" != "" ] ; then
+@@ -23,11 +24,11 @@
+ for GID in `id -G`; do
+ if [ $GID -eq 0 ] ; then
+ INSTALLUSER_HOME=$(getent passwd "$INSTALLUSER" | cut -d: -f6)
+- if [ -n "$INSTALLUSER_HOME" ] && [ ! -d "$INSTALLUSER_HOME" ] ; then
++ if [ -n "$INSTALLUSER_HOME" ] && [ ! -e "$INSTALLUSER_HOME" ] ; then
+ mkdir -p "$INSTALLUSER_HOME"
+ chown "$INSTALLUSER" "$INSTALLUSER_HOME"
+ fi
+- EXEC_CMD="su $INSTALLUSER -c"
++ EXEC_CMD="su $INSTALLUSER -p -c"
+ fi
+ done
+ if [ `id -g` -eq `id -g $INSTALLUSER` ] ; then
+@@ -100,6 +101,7 @@
+ DATETIME=`date "+%Y%m%d-%H%M%S"`
+ ERL_CRASH_DUMP=$LOGS_DIR/erl_crash_$DATETIME.dump
+ ERL_INETRC=$ETC_DIR/inetrc
++HOME=$SPOOL_DIR
+
+ # define mnesia options
+ MNESIA_OPTS="-mnesia dir \"\\\"$SPOOL_DIR\\\"\" $MNESIA_OPTIONS"
+@@ -159,6 +161,8 @@
+ export CONTRIB_MODULES_PATH
+ export CONTRIB_MODULES_CONF_DIR
+ export ERL_LIBS
++export HOME
++export SHELL
+
+ shell_escape()
+ {
diff --git a/net-im/ejabberd/files/epam-wrapper b/net-im/ejabberd/files/epam-wrapper
new file mode 100644
index 000000000000..a22793c86c03
--- /dev/null
+++ b/net-im/ejabberd/files/epam-wrapper
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+ERL_LIBS=/usr/lib/erlang/lib
+
+for bin in "$ERL_LIBS"/p1_pam-*/priv/bin/epam; do
+ if [ -x "$bin" ]; then
+ if [ -z "$epam" ]; then
+ epam="$bin"
+ else
+ echo "Multiple p1_pam libraries - don't know what to do" >&2
+ exit 1
+ fi
+ fi
+done
+
+if [ -z "$epam" ]; then
+ echo "Couldn't find p1_pam package" >&2
+ exit 1
+fi
+
+exec "$epam"
diff --git a/net-im/ejabberd/metadata.xml b/net-im/ejabberd/metadata.xml
index 45ac1e31a8bd..97487c35c24d 100644
--- a/net-im/ejabberd/metadata.xml
+++ b/net-im/ejabberd/metadata.xml
@@ -14,7 +14,23 @@
mostly written in Erlang, and works on many platforms.
</longdescription>
<use>
- <flag name="captcha">Support for CAPTCHA Forms (XEP-158)</flag>
+ <flag name="captcha">Support for CAPTCHA Forms (XEP-158) on registration</flag>
+ <flag name="full-xml">Use XML features in XMPP stream (ex: CDATA),
+ requires XML compliant clients</flag>
+ <flag name="hipe">Compile natively with HiPE, not recommended</flag>
+ <flag name="mssql">Enable Microsoft SQL Server support (via ODBC) for
+ data storage</flag>
+ <flag name="mysql">Enable MySQL support for data storage</flag>
+ <flag name="nls">Enable character set conversion for mod_irc</flag>
+ <flag name="odbc">Enable ODBC support to access data storage</flag>
+ <flag name="postgres">Enable PostgreSQL support for data storage</flag>
+ <flag name="redis">Enable Redis support for transient data</flag>
+ <flag name="riak">Enable support for Riak - distributed NoSQL key-value
+ data store</flag>
+ <flag name="roster-gw">Turn on workaround for processing gateway subscriptions</flag>
+ <flag name="sqlite">Enable SQLite database support</flag>
+ <flag name="zlib">Enable Stream Compression (XEP-0138) using zlib</flag>
+
<flag name="mod_proxy65">Support for SOCKS5 Bytestreams (XEP-0065)</flag>
<flag name="mod_statsdx">Measures several statistics, and provides a new section in ejabberd Web Admin to view them.</flag>
<flag name="elixir">Enable Elixir language support (http://elixir-lang.org/). Use bundled plugin instead of dev-lang/elixir.</flag>
@@ -23,12 +39,6 @@
<flag name="mod_irc">Build irc gateway</flag>
<flag name="mod_muc">Build Multi User Chat module</flag>
<flag name="mod_pubsub">Build Pubsub module</flag>
- <flag name="mssql">Build Microsoft SQL Server support</flag>
- <flag name="mysql">Build Native MySQL support</flag>
- <flag name="odbc">Build ODBC data storage support</flag>
- <flag name="postgres">Build Native PostgreSQL support</flag>
- <flag name="redis">Enable Redis support</flag>
- <flag name="riak">Enable Riak support</flag>
<flag name="tools">Build development tools</flag>
<flag name="web">Enable web admin interface</flag>
</use>