public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-im/ejabberd/, net-im/ejabberd/files/
@ 2016-02-21 14:25 Amadeusz Piotr Żołnowski
  0 siblings, 0 replies; 9+ messages in thread
From: Amadeusz Piotr Żołnowski @ 2016-02-21 14:25 UTC (permalink / raw
  To: gentoo-commits

commit:     671997f1e86d3e18d6437ce42d525f533a1875e2
Author:     Amadeusz Żołnowski <aidecoe <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 21 14:23:15 2016 +0000
Commit:     Amadeusz Piotr Żołnowski <aidecoe <AT> gentoo <DOT> org>
CommitDate: Sun Feb 21 14:24:59 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=671997f1

net-im/ejabberd: Make ejabberd init script depend on epmd

ejabberd starts epmd if it's not already running, but it's not reflected
in epmd init script state. Make ejabberd init script depend on epmd
explicitly.

Gentoo-Bug: 566824

Package-Manager: portage-2.2.27
RepoMan-Options: --force

 net-im/ejabberd/{ejabberd-16.01.ebuild => ejabberd-16.01-r1.ebuild}     | 0
 .../ejabberd/{ejabberd-2.1.13-r1.ebuild => ejabberd-2.1.13-r2.ebuild}   | 2 +-
 net-im/ejabberd/files/ejabberd-3.initd                                  | 2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net-im/ejabberd/ejabberd-16.01.ebuild b/net-im/ejabberd/ejabberd-16.01-r1.ebuild
similarity index 100%
rename from net-im/ejabberd/ejabberd-16.01.ebuild
rename to net-im/ejabberd/ejabberd-16.01-r1.ebuild

diff --git a/net-im/ejabberd/ejabberd-2.1.13-r1.ebuild b/net-im/ejabberd/ejabberd-2.1.13-r2.ebuild
similarity index 99%
rename from net-im/ejabberd/ejabberd-2.1.13-r1.ebuild
rename to net-im/ejabberd/ejabberd-2.1.13-r2.ebuild
index 258df61..3ca0b2f 100644
--- a/net-im/ejabberd/ejabberd-2.1.13-r1.ebuild
+++ b/net-im/ejabberd/ejabberd-2.1.13-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 

diff --git a/net-im/ejabberd/files/ejabberd-3.initd b/net-im/ejabberd/files/ejabberd-3.initd
index 29a30da..18150a7 100644
--- a/net-im/ejabberd/files/ejabberd-3.initd
+++ b/net-im/ejabberd/files/ejabberd-3.initd
@@ -5,7 +5,7 @@
 
 depend() {
 	use dns
-	need net
+	need epmd net
 	provide jabber-server
 }
 


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-im/ejabberd/, net-im/ejabberd/files/
@ 2016-06-07 22:24 Amadeusz Piotr Żołnowski
  0 siblings, 0 replies; 9+ messages in thread
From: Amadeusz Piotr Żołnowski @ 2016-06-07 22:24 UTC (permalink / raw
  To: gentoo-commits

commit:     20ab4701fdfda1cd492f6b3f649c089514a8d624
Author:     Amadeusz Żołnowski <aidecoe <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  7 21:25:53 2016 +0000
Commit:     Amadeusz Piotr Żołnowski <aidecoe <AT> gentoo <DOT> org>
CommitDate: Tue Jun  7 22:20:59 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20ab4701

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

 net-im/ejabberd/Manifest                           |   1 +
 net-im/ejabberd/ejabberd-16.04.ebuild              | 240 +++++++++++++++++++++
 .../files/ejabberd-16.04-ejabberdctl.patch         |  49 +++++
 net-im/ejabberd/files/epam-wrapper                 |  21 ++
 net-im/ejabberd/metadata.xml                       |  24 ++-
 5 files changed, 328 insertions(+), 7 deletions(-)

diff --git a/net-im/ejabberd/Manifest b/net-im/ejabberd/Manifest
index d0c30fc..8d57afa 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 0000000..5c71813
--- /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 0000000..de2acd5
--- /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 0000000..a22793c
--- /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 45ac1e3..97487c3 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>


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-im/ejabberd/, net-im/ejabberd/files/
@ 2016-06-13 21:55 Amadeusz Piotr Żołnowski
  0 siblings, 0 replies; 9+ messages in thread
From: Amadeusz Piotr Żołnowski @ 2016-06-13 21:55 UTC (permalink / raw
  To: gentoo-commits

commit:     b40598486bae8096d554d64aaf1e260625bf6833
Author:     Amadeusz Żołnowski <aidecoe <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 13 21:42:43 2016 +0000
Commit:     Amadeusz Piotr Żołnowski <aidecoe <AT> gentoo <DOT> org>
CommitDate: Mon Jun 13 21:55:38 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4059848

net-im/ejabberd: Remove the oldest testing version

Package-Manager: portage-2.3.0_rc1

 net-im/ejabberd/Manifest                           |   1 -
 net-im/ejabberd/ejabberd-15.03-r1.ebuild           | 150 ---------------------
 .../files/ejabberd-15.03-ejabberdctl.patch         |  49 -------
 3 files changed, 200 deletions(-)

diff --git a/net-im/ejabberd/Manifest b/net-im/ejabberd/Manifest
index 8d57afa..9524ed7 100644
--- a/net-im/ejabberd/Manifest
+++ b/net-im/ejabberd/Manifest
@@ -1,6 +1,5 @@
 DIST cache_tab-1.0.1.zip 16719 SHA256 149eff4dfb01f633cab643f368e5f96825c26c85ae9e6c22de3f5792e5d3dc28 SHA512 ada72a578359909201d62ad775ca85969aed5cab9be31d38bd505f726434d08bb311f06654f3f26a3b639b9ae2742dd1950ba527489aef84f2ac0dfdb7fba0c8 WHIRLPOOL d026a7452274cb8cfd536da4c5dbabaf0414ddaa5fe835aa80d825d1afae9f952a71e61eaa825d89ee65f6a1d4db9714c3710e7ed36c8fac1be73730e732f362
 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

diff --git a/net-im/ejabberd/ejabberd-15.03-r1.ebuild b/net-im/ejabberd/ejabberd-15.03-r1.ebuild
deleted file mode 100644
index e8664d8..0000000
--- a/net-im/ejabberd/ejabberd-15.03-r1.ebuild
+++ /dev/null
@@ -1,150 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit eutils multilib pam ssl-cert systemd
-
-DESCRIPTION="The Erlang Jabber Daemon"
-HOMEPAGE="http://www.ejabberd.im/ https://github.com/processone/ejabberd/"
-SRC_URI="https://dev.gentoo.org/~radhermit/dist/${P}.tar.xz"
-# upstream tarball missing bundled erlang libs that are fetched via git
-#SRC_URI="https://www.process-one.net/downloads/downloads-action.php?file=/${PN}/${PV}/${P}.tgz -> ${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~sparc ~x86"
-EJABBERD_MODULES="mod_bosh mod_irc mod_muc mod_proxy65 mod_pubsub"
-IUSE="captcha debug elixir ldap mysql nls odbc pam postgres riak redis tools zlib ${EJABBERD_MODULES}"
-
-DEPEND=">=net-im/jabber-base-0.01
-	>=dev-libs/expat-1.95
-	>=dev-libs/libyaml-0.1.4
-	>=dev-lang/erlang-15.2[ssl]
-	odbc? ( dev-db/unixODBC )
-	ldap? ( =net-nds/openldap-2* )
-	>=dev-libs/openssl-0.9.8e:=
-	captcha? ( media-gfx/imagemagick[truetype,png] )
-	zlib? ( >=sys-libs/zlib-1.2.3 )"
-RDEPEND="${DEPEND}
-	>=sys-apps/shadow-4.1.4.2-r3
-	pam? ( virtual/pam )"
-
-# paths in net-im/jabber-base
-JABBER_ETC="${EPREFIX}/etc/jabber"
-#JABBER_RUN="/var/run/jabber"
-JABBER_SPOOL="${EPREFIX}/var/spool/jabber"
-JABBER_LOG="${EPREFIX}/var/log/jabber"
-JABBER_DOC="${EPREFIX}/usr/share/doc/${PF}"
-
-src_prepare() {
-	epatch "${FILESDIR}"/${P}-ejabberdctl.patch
-
-	# don't install release notes (we'll do this manually)
-	sed '/install .* [.][.]\/doc\/[*][.]txt $(DOCDIR)/d' -i Makefile.in || die
-	# Set correct paths
-	sed -e "/^EJABBERDDIR[[:space:]]*=/{s:ejabberd:${PF}:}" \
-		-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 Makefile.in || die
-	sed -e "/EJABBERDDIR=/{s:ejabberd:${PF}:}" \
-		-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 ejabberdctl.template || die
-
-	# fix up the ssl cert paths in ejabberd.yml to use our cert and
-	# also use the correct pam service name
-	sed -e "s:/path/to/ssl.pem:/etc/ssl/ejabberd/server.pem:g" \
-		-e "s:pamservicename:xmpp:" \
-		-i ejabberd.yml.example || die
-
-	# correct path to captcha script in default ejabberd.yml
-	sed -e 's|\({captcha_cmd,[[:space:]]*"\).\+"}|\1/usr/'$(get_libdir)'/erlang/lib/'${P}'/priv/bin/captcha.sh"}|' \
-		-i ejabberd.yml.example || die
-
-	# disable mod_irc in ejabberd.yml
-	if ! use mod_irc; then
-		sed -e "s/{mod_irc,/%{mod_irc,/" \
-			-i ejabberd.yml.example || die
-	fi
-
-	epatch_user
-}
-
-src_configure() {
-	econf \
-		--docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
-		--libdir="${EPREFIX}/usr/$(get_libdir)/erlang/lib/" \
-		$(use_enable tools) \
-		$(use_enable odbc) \
-		$(use_enable mysql) \
-		$(use_enable postgres pgsql) \
-		$(use_enable pam) \
-		$(use_enable zlib) \
-		$(use_enable riak) \
-		$(use_enable redis) \
-		$(use_enable mod_bosh json) \
-		$(use_enable nls iconv) \
-		$(use_enable elixir) \
-		$(use_enable debug) \
-		--enable-lager \
-		--enable-user=jabber
-
-	# run configure scripts for all prefetched deps
-	./rebar get-deps || die
-}
-
-src_compile() {
-	emake $(use debug && echo debug=true ejabberd_debug=true)
-}
-
-src_install() {
-	default
-
-	# Pam helper module permissions
-	# https://www.process-one.net/docs/ejabberd/guide_en.html#pam
-	if use pam; then
-		pamd_mimic_system xmpp auth account || die "Cannot create pam.d file"
-		fowners root:jabber "/usr/$(get_libdir)/erlang/lib/${PF}/priv/bin/epam"
-		fperms 4750 "/usr/$(get_libdir)/erlang/lib/${PF}/priv/bin/epam"
-	fi
-
-	newinitd "${FILESDIR}"/${PN}-3.initd ${PN}
-	newconfd "${FILESDIR}"/${PN}-3.confd ${PN}
-	systemd_dounit "${FILESDIR}"/${PN}.service
-	systemd_dotmpfilesd "${FILESDIR}"/${PN}.tmpfiles.conf
-
-	insinto /etc/logrotate.d
-	newins "${FILESDIR}"/${PN}.logrotate ${PN}
-}
-
-pkg_postinst() {
-	if [[ -z ${REPLACING_VERSIONS} ]] ; then
-		elog "For configuration instructions, please see"
-		elog "/usr/share/doc/${PF}/html/guide.html, or the online version at"
-		elog "http://www.process-one.net/en/ejabberd/docs/guide_en/"
-	else
-		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 running."
-		elog "   Usually this just means the ejabberd daemon and possibly the pam-related processes"
-		elog "   (epmd and epam) if pam support is enabled."
-		elog "2. Run \`ejabberdctl start\` with sufficient permissions. Note that this can fail to"
-		elog "   start ejabberd properly for various reasons. Check ejabberd's main log file"
-		elog "   at /var/log/jabber/ejabberd.log to confirm it started successfully."
-		elog "3. Run \`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 file."
-		echo
-	fi
-
-	SSL_ORGANIZATION="${SSL_ORGANIZATION:-Ejabberd XMPP Server}"
-	install_cert /etc/ssl/ejabberd/server
-	# Fix ssl cert permissions bug #369809
-	chown root:jabber "${EROOT}/etc/ssl/ejabberd/server.pem"
-	chmod 0440 "${EROOT}/etc/ssl/ejabberd/server.pem"
-}

diff --git a/net-im/ejabberd/files/ejabberd-15.03-ejabberdctl.patch b/net-im/ejabberd/files/ejabberd-15.03-ejabberdctl.patch
deleted file mode 100644
index 0d2ccf3..0000000
--- a/net-im/ejabberd/files/ejabberd-15.03-ejabberdctl.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-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.
-
---- ejabberd-15.03/ejabberdctl.template
-+++ ejabberd-15.03/ejabberdctl.template
-@@ -15,6 +15,7 @@
- IEX={{bindir}}/iex
- EPMD={{bindir}}/epmd
- INSTALLUSER={{installuser}}
-+SHELL=/bin/sh
- 
- # Compatibility in ZSH
- #setopt shwordsplit 2>/dev/null
-@@ -25,11 +26,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
-@@ -111,6 +112,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 erl parameters
- ERL_OPTIONS=$(echo $ERL_OPTIONS | sed 's/ /\\ /g')
-@@ -167,6 +169,8 @@
- export ERL_INETRC
- export ERL_MAX_PORTS
- export ERL_MAX_ETS_TABLES
-+export HOME
-+export SHELL
- 
- # start server
- start()


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-im/ejabberd/, net-im/ejabberd/files/
@ 2016-08-27 13:12 Amadeusz Piotr Żołnowski
  0 siblings, 0 replies; 9+ messages in thread
From: Amadeusz Piotr Żołnowski @ 2016-08-27 13:12 UTC (permalink / raw
  To: gentoo-commits

commit:     f8903a96fbfc3562162c319d643d3ab8723f0abe
Author:     Amadeusz Żołnowski <aidecoe <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 27 10:28:41 2016 +0000
Commit:     Amadeusz Piotr Żołnowski <aidecoe <AT> gentoo <DOT> org>
CommitDate: Sat Aug 27 12:59:51 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8903a96

net-im/ejabberd: Clean up files directory

service file is no longer used because it's provided by upstream. Suffix
"-3" in init and confd file names is no longer neccessary because
there's only one version of the initd script.

Package-Manager: portage-2.3.0

 net-im/ejabberd/ejabberd-16.04.ebuild                   |  4 ++--
 .../ejabberd/files/{ejabberd-3.confd => ejabberd.confd} |  0
 .../ejabberd/files/{ejabberd-3.initd => ejabberd.initd} |  2 +-
 net-im/ejabberd/files/ejabberd.service                  | 17 -----------------
 4 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/net-im/ejabberd/ejabberd-16.04.ebuild b/net-im/ejabberd/ejabberd-16.04.ebuild
index 7fd509d..211f21d 100644
--- a/net-im/ejabberd/ejabberd-16.04.ebuild
+++ b/net-im/ejabberd/ejabberd-16.04.ebuild
@@ -224,8 +224,8 @@ src_install() {
 		fperms 4750 "${epam_path}"
 	fi
 
-	newconfd "${FILESDIR}/${PN}-3.confd" "${PN}"
-	newinitd "${FILESDIR}/${PN}-3.initd" "${PN}"
+	newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+	newinitd "${FILESDIR}/${PN}.initd" "${PN}"
 	systemd_dounit "${PN}.service"
 	systemd_dotmpfilesd "${FILESDIR}/${PN}.tmpfiles.conf"
 

diff --git a/net-im/ejabberd/files/ejabberd-3.confd b/net-im/ejabberd/files/ejabberd.confd
similarity index 100%
rename from net-im/ejabberd/files/ejabberd-3.confd
rename to net-im/ejabberd/files/ejabberd.confd

diff --git a/net-im/ejabberd/files/ejabberd-3.initd b/net-im/ejabberd/files/ejabberd.initd
similarity index 96%
rename from net-im/ejabberd/files/ejabberd-3.initd
rename to net-im/ejabberd/files/ejabberd.initd
index 2827aeb..aed39b8 100644
--- a/net-im/ejabberd/files/ejabberd-3.initd
+++ b/net-im/ejabberd/files/ejabberd.initd
@@ -1,5 +1,5 @@
 #!/sbin/openrc-run
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 

diff --git a/net-im/ejabberd/files/ejabberd.service b/net-im/ejabberd/files/ejabberd.service
deleted file mode 100644
index 0b79256..00000000
--- a/net-im/ejabberd/files/ejabberd.service
+++ /dev/null
@@ -1,17 +0,0 @@
-[Unit]
-Description=A distributed, fault-tolerant Jabber/XMPP server
-After=network.target
-
-[Service]
-Type=oneshot
-User=jabber
-LimitNOFILE=16000
-RestartSec=5
-ExecStart=/usr/sbin/ejabberdctl \
-	--config /etc/jabber/ejabberd.cfg --ctl-config /etc/jabber/ejabberdctl.cfg \
-	--logs "/var/log/jabber" --spool "/var/spool/jabber" start
-ExecStop=/usr/sbin/ejabberdctl stop
-RemainAfterExit=yes
-
-[Install]
-WantedBy=multi-user.target


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-im/ejabberd/, net-im/ejabberd/files/
@ 2016-11-13 10:08 Amadeusz Piotr Żołnowski
  0 siblings, 0 replies; 9+ messages in thread
From: Amadeusz Piotr Żołnowski @ 2016-11-13 10:08 UTC (permalink / raw
  To: gentoo-commits

commit:     0c9fa61cdf21f280c4be90c3be1b0a510731ecf0
Author:     Amadeusz Żołnowski <aidecoe <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 10 22:41:24 2016 +0000
Commit:     Amadeusz Piotr Żołnowski <aidecoe <AT> gentoo <DOT> org>
CommitDate: Sun Nov 13 10:08:13 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c9fa61c

net-im/ejabberd: Bump version to 16.09

Package-Manager: portage-2.3.2

 net-im/ejabberd/Manifest                           |   1 +
 net-im/ejabberd/ejabberd-16.09.ebuild              | 297 +++++++++++++++++++++
 .../files/ejabberd-16.09-ejabberdctl.patch         |  62 +++++
 3 files changed, 360 insertions(+)

diff --git a/net-im/ejabberd/Manifest b/net-im/ejabberd/Manifest
index 8bcc74c..786180d 100644
--- a/net-im/ejabberd/Manifest
+++ b/net-im/ejabberd/Manifest
@@ -1,2 +1,3 @@
 DIST ejabberd-16.04.tar.gz 1715963 SHA256 3d964fe74e438253c64c8498eb7465d2440823614a23df8d33bdf40126d72cc3 SHA512 5975d5a164060cca59b6d92de2c432f063061e832b2e03cae351fe3c16b178259489dc0b82ea800f1c2388eeb7e3aa4340630ad3c10a22cc6d6f0b4eef8fa0f2 WHIRLPOOL d9018835aaa736040f63222c73b54ea65385532989390c007f4cb736b474da40d9fdceb6c377a251398fb6de87869a13dec0ac160fe9a0d081337efd35dc66b4
 DIST ejabberd-16.08.tar.gz 1739542 SHA256 b45598a6f2f1b398a19f23e3280b45eccc833d3339b1aeb6ec08ded7c19b1137 SHA512 661bf33e6d7f4c53d0c3679d1a9428fba11c22bad7d8bd535b49d7eeeff4de215a7a94f8300683e1dbaf2e68ea908f6e54cfe0ed2f1dc82326a46659e7c70f55 WHIRLPOOL 41f5ae825997818671d6db94ac62108a0b02f8eb6eed07ebaa04287ee2d7955dc4d15c3ce18cbf20240e4b2a14d48ccb8bf383b510851be12326131c4c829788
+DIST ejabberd-16.09.tar.gz 1687485 SHA256 7b44ab3af3310ca73624c47b65cf30a651d5a1398413e8af51c610d788fb8f14 SHA512 506365eff83f9ab97c9a632c4b8b2428aacbfc570c34ca65a78903d95c64755489ff7327be3efa2172c9d05d7891f83986b1ff3928a7ce806c0ab2aa5dbb647f WHIRLPOOL 6c56ad58b4e247cedf29cf247fdadddf727270311a0ba21eef88f84ee6b997ad8be75448e3bfdaa67d978ea167e2feb21bc9ce0839741a62fb60fa045e45edf2

diff --git a/net-im/ejabberd/ejabberd-16.09.ebuild b/net-im/ejabberd/ejabberd-16.09.ebuild
new file mode 100644
index 00000000..cb5c9fe
--- /dev/null
+++ b/net-im/ejabberd/ejabberd-16.09.ebuild
@@ -0,0 +1,297 @@
+# 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 ~ia64 ~ppc ~sparc ~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.4
+	>=dev-erlang/esip-1.0.8
+	>=dev-erlang/fast_tls-1.0.7
+	>=dev-erlang/fast_xml-1.1.15
+	>=dev-erlang/fast_yaml-1.0.6
+	>=dev-erlang/jiffy-0.14.7
+	>=dev-erlang/lager-3.2.1
+	>=dev-erlang/luerl-0.2
+	>=dev-erlang/p1_oauth2-0.6.1
+	>=dev-erlang/p1_utils-1.0.5
+	>=dev-erlang/stringprep-1.0.6
+	>=dev-erlang/stun-1.0.7
+	>=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.2 )
+	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] )"
+
+DOCS=( README )
+PATCHES=( "${FILESDIR}/${P}-ejabberdctl.patch" )
+
+EJABBERD_CERT="${EPREFIX}/etc/ssl/ejabberd/server.pem"
+# 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\"|\"${EJABBERD_CERT}\"|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'
+}
+
+# Check if there already exists a certificate.
+ejabberd_cert_exists() {
+	local cert
+
+	for cert in $(gawk -- \
+			'match($0, /^[[:space:]]*certfile: "([^"]+)"/, m) {print m[1];}' \
+			"${EROOT%/}${JABBER_ETC}/ejabberd.yml"); do
+		[[ -f ${cert} ]] && return 0
+	done
+
+	return 1
+}
+
+# Generate and install sample ejabberd certificate. It's installed into
+# EJABBERD_CERT path.
+ejabberd_cert_install() {
+	SSL_ORGANIZATION="${SSL_ORGANIZATION:-ejabberd XMPP Server}"
+	install_cert "${EJABBERD_CERT%.*}"
+	chown root:jabber "${EROOT%/}${EJABBERD_CERT}" || die
+	chmod 0440 "${EROOT%/}${EJABBERD_CERT}" || die
+}
+
+# Get path to ejabberd lib directory.
+#
+# This is the path ./configure script Base for this path is path set in
+# ./configure script which is /usr/lib by default. If libdir is explicitely set
+# to something else than this should be adjusted here as well.
+get_ejabberd_path() {
+	echo "/usr/$(get_libdir)/${P}"
+}
+
+# Make ejabberd.service for systemd from upstream provided template.
+make_ejabberd_service() {
+	sed -r \
+		-e 's!@ctlscriptpath@!/usr/sbin!' \
+		-e 's!(User|Group)=(.*)!\1=jabber!' \
+		"${PN}.service.template" >"${PN}.service" \
+		|| die 'failed to make ejabberd.service'
+}
+
+# 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'
+}
+
+src_prepare() {
+	default
+
+	rebar_remove_deps
+	correct_ejabberd_paths
+	set_jabberbase_paths
+	make_ejabberd_service
+	skip_docs
+	adjust_config
+	customize_epam_wrapper "${FILESDIR}/epam-wrapper"
+
+	# Fix bug #591862. ERL_LIBS should point directly to ejabberd directory
+	# rather than its parent which is default. That way ejabberd directory
+	# takes precedence is module lookup.
+	local ejabberd_erl_libs="$(get_ejabberd_path):$(get_erl_libs)"
+	sed -e "s|\(ERL_LIBS=\){{libdir}}.*|\1${ejabberd_erl_libs}|" \
+		-i "${S}/ejabberdctl.template" \
+		|| die 'failed to set ERL_LIBS in ejabberdctl.template'
+}
+
+src_configure() {
+	econf \
+		--docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
+		--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
+		fowners root:jabber "${epam_path}"
+		fperms 4750 "${epam_path}"
+	fi
+
+	newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+	newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+	systemd_dounit "${PN}.service"
+	systemd_dotmpfilesd "${FILESDIR}/${PN}.tmpfiles.conf"
+
+	insinto /etc/logrotate.d
+	newins "${FILESDIR}/${PN}.logrotate" "${PN}"
+}
+
+pkg_postinst() {
+	if [[ ! ${REPLACING_VERSIONS} ]]; then
+		echo
+		elog "For configuration instructions, please see"
+		elog "  http://www.process-one.net/en/ejabberd/docs/"
+		echo
+		if [[ " ${REPLACING_VERSIONS} " =~ \ 2\. ]]; then
+			ewarn "If you have used pubsub in ejabberd-2.* you may encounter issues after"
+			ewarn "migration to ${PV}. pubsub data may not be migrated automatically and"
+			ewarn "you may need to run migration script manually, see:"
+			ewarn
+			ewarn "  https://github.com/processone/ejabberd/issues/479#issuecomment-124497456"
+			ewarn
+			ewarn "In case you don't care about all stored moods, activities, geoinfo and you"
+			ewarn "know you don't store in pubsub anything important, you can just remove"
+			ewarn "pubsub tables:"
+			ewarn
+			ewarn "  rm ${EROOT%/}${JABBER_SPOOL}/pubsub_*"
+			ewarn
+			ewarn "See also: https://bugs.gentoo.org/show_bug.cgi?id=588244"
+			echo
+		fi
+	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 ! ejabberd_cert_exists; then
+		ejabberd_cert_install
+	fi
+
+	if use pam; then
+		# sfperms drops read bit from files with suid. Reapply it.
+		# Fix bug #592218.
+		local epam_path="$(get_ejabberd_path)/priv/bin/epam"
+		chmod g+r "${EROOT%/}${epam_path}" \
+			|| die "failed to correct ${epam_path} permissions"
+	fi
+}

diff --git a/net-im/ejabberd/files/ejabberd-16.09-ejabberdctl.patch b/net-im/ejabberd/files/ejabberd-16.09-ejabberdctl.patch
new file mode 100644
index 00000000..6001c65
--- /dev/null
+++ b/net-im/ejabberd/files/ejabberd-16.09-ejabberdctl.patch
@@ -0,0 +1,62 @@
+From 185923a3c5f11c2d29599416a52b6594bc94d8c9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
+Date: Mon, 29 Aug 2016 22:29:41 +0100
+Subject: [PATCH] Adjust ejabberdctl for Gentoo jabberbase setup
+
+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.
+---
+ ejabberdctl.template | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/ejabberdctl.template b/ejabberdctl.template
+index 5b34ebe..3c080fd 100755
+--- a/ejabberdctl.template
++++ b/ejabberdctl.template
+@@ -16,6 +16,7 @@ IEX={{bindir}}/iex
+ EPMD={{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 @@ if [ "$INSTALLUSER" != "" ] ; then
+     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
+@@ -91,6 +92,7 @@ EJABBERD_LOG_PATH=$LOGS_DIR/ejabberd.log
+ 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"
+@@ -149,6 +151,8 @@ export ERL_MAX_ETS_TABLES
+ export CONTRIB_MODULES_PATH
+ export CONTRIB_MODULES_CONF_DIR
+ export ERL_LIBS
++export HOME
++export SHELL
+ 
+ shell_escape_str()
+ {
+-- 
+2.9.2
+


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-im/ejabberd/, net-im/ejabberd/files/
@ 2017-07-09 20:14 Amadeusz Piotr Żołnowski
  0 siblings, 0 replies; 9+ messages in thread
From: Amadeusz Piotr Żołnowski @ 2017-07-09 20:14 UTC (permalink / raw
  To: gentoo-commits

commit:     e1c95311742e366e46a8e91cc6fcfa140caa263a
Author:     Amadeusz Żołnowski <aidecoe <AT> gentoo <DOT> org>
AuthorDate: Sun Jul  9 12:09:09 2017 +0000
Commit:     Amadeusz Piotr Żołnowski <aidecoe <AT> gentoo <DOT> org>
CommitDate: Sun Jul  9 20:14:05 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1c95311

net-im/ejabberd: Correct paths and user/group in unit service file

Gentoo-Bug: 621780

 net-im/ejabberd/ejabberd-17.01-r1.ebuild                  |  5 +++--
 ...{ejabberd-17.01-r1.ebuild => ejabberd-17.01-r2.ebuild} |  5 +++--
 .../{ejabberd-17.04.ebuild => ejabberd-17.04-r1.ebuild}   |  5 +++--
 net-im/ejabberd/ejabberd-17.04.ebuild                     |  5 +++--
 .../ejabberd-17.01-0001-Dont-overwrite-service-file.patch | 15 +++++++++++++++
 .../ejabberd-17.04-0002-Dont-overwrite-service-file.patch | 15 +++++++++++++++
 6 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/net-im/ejabberd/ejabberd-17.01-r1.ebuild b/net-im/ejabberd/ejabberd-17.01-r1.ebuild
index 7c2e9586ebd..7bada46b7dc 100644
--- a/net-im/ejabberd/ejabberd-17.01-r1.ebuild
+++ b/net-im/ejabberd/ejabberd-17.01-r1.ebuild
@@ -63,7 +63,8 @@ RDEPEND="${CDEPEND}
 	captcha? ( media-gfx/imagemagick[truetype,png] )"
 
 DOCS=( README )
-PATCHES=( "${FILESDIR}/${P}-ejabberdctl.patch" )
+PATCHES=( "${FILESDIR}/${P}-ejabberdctl.patch"
+	"${FILESDIR}/${P}-0001-Dont-overwrite-service-file.patch" )
 
 EJABBERD_CERT="${EPREFIX}/etc/ssl/ejabberd/server.pem"
 # Paths in net-im/jabber-base
@@ -157,7 +158,7 @@ is_mod_irc_enabled() {
 # Make ejabberd.service for systemd from upstream provided template.
 make_ejabberd_service() {
 	sed -r \
-		-e 's!@ctlscriptpath@!/usr/sbin!' \
+		-e 's!@ctlscriptpath@!/usr/sbin!g' \
 		-e 's!(User|Group)=(.*)!\1=jabber!' \
 		"${PN}.service.template" >"${PN}.service" \
 		|| die 'failed to make ejabberd.service'

diff --git a/net-im/ejabberd/ejabberd-17.01-r1.ebuild b/net-im/ejabberd/ejabberd-17.01-r2.ebuild
similarity index 98%
copy from net-im/ejabberd/ejabberd-17.01-r1.ebuild
copy to net-im/ejabberd/ejabberd-17.01-r2.ebuild
index 7c2e9586ebd..7bada46b7dc 100644
--- a/net-im/ejabberd/ejabberd-17.01-r1.ebuild
+++ b/net-im/ejabberd/ejabberd-17.01-r2.ebuild
@@ -63,7 +63,8 @@ RDEPEND="${CDEPEND}
 	captcha? ( media-gfx/imagemagick[truetype,png] )"
 
 DOCS=( README )
-PATCHES=( "${FILESDIR}/${P}-ejabberdctl.patch" )
+PATCHES=( "${FILESDIR}/${P}-ejabberdctl.patch"
+	"${FILESDIR}/${P}-0001-Dont-overwrite-service-file.patch" )
 
 EJABBERD_CERT="${EPREFIX}/etc/ssl/ejabberd/server.pem"
 # Paths in net-im/jabber-base
@@ -157,7 +158,7 @@ is_mod_irc_enabled() {
 # Make ejabberd.service for systemd from upstream provided template.
 make_ejabberd_service() {
 	sed -r \
-		-e 's!@ctlscriptpath@!/usr/sbin!' \
+		-e 's!@ctlscriptpath@!/usr/sbin!g' \
 		-e 's!(User|Group)=(.*)!\1=jabber!' \
 		"${PN}.service.template" >"${PN}.service" \
 		|| die 'failed to make ejabberd.service'

diff --git a/net-im/ejabberd/ejabberd-17.04.ebuild b/net-im/ejabberd/ejabberd-17.04-r1.ebuild
similarity index 98%
copy from net-im/ejabberd/ejabberd-17.04.ebuild
copy to net-im/ejabberd/ejabberd-17.04-r1.ebuild
index 1cec62f2eba..729fae6076e 100644
--- a/net-im/ejabberd/ejabberd-17.04.ebuild
+++ b/net-im/ejabberd/ejabberd-17.04-r1.ebuild
@@ -63,7 +63,8 @@ RDEPEND="${CDEPEND}
 
 DOCS=( README )
 PATCHES=( "${FILESDIR}/${P}-ejabberdctl.patch"
-	"${FILESDIR}/${P}-0001-Don-t-configure-or-compile-deps.patch" )
+	"${FILESDIR}/${P}-0001-Don-t-configure-or-compile-deps.patch"
+	"${FILESDIR}/${P}-0002-Dont-overwrite-service-file.patch" )
 
 EJABBERD_CERT="${EPREFIX}/etc/ssl/ejabberd/server.pem"
 # Paths in net-im/jabber-base
@@ -157,7 +158,7 @@ is_mod_irc_enabled() {
 # Make ejabberd.service for systemd from upstream provided template.
 make_ejabberd_service() {
 	sed -r \
-		-e 's!@ctlscriptpath@!/usr/sbin!' \
+		-e 's!@ctlscriptpath@!/usr/sbin!g' \
 		-e 's!(User|Group)=(.*)!\1=jabber!' \
 		"${PN}.service.template" >"${PN}.service" \
 		|| die 'failed to make ejabberd.service'

diff --git a/net-im/ejabberd/ejabberd-17.04.ebuild b/net-im/ejabberd/ejabberd-17.04.ebuild
index 1cec62f2eba..729fae6076e 100644
--- a/net-im/ejabberd/ejabberd-17.04.ebuild
+++ b/net-im/ejabberd/ejabberd-17.04.ebuild
@@ -63,7 +63,8 @@ RDEPEND="${CDEPEND}
 
 DOCS=( README )
 PATCHES=( "${FILESDIR}/${P}-ejabberdctl.patch"
-	"${FILESDIR}/${P}-0001-Don-t-configure-or-compile-deps.patch" )
+	"${FILESDIR}/${P}-0001-Don-t-configure-or-compile-deps.patch"
+	"${FILESDIR}/${P}-0002-Dont-overwrite-service-file.patch" )
 
 EJABBERD_CERT="${EPREFIX}/etc/ssl/ejabberd/server.pem"
 # Paths in net-im/jabber-base
@@ -157,7 +158,7 @@ is_mod_irc_enabled() {
 # Make ejabberd.service for systemd from upstream provided template.
 make_ejabberd_service() {
 	sed -r \
-		-e 's!@ctlscriptpath@!/usr/sbin!' \
+		-e 's!@ctlscriptpath@!/usr/sbin!g' \
 		-e 's!(User|Group)=(.*)!\1=jabber!' \
 		"${PN}.service.template" >"${PN}.service" \
 		|| die 'failed to make ejabberd.service'

diff --git a/net-im/ejabberd/files/ejabberd-17.01-0001-Dont-overwrite-service-file.patch b/net-im/ejabberd/files/ejabberd-17.01-0001-Dont-overwrite-service-file.patch
new file mode 100644
index 00000000000..92b7b023309
--- /dev/null
+++ b/net-im/ejabberd/files/ejabberd-17.01-0001-Dont-overwrite-service-file.patch
@@ -0,0 +1,15 @@
+diff --git a/Makefile.in b/Makefile.in
+index 5ff3efe0..644ed713 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -204,8 +204,8 @@ install: all copy-files
+ 	chmod 755 ejabberd.init
+ 	#
+ 	# Service script
+-	$(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*g" ejabberd.service.template \
+-		> ejabberd.service
++	[ -f ejabberd.service ] || $(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*g" \
++		ejabberd.service.template > ejabberd.service
+ 	chmod 644 ejabberd.service
+ 	#
+ 	# Spool directory

diff --git a/net-im/ejabberd/files/ejabberd-17.04-0002-Dont-overwrite-service-file.patch b/net-im/ejabberd/files/ejabberd-17.04-0002-Dont-overwrite-service-file.patch
new file mode 100644
index 00000000000..2bea750ef04
--- /dev/null
+++ b/net-im/ejabberd/files/ejabberd-17.04-0002-Dont-overwrite-service-file.patch
@@ -0,0 +1,15 @@
+diff --git a/Makefile.in b/Makefile.in
+index a0b4553d..4675b88a 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -204,8 +204,8 @@ install: all copy-files
+ 	chmod 755 ejabberd.init
+ 	#
+ 	# Service script
+-	$(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*g" ejabberd.service.template \
+-		> ejabberd.service
++	[ -f ejabberd.service ] || $(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*g" \
++		ejabberd.service.template > ejabberd.service
+ 	chmod 644 ejabberd.service
+ 	#
+ 	# Spool directory


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-im/ejabberd/, net-im/ejabberd/files/
@ 2020-08-23 10:42 Hanno Böck
  0 siblings, 0 replies; 9+ messages in thread
From: Hanno Böck @ 2020-08-23 10:42 UTC (permalink / raw
  To: gentoo-commits

commit:     6c9d3c1ddd8330358a28d93940c1f4d4afce1ce9
Author:     Hanno Böck <hanno <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 23 10:41:55 2020 +0000
Commit:     Hanno Böck <hanno <AT> gentoo <DOT> org>
CommitDate: Sun Aug 23 10:41:55 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c9d3c1d

net-im/ejabberd: remove old

Signed-off-by: Hanno Böck <hanno <AT> gentoo.org>
Package-Manager: Portage-3.0.4, Repoman-3.0.1

 net-im/ejabberd/Manifest                           |   2 -
 net-im/ejabberd/ejabberd-17.04-r2.ebuild           | 331 ---------------------
 net-im/ejabberd/ejabberd-20.03.ebuild              | 292 ------------------
 ...7.04-0001-Don-t-configure-or-compile-deps.patch |  53 ----
 .../files/ejabberd-17.04-ejabberdctl.patch         |  62 ----
 net-im/ejabberd/metadata.xml                       |   3 -
 6 files changed, 743 deletions(-)

diff --git a/net-im/ejabberd/Manifest b/net-im/ejabberd/Manifest
index 42042e3e5de..2c690be71df 100644
--- a/net-im/ejabberd/Manifest
+++ b/net-im/ejabberd/Manifest
@@ -1,3 +1 @@
-DIST ejabberd-17.04.tar.gz 1690441 BLAKE2B 2d31f1f0a393c6531653a55021b9deb729357bb53e86e85b85796a65f505257bcf7a14b0d168af2d13a6820e1524e1164ea7f17797df23ae41d7a8379f9e2066 SHA512 03467434dba92bd1ff2f70d78aa8fcf86fc73cb52aaaa73e4947229e1d14225e7b0d0133c3da7c8efe4c9db13aab932f40f757be46b120d0f280f96d62c203d7
-DIST ejabberd-20.03.tar.gz 2006603 BLAKE2B 67fa7d86e6802f24e783e91a8cb498375ca615bf22422ebe8bf630eb721e50574f468cfe25271172ebdfdca0c1df24dc6dd7f96a289153a017c32eb82af06d82 SHA512 f3ab666d9ffa596386ef121161dc7eeedca85cb7f5d290ad0882cd9557ea4166467bce9c082bdb423f932b44999c8e887d6a386d53564febf360f306feda3952
 DIST ejabberd-20.04.tar.gz 2022319 BLAKE2B 02ce782bc58a808f38dff58715204059c51762187abff7f5c77ff08eb13330b66485234eb2204c4336770d75303417ee74077466a07e701aa512158ff641a578 SHA512 7c478bbd73577e06f21e26804f4eb57deb52a0ebdd12e45034e810314cb73bb2ec60b55c6f266271eb45d5ebc135a39c498a29706d6d1f5087fd2b509a8844ca

diff --git a/net-im/ejabberd/ejabberd-17.04-r2.ebuild b/net-im/ejabberd/ejabberd-17.04-r2.ebuild
deleted file mode 100644
index 45ea0080663..00000000000
--- a/net-im/ejabberd/ejabberd-17.04-r2.ebuild
+++ /dev/null
@@ -1,331 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-SSL_CERT_MANDATORY=1
-
-inherit autotools eutils pam rebar ssl-cert systemd
-
-DESCRIPTION="Robust, scalable and extensible XMPP server"
-HOMEPAGE="https://www.ejabberd.im/ https://github.com/processone/ejabberd/"
-SRC_URI="https://www.process-one.net/downloads/${PN}/${PV}/${P}.tgz
-	-> ${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64 ~arm ~ia64 ~sparc 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.7
-	>=dev-erlang/esip-1.0.11
-	>=dev-erlang/fast_tls-1.0.11
-	>=dev-erlang/fast_xml-1.1.21
-	>=dev-erlang/fast_yaml-1.0.9
-	>=dev-erlang/jiffy-0.14.8
-	>=dev-erlang/lager-3.2.1
-	>=dev-erlang/luerl-0.2
-	>=dev-erlang/p1_oauth2-0.6.1
-	>=dev-erlang/p1_utils-1.0.8
-	>=dev-erlang/stringprep-1.0.8
-	>=dev-erlang/stun-1.0.10
-	>=dev-erlang/xmpp-1.1.9
-	<dev-erlang/xmpp-1.2.0
-	>=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.2 )
-	nls? ( >=dev-erlang/iconv-1.0.4 )
-	odbc? ( dev-db/unixODBC )
-	pam? ( >=dev-erlang/epam-1.0.2 )
-	postgres? ( >=dev-erlang/p1_pgsql-1.1.2 )
-	redis? ( >=dev-erlang/eredis-1.0.8 )
-	riak? (
-		>=dev-erlang/hamcrest-0.1.0_p20150103
-		>=dev-erlang/riakc-2.4.1
-	)
-	sqlite? ( >=dev-erlang/sqlite3-1.1.5 )
-	zlib? ( >=dev-erlang/ezlib-1.0.2 )"
-DEPEND="${CDEPEND}
-	>=sys-apps/gawk-4.1"
-RDEPEND="${CDEPEND}
-	captcha? ( media-gfx/imagemagick[truetype,png] )"
-
-DOCS=( README )
-PATCHES=( "${FILESDIR}/${P}-ejabberdctl.patch"
-	"${FILESDIR}/${P}-0001-Don-t-configure-or-compile-deps.patch"
-	"${FILESDIR}/${P}-0002-Dont-overwrite-service-file.patch" )
-
-EJABBERD_CERT="${EPREFIX}/etc/ssl/ejabberd/server.pem"
-# 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\"|\"${EJABBERD_CERT}\"|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'
-}
-
-# Disable mod_irc in example configuration file.
-disable_mod_irc() {
-	local needs_iconv='needs dev-erlang/iconv (+nls USE flag)'
-	sed -r \
-		-e "s@^(\s*)(mod_irc\s*:.*$)@\1## \2 # ${needs_iconv}@" \
-		-i "${S}/ejabberd.yml.example" \
-		|| die 'failed to modify example config'
-}
-
-# Check if there already exists a certificate.
-ejabberd_cert_exists() {
-	local cert
-
-	for cert in $(gawk -- \
-			'match($0, /^[[:space:]]*certfile: "([^"]+)"/, m) {print m[1];}' \
-			"${EROOT%/}${JABBER_ETC}/ejabberd.yml"); do
-		[[ -f ${cert} ]] && return 0
-	done
-
-	return 1
-}
-
-# Generate and install sample ejabberd certificate. It's installed into
-# EJABBERD_CERT path.
-ejabberd_cert_install() {
-	SSL_ORGANIZATION="${SSL_ORGANIZATION:-ejabberd XMPP Server}"
-	install_cert "${EJABBERD_CERT%.*}"
-	chown root:jabber "${EROOT%/}${EJABBERD_CERT}" || die
-	chmod 0440 "${EROOT%/}${EJABBERD_CERT}" || die
-}
-
-# Get path to ejabberd lib directory.
-#
-# This is the path ./configure script Base for this path is path set in
-# ./configure script which is /usr/lib by default. If libdir is explicitely set
-# to something else than this should be adjusted here as well.
-get_ejabberd_path() {
-	echo "/usr/$(get_libdir)/${P}"
-}
-
-# Check whether mod_irc is enabled in ejabberd configuration on target system.
-is_mod_irc_enabled() {
-	egrep '^(\s*)(mod_irc\s*:.*$)' \
-		"${EROOT%/}${JABBER_ETC}/ejabberd.yml"
-}
-
-# Make ejabberd.service for systemd from upstream provided template.
-make_ejabberd_service() {
-	sed -r \
-		-e 's!@ctlscriptpath@!/usr/sbin!g' \
-		-e 's!(User|Group)=(.*)!\1=jabber!' \
-		"${PN}.service.template" >"${PN}.service" \
-		|| die 'failed to make ejabberd.service'
-}
-
-# 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'
-}
-
-pkg_setup() {
-	if use pam; then
-		einfo "Adding jabber user to epam group to allow ejabberd to use PAM" \
-			"authentication"
-		# See
-		# <https://docs.ejabberd.im/admin/configuration/#pam-authentication>.
-		# epam binary is installed by dev-erlang/epam package, therefore SUID
-		# is set by that package. Instead of jabber group it uses epam group,
-		# therefore we need to add jabber user to epam group.
-		usermod -a -G epam jabber || die
-	fi
-}
-
-src_prepare() {
-	default
-
-	rebar_remove_deps
-	correct_ejabberd_paths
-	set_jabberbase_paths
-	make_ejabberd_service
-	skip_docs
-	adjust_config
-	use nls || disable_mod_irc
-	customize_epam_wrapper "${FILESDIR}/epam-wrapper"
-
-	rebar_fix_include_path fast_xml
-	rebar_fix_include_path p1_utils
-	rebar_fix_include_path xmpp
-
-	# Fix bug #591862. ERL_LIBS should point directly to ejabberd directory
-	# rather than its parent which is default. That way ejabberd directory
-	# takes precedence is module lookup.
-	local ejabberd_erl_libs="$(get_ejabberd_path):$(get_erl_libs)"
-	sed -e "s|\(ERL_LIBS=\){{libdir}}.*|\1${ejabberd_erl_libs}|" \
-		-i "${S}/ejabberdctl.template" \
-		|| die 'failed to set ERL_LIBS in ejabberdctl.template'
-
-	# https://github.com/processone/ejabberd/commit/58110e4bc152100078dbc0cb66d4a5257ae645e0,
-	# bug #651932, drop in next version
-	sed -i -e 's/REQUIRE_ERLANG_MAX="9.0.0 (No Max)"/REQUIRE_ERLANG_MAX="100.0.0 (No Max)"/' configure.ac || die
-	eautoreconf
-}
-
-src_configure() {
-	econf \
-		--docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
-		--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
-	fi
-
-	newconfd "${FILESDIR}/${PN}.confd" "${PN}"
-	newinitd "${FILESDIR}/${PN}.initd" "${PN}"
-	systemd_dounit "${PN}.service"
-	systemd_dotmpfilesd "${FILESDIR}/${PN}.tmpfiles.conf"
-
-	insinto /etc/logrotate.d
-	newins "${FILESDIR}/${PN}.logrotate" "${PN}"
-}
-
-pkg_postinst() {
-	if [[ ! ${REPLACING_VERSIONS} ]]; then
-		echo
-		elog "For configuration instructions, please see"
-		elog "  https://docs.ejabberd.im/"
-		echo
-		if [[ " ${REPLACING_VERSIONS} " =~ \ 2\. ]]; then
-			ewarn "If you have used pubsub in ejabberd-2.* you may encounter issues after"
-			ewarn "migration to ${PV}. pubsub data may not be migrated automatically and"
-			ewarn "you may need to run migration script manually, see:"
-			ewarn
-			ewarn "  https://github.com/processone/ejabberd/issues/479#issuecomment-124497456"
-			ewarn
-			ewarn "In case you don't care about all stored moods, activities, geoinfo and you"
-			ewarn "know you don't store in pubsub anything important, you can just remove"
-			ewarn "pubsub tables:"
-			ewarn
-			ewarn "  rm ${EROOT%/}${JABBER_SPOOL}/pubsub_*"
-			ewarn
-			ewarn "See also: https://bugs.gentoo.org/show_bug.cgi?id=588244"
-			echo
-		fi
-	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 ! ejabberd_cert_exists; then
-		ejabberd_cert_install
-	fi
-
-	if ! use nls && is_mod_irc_enabled; then
-		ewarn "nls support (dev-erlang/iconv) is required by mod_irc. Either rebuild ejabberd"
-		ewarn "with nls enabled or disable mod_irc in ${EROOT%/}${JABBER_ETC}/ejabberd.yml."
-	fi
-}

diff --git a/net-im/ejabberd/ejabberd-20.03.ebuild b/net-im/ejabberd/ejabberd-20.03.ebuild
deleted file mode 100644
index 7ed076748bb..00000000000
--- a/net-im/ejabberd/ejabberd-20.03.ebuild
+++ /dev/null
@@ -1,292 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-SSL_CERT_MANDATORY=1
-
-inherit eutils pam rebar ssl-cert systemd
-
-DESCRIPTION="Robust, scalable and extensible XMPP server"
-HOMEPAGE="https://www.ejabberd.im/ https://github.com/processone/ejabberd/"
-SRC_URI="https://static.process-one.net/${PN}/downloads/${PV}/${P}.tgz
-	-> ${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64"
-REQUIRED_USE="mssql? ( odbc )"
-# TODO: Add 'tools' flag.
-IUSE="captcha debug full-xml hipe ldap mssql mysql odbc pam postgres redis
-	roster-gw sip sqlite stun zlib"
-
-RESTRICT="test"
-
-# TODO: Add dependencies for 'tools' flag enabled.
-# TODO: tools? (
-# TODO:		>=dev-erlang/luerl-0.3
-# TODO: )
-DEPEND=">=dev-lang/erlang-19.3[hipe?,odbc?,ssl]
-	>=dev-erlang/cache_tab-1.0.22
-	>=dev-erlang/eimp-1.0.14
-	>=dev-erlang/fast_tls-1.1.4
-	>=dev-erlang/fast_xml-1.1.39
-	>=dev-erlang/fast_yaml-1.0.24
-	>=dev-erlang/yconf-1.0.4
-	>=dev-erlang/jiffy-1.0.1
-	>=dev-erlang/jose-1.9.0
-	>=dev-erlang/lager-3.6.10
-	>=dev-erlang/p1_oauth2-0.6.6
-	>=dev-erlang/p1_utils-1.0.18
-	>=dev-erlang/stringprep-1.0.19
-	>=dev-erlang/xmpp-1.4.5
-	>=dev-erlang/pkix-1.0.5
-	>=dev-erlang/mqtree-1.0.7
-	>=dev-erlang/idna-6.0.0
-	>=dev-erlang/p1_acme-1.0.5
-	>=dev-erlang/base64url-1.0
-	>=net-im/jabber-base-0.01
-	ldap? ( =net-nds/openldap-2* )
-	mysql? ( >=dev-erlang/p1_mysql-1.0.14 )
-	odbc? ( dev-db/unixODBC )
-	pam? ( >=dev-erlang/epam-1.0.7 )
-	postgres? ( >=dev-erlang/p1_pgsql-1.1.9 )
-	redis? ( >=dev-erlang/eredis-1.0.8 )
-	sip? ( >=dev-erlang/esip-1.0.32 )
-	sqlite? ( >=dev-erlang/sqlite3-1.1.6 )
-	stun? ( >=dev-erlang/stun-1.0.31 )
-	zlib? ( >=dev-erlang/ezlib-1.0.7 )"
-RDEPEND="${DEPEND}
-	captcha? ( media-gfx/imagemagick[truetype,png] )"
-
-DOCS=( CHANGELOG.md README.md )
-PATCHES=( "${FILESDIR}/${PN}-19.08-ejabberdctl.patch"
-	"${FILESDIR}/${PN}-17.04-0002-Dont-overwrite-service-file.patch")
-
-EJABBERD_CERT="${EPREFIX}/etc/ssl/ejabberd/server.pem"
-# 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 certificate.
-adjust_config() {
-	sed -rne "/^#?\s+certfiles:/{p;a\  - ${EJABBERD_CERT}" -e ":a;n;/^#?\s+-/ba};p" \
-		-i "${S}/ejabberd.yml.example" \
-		|| die 'failed to adjust example config'
-	sed -re 's/^#\s+(certfiles)/\1/' \
-		-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'
-}
-
-# 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'
-}
-
-# Check if we are missing a default certificate.
-ejabberd_cert_missing() {
-	if grep -qs "^\s\+- ${EJABBERD_CERT}" "${EROOT%/}${JABBER_ETC}/ejabberd.yml"; then
-		if [[ -f "${EROOT%/}${EJABBERD_CERT}" ]]; then
-			# default certificate is present in config and exists - not installing
-			return 1
-		else
-			# default certificate is present in config
-			# but doesn't exist - need to install one
-			return 0
-		fi
-	fi
-	# no default certificate in config - not installing
-	return 1
-}
-
-# Generate and install sample ejabberd certificate. It's installed into
-# EJABBERD_CERT path.
-ejabberd_cert_install() {
-	SSL_ORGANIZATION="${SSL_ORGANIZATION:-ejabberd XMPP Server}"
-	install_cert "${EJABBERD_CERT%.*}"
-	chown root:jabber "${EROOT%/}${EJABBERD_CERT}" || die
-	chmod 0440 "${EROOT%/}${EJABBERD_CERT}" || die
-}
-
-# Get path to ejabberd lib directory.
-#
-# This is the path ./configure script Base for this path is path set in
-# ./configure script which is /usr/lib by default. If libdir is explicitely set
-# to something else than this should be adjusted here as well.
-get_ejabberd_path() {
-	echo "/usr/$(get_libdir)/${P}"
-}
-
-# Make ejabberd.service for systemd from upstream provided template.
-make_ejabberd_service() {
-	sed -r \
-		-e 's!@ctlscriptpath@!/usr/sbin!g' \
-		-e 's!^(User|Group)=(.*)!\1=jabber!' \
-		-e 's!^(After)=(.*)!\1=epmd.service network.target!' \
-		-e '/^After=/ a Requires=epmd.service' \
-		"${PN}.service.template" >"${PN}.service" \
-		|| die 'failed to make ejabberd.service'
-}
-
-# 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'
-}
-
-src_prepare() {
-	default
-
-	rebar_remove_deps
-	correct_ejabberd_paths
-	set_jabberbase_paths
-	make_ejabberd_service
-	skip_docs
-	adjust_config
-	customize_epam_wrapper "${FILESDIR}/epam-wrapper"
-
-	rebar_fix_include_path fast_xml
-	rebar_fix_include_path p1_utils
-	rebar_fix_include_path xmpp
-
-	# Fix bug #591862. ERL_LIBS should point directly to ejabberd directory
-	# rather than its parent which is default. That way ejabberd directory
-	# takes precedence is module lookup.
-	local ejabberd_erl_libs="$(get_ejabberd_path):$(get_erl_libs)"
-	sed -e "s|\(ERL_LIBS=\){{libdir}}.*|\1${ejabberd_erl_libs}|" \
-		-i "${S}/ejabberdctl.template" \
-		|| die 'failed to set ERL_LIBS in ejabberdctl.template'
-
-	sed -e "s|\(AC_INIT(ejabberd, \)m4_esyscmd([^)]*)|\1[$PV]|" \
-		-i configure.ac || die "Failed to write correct version to configure"
-	# eautoreconf # required in case of download from github
-}
-
-src_configure() {
-	econf \
-		--docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
-		--enable-user=jabber \
-		--disable-system-deps \
-		$(use_enable debug) \
-		$(use_enable full-xml) \
-		$(use_enable hipe) \
-		$(use_enable mssql) \
-		$(use_enable mysql) \
-		$(use_enable odbc) \
-		$(use_enable pam) \
-		$(use_enable postgres pgsql) \
-		$(use_enable redis) \
-		$(use_enable roster-gw roster-gateway-workaround) \
-		$(use_enable sqlite) \
-		$(use_enable sip) \
-		$(use_enable stun) \
-		$(use_enable zlib)
-
-	# more options to support
-	# --enable-elixir requires https://github.com/elixir-lang/elixir
-}
-
-src_compile() {
-	emake REBAR='rebar -v' src
-}
-
-src_install() {
-	default
-
-	keepdir /var/lib/lock/ejabberdctl
-	rm -rf "${ED%/}/var/log" || die
-	rm -rf "${ED%/}/var/spool" || die
-
-	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
-	fi
-
-	newconfd "${FILESDIR}/${PN}.confd" "${PN}"
-	newinitd "${FILESDIR}/${PN}.initd" "${PN}"
-	systemd_dounit "${PN}.service"
-	systemd_dotmpfilesd "${FILESDIR}/${PN}.tmpfiles.conf"
-
-	insinto /etc/logrotate.d
-	newins "${FILESDIR}/${PN}.logrotate" "${PN}"
-}
-
-pkg_preinst() {
-	if use pam; then
-		einfo "Adding jabber user to epam group to allow ejabberd to use PAM" \
-			"authentication"
-		# See
-		# <https://docs.ejabberd.im/admin/configuration/#pam-authentication>.
-		# epam binary is installed by dev-erlang/epam package, therefore SUID
-		# is set by that package. Instead of jabber group it uses epam group,
-		# therefore we need to add jabber user to epam group.
-		usermod -a -G epam jabber || die
-	fi
-}
-
-pkg_postinst() {
-	if [[ ! ${REPLACING_VERSIONS} ]]; then
-		echo
-		elog "For configuration instructions, please see"
-		elog "  https://docs.ejabberd.im/"
-		echo
-	fi
-	if [[ " ${REPLACING_VERSIONS} " =~ \ 17\. ]]; then
-		ewarn If you are updating from an older version like 17.x
-		ewarn you may need to add an access_rules section to your
-		ewarn ejabberd.yml config file.
-		ewarn Otherwise authentication will be broken and users
-		ewarn will not be able to log in.
-		echo
-	fi
-
-	if ejabberd_cert_missing; then
-		ejabberd_cert_install
-	fi
-}

diff --git a/net-im/ejabberd/files/ejabberd-17.04-0001-Don-t-configure-or-compile-deps.patch b/net-im/ejabberd/files/ejabberd-17.04-0001-Don-t-configure-or-compile-deps.patch
deleted file mode 100644
index 0a42f549b58..00000000000
--- a/net-im/ejabberd/files/ejabberd-17.04-0001-Don-t-configure-or-compile-deps.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 4086249e78cde107df84e6ad022e9d9821cecc40 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
-Date: Sun, 28 May 2017 14:22:08 +0100
-Subject: [PATCH] Don't configure or compile deps
-
----
- rebar.config.script | 23 -----------------------
- 1 file changed, 23 deletions(-)
-
-diff --git a/rebar.config.script b/rebar.config.script
-index 19142b9e..04f8b310 100644
---- a/rebar.config.script
-+++ b/rebar.config.script
-@@ -242,27 +242,6 @@ CtParams = fun(CompileOpts) ->
- 		    TestConfig]
- 	   end,
- 
--GenDepConfigureLine =
--fun(DepPath, Flags) ->
--	["sh -c 'if test ! -f ",DepPath,"config.status -o ",
--	 "config.status -nt ",DepPath,"config.status; ",
--	 "then (cd ", DepPath, " && ",
--	 "CFLAGS=\"", CFlags,"\" ",
--	 "CPPFLAGS=\"", CPPFlags, "\" "
--	 "LDFLAGS=\"", LDFlags, "\"",
--	 " ./configure ", string:join(Flags, " "),
--	 "); fi'"]
--end,
--
--GenDepsConfigure =
--fun(Hooks) ->
--	lists:map(fun({Pkg, Flags}) ->
--			  DepPath = ResolveDepPath("deps/" ++ Pkg ++ "/"),
--			  {'compile',
--			   lists:flatten(GenDepConfigureLine(DepPath, Flags))}
--		  end, Hooks)
--end,
--
- ProcessErlOpt = fun(Vals) ->
- 			lists:map(
- 			  fun({i, Path}) ->
-@@ -315,8 +294,6 @@ Rules = [
- 	  AppendList([{coveralls, ".*", {git, "https://github.com/markusn/coveralls-erl.git", "master"}}]), []},
- 	 {[post_hooks], [cover_enabled], os:getenv("TRAVIS") == "true",
- 	  AppendList2(TravisPostHooks), [], false},
--	 {[pre_hooks], [post_hook_configure], true,
--	  AppendList2(GenDepsConfigure), [], []},
- 	 {[ct_extra_params], [eunit_compile_opts], true,
- 	  AppendStr2(CtParams), "", []},
- 	 {[erl_opts], true,
--- 
-2.12.2
-

diff --git a/net-im/ejabberd/files/ejabberd-17.04-ejabberdctl.patch b/net-im/ejabberd/files/ejabberd-17.04-ejabberdctl.patch
deleted file mode 100644
index 6001c651f5d..00000000000
--- a/net-im/ejabberd/files/ejabberd-17.04-ejabberdctl.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 185923a3c5f11c2d29599416a52b6594bc94d8c9 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
-Date: Mon, 29 Aug 2016 22:29:41 +0100
-Subject: [PATCH] Adjust ejabberdctl for Gentoo jabberbase setup
-
-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.
----
- ejabberdctl.template | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/ejabberdctl.template b/ejabberdctl.template
-index 5b34ebe..3c080fd 100755
---- a/ejabberdctl.template
-+++ b/ejabberdctl.template
-@@ -16,6 +16,7 @@ IEX={{bindir}}/iex
- EPMD={{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 @@ if [ "$INSTALLUSER" != "" ] ; then
-     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
-@@ -91,6 +92,7 @@ EJABBERD_LOG_PATH=$LOGS_DIR/ejabberd.log
- 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"
-@@ -149,6 +151,8 @@ export ERL_MAX_ETS_TABLES
- export CONTRIB_MODULES_PATH
- export CONTRIB_MODULES_CONF_DIR
- export ERL_LIBS
-+export HOME
-+export SHELL
- 
- shell_escape_str()
- {
--- 
-2.9.2
-

diff --git a/net-im/ejabberd/metadata.xml b/net-im/ejabberd/metadata.xml
index ecd307a3a00..b81bfc19a41 100644
--- a/net-im/ejabberd/metadata.xml
+++ b/net-im/ejabberd/metadata.xml
@@ -16,12 +16,9 @@
 		<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="sip">Enable SIP support</flag>


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-im/ejabberd/, net-im/ejabberd/files/
@ 2022-03-23  8:33 Florian Schmaus
  0 siblings, 0 replies; 9+ messages in thread
From: Florian Schmaus @ 2022-03-23  8:33 UTC (permalink / raw
  To: gentoo-commits

commit:     ac7fd9583afe227c0efa9ff882617574e8f41592
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 23 08:20:51 2022 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Wed Mar 23 08:33:50 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac7fd958

net-im/ejabberd: drop 20.04, 21.04, 21.04-r2

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 net-im/ejabberd/Manifest                           |   2 -
 net-im/ejabberd/ejabberd-20.04.ebuild              | 294 ---------------------
 net-im/ejabberd/ejabberd-21.04-r2.ebuild           | 245 -----------------
 net-im/ejabberd/ejabberd-21.04.ebuild              | 275 -------------------
 ...rd-17.04-0002-Dont-overwrite-service-file.patch |  15 --
 net-im/ejabberd/files/ejabberd.tmpfiles.conf       |   2 -
 net-im/ejabberd/metadata.xml                       |   1 -
 7 files changed, 834 deletions(-)

diff --git a/net-im/ejabberd/Manifest b/net-im/ejabberd/Manifest
index 9ed7f914b758..4507c95a647f 100644
--- a/net-im/ejabberd/Manifest
+++ b/net-im/ejabberd/Manifest
@@ -1,4 +1,2 @@
-DIST ejabberd-20.04.tar.gz 2022319 BLAKE2B 02ce782bc58a808f38dff58715204059c51762187abff7f5c77ff08eb13330b66485234eb2204c4336770d75303417ee74077466a07e701aa512158ff641a578 SHA512 7c478bbd73577e06f21e26804f4eb57deb52a0ebdd12e45034e810314cb73bb2ec60b55c6f266271eb45d5ebc135a39c498a29706d6d1f5087fd2b509a8844ca
-DIST ejabberd-21.04.tar.gz 1560934 BLAKE2B 85e7a381b9fdb1274b8aff04ba98587d31aaba6e0c99b0bd5b8ad28f776a7e6dfd8c4425f57591962e69387d42e3416855fa94e914638352af1853f81e88315e SHA512 4f7f645dbca35187c412e75fe90bcb96b87fc71beb073e0b913155e78832499f57218b1c42e0adf139a24cf1e235b4d1d123214a472aabf093a65f5d136b9579
 DIST ejabberd-21.12.tar.gz 2532288 BLAKE2B 847fa90ce0140c384add489a97d566e3edf9927f71c4abf4f51869f2e0ba4a5183002cb5e4f7a9d7f4ad5ed5902a47b2dd336ab1ef854673a3a2f337326a3fc2 SHA512 4f1e56becb9970355b98c0ad177ee162130346e53aa92c274e502fe300d6f4dc7fda8fcca845821087da78379a19a2962b50794b71d139c91764539fcfeec73c
 DIST ejabberd-21.12.tar.gz.asc 195 BLAKE2B 6e2b409dd6e5eb24890b0ecaa58019cb1cfcfef78eddedb5fe4436ba72f15c1525ba6f254d24b6a11b84c2360d67d93036f47007cf6af9c3475fefbd10f48093 SHA512 81d838b35d1ea54205187d4c74fb2232b18466e562bce01ed6287aa17b80c5b287041d456a7fda9de4791eb635c102c25b19a9b26d794723cd9d36c740513bc1

diff --git a/net-im/ejabberd/ejabberd-20.04.ebuild b/net-im/ejabberd/ejabberd-20.04.ebuild
deleted file mode 100644
index 90c657f64b01..000000000000
--- a/net-im/ejabberd/ejabberd-20.04.ebuild
+++ /dev/null
@@ -1,294 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-SSL_CERT_MANDATORY=1
-
-inherit eutils pam rebar ssl-cert systemd tmpfiles
-
-DESCRIPTION="Robust, scalable and extensible XMPP server"
-HOMEPAGE="https://www.ejabberd.im/ https://github.com/processone/ejabberd/"
-SRC_URI="https://static.process-one.net/${PN}/downloads/${PV}/${P}.tgz
-	-> ${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64 ~arm ~ia64 ~sparc x86"
-REQUIRED_USE="mssql? ( odbc )"
-# TODO: Add 'tools' flag.
-IUSE="captcha debug full-xml hipe ldap mssql mysql odbc pam postgres redis
-	roster-gw sip sqlite +stun zlib"
-
-RESTRICT="test"
-
-# TODO: Add dependencies for 'tools' flag enabled.
-# TODO: tools? (
-# TODO:		>=dev-erlang/luerl-0.3
-# TODO: )
-DEPEND=">=dev-lang/erlang-19.3[hipe(-)?,odbc?,ssl]
-	>=dev-erlang/cache_tab-1.0.22
-	>=dev-erlang/eimp-1.0.14
-	>=dev-erlang/fast_tls-1.1.5
-	>=dev-erlang/fast_xml-1.1.40
-	>=dev-erlang/fast_yaml-1.0.24
-	>=dev-erlang/yconf-1.0.4
-	>=dev-erlang/jiffy-1.0.1
-	>=dev-erlang/jose-1.9.0
-	>=dev-erlang/lager-3.6.10
-	>=dev-erlang/p1_oauth2-0.6.6
-	>=dev-erlang/p1_utils-1.0.18
-	>=dev-erlang/stringprep-1.0.19
-	>=dev-erlang/xmpp-1.4.6
-	>=dev-erlang/pkix-1.0.5
-	>=dev-erlang/mqtree-1.0.7
-	>=dev-erlang/idna-6.0.0
-	>=dev-erlang/p1_acme-1.0.5
-	>=dev-erlang/base64url-1.0
-	>=net-im/jabber-base-0.01
-	ldap? ( =net-nds/openldap-2* )
-	mysql? ( >=dev-erlang/p1_mysql-1.0.14 )
-	odbc? ( dev-db/unixODBC )
-	pam? ( >=dev-erlang/epam-1.0.7 )
-	postgres? ( >=dev-erlang/p1_pgsql-1.1.9 )
-	redis? ( >=dev-erlang/eredis-1.0.8 )
-	sip? ( >=dev-erlang/esip-1.0.32 )
-	sqlite? ( >=dev-erlang/sqlite3-1.1.6 )
-	stun? ( >=dev-erlang/stun-1.0.32 )
-	zlib? ( >=dev-erlang/ezlib-1.0.7 )"
-RDEPEND="${DEPEND}
-	captcha? ( media-gfx/imagemagick[truetype,png] )"
-
-DOCS=( CHANGELOG.md README.md )
-PATCHES=( "${FILESDIR}/${PN}-19.08-ejabberdctl.patch"
-	"${FILESDIR}/${PN}-17.04-0002-Dont-overwrite-service-file.patch")
-
-EJABBERD_CERT="${EPREFIX}/etc/ssl/ejabberd/server.pem"
-# 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 certificate.
-adjust_config() {
-	sed -rne "/^#?\s+certfiles:/{p;a\  - ${EJABBERD_CERT}" -e ":a;n;/^#?\s+-/ba};p" \
-		-i "${S}/ejabberd.yml.example" \
-		|| die 'failed to adjust example config'
-	sed -re 's/^#\s+(certfiles)/\1/' \
-		-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'
-}
-
-# 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'
-}
-
-# Check if we are missing a default certificate.
-ejabberd_cert_missing() {
-	if grep -qs "^\s\+- ${EJABBERD_CERT}" "${EROOT%/}${JABBER_ETC}/ejabberd.yml"; then
-		if [[ -f "${EROOT%/}${EJABBERD_CERT}" ]]; then
-			# default certificate is present in config and exists - not installing
-			return 1
-		else
-			# default certificate is present in config
-			# but doesn't exist - need to install one
-			return 0
-		fi
-	fi
-	# no default certificate in config - not installing
-	return 1
-}
-
-# Generate and install sample ejabberd certificate. It's installed into
-# EJABBERD_CERT path.
-ejabberd_cert_install() {
-	SSL_ORGANIZATION="${SSL_ORGANIZATION:-ejabberd XMPP Server}"
-	install_cert "${EJABBERD_CERT%.*}"
-	chown root:jabber "${EROOT%/}${EJABBERD_CERT}" || die
-	chmod 0440 "${EROOT%/}${EJABBERD_CERT}" || die
-}
-
-# Get path to ejabberd lib directory.
-#
-# This is the path ./configure script Base for this path is path set in
-# ./configure script which is /usr/lib by default. If libdir is explicitely set
-# to something else than this should be adjusted here as well.
-get_ejabberd_path() {
-	echo "/usr/$(get_libdir)/${P}"
-}
-
-# Make ejabberd.service for systemd from upstream provided template.
-make_ejabberd_service() {
-	sed -r \
-		-e 's!@ctlscriptpath@!/usr/sbin!g' \
-		-e 's!^(User|Group)=(.*)!\1=jabber!' \
-		-e 's!^(After)=(.*)!\1=epmd.service network.target!' \
-		-e '/^After=/ a Requires=epmd.service' \
-		"${PN}.service.template" >"${PN}.service" \
-		|| die 'failed to make ejabberd.service'
-}
-
-# 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'
-}
-
-src_prepare() {
-	default
-
-	rebar_remove_deps
-	correct_ejabberd_paths
-	set_jabberbase_paths
-	make_ejabberd_service
-	skip_docs
-	adjust_config
-	customize_epam_wrapper "${FILESDIR}/epam-wrapper"
-
-	rebar_fix_include_path fast_xml
-	rebar_fix_include_path p1_utils
-	rebar_fix_include_path xmpp
-
-	# Fix bug #591862. ERL_LIBS should point directly to ejabberd directory
-	# rather than its parent which is default. That way ejabberd directory
-	# takes precedence is module lookup.
-	local ejabberd_erl_libs="$(get_ejabberd_path):$(get_erl_libs)"
-	sed -e "s|\(ERL_LIBS=\){{libdir}}.*|\1${ejabberd_erl_libs}|" \
-		-i "${S}/ejabberdctl.template" \
-		|| die 'failed to set ERL_LIBS in ejabberdctl.template'
-
-	sed -e "s|\(AC_INIT(ejabberd, \)m4_esyscmd([^)]*)|\1[$PV]|" \
-		-i configure.ac || die "Failed to write correct version to configure"
-	# eautoreconf # required in case of download from github
-}
-
-src_configure() {
-	econf \
-		--docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
-		--enable-user=jabber \
-		--disable-system-deps \
-		$(use_enable debug) \
-		$(use_enable full-xml) \
-		$(use_enable hipe) \
-		$(use_enable mssql) \
-		$(use_enable mysql) \
-		$(use_enable odbc) \
-		$(use_enable pam) \
-		$(use_enable postgres pgsql) \
-		$(use_enable redis) \
-		$(use_enable roster-gw roster-gateway-workaround) \
-		$(use_enable sqlite) \
-		$(use_enable sip) \
-		$(use_enable stun) \
-		$(use_enable zlib)
-
-	# more options to support
-	# --enable-elixir requires https://github.com/elixir-lang/elixir
-}
-
-src_compile() {
-	emake REBAR='rebar -v' src
-}
-
-src_install() {
-	default
-
-	keepdir /var/lib/lock/ejabberdctl
-	rm -rf "${ED%/}/var/log" || die
-	rm -rf "${ED%/}/var/spool" || die
-
-	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
-	fi
-
-	newconfd "${FILESDIR}/${PN}.confd" "${PN}"
-	newinitd "${FILESDIR}/${PN}.initd" "${PN}"
-	systemd_dounit "${PN}.service"
-	dotmpfiles "${FILESDIR}/${PN}.tmpfiles.conf"
-
-	insinto /etc/logrotate.d
-	newins "${FILESDIR}/${PN}.logrotate" "${PN}"
-}
-
-pkg_preinst() {
-	if use pam; then
-		einfo "Adding jabber user to epam group to allow ejabberd to use PAM" \
-			"authentication"
-		# See
-		# <https://docs.ejabberd.im/admin/configuration/#pam-authentication>.
-		# epam binary is installed by dev-erlang/epam package, therefore SUID
-		# is set by that package. Instead of jabber group it uses epam group,
-		# therefore we need to add jabber user to epam group.
-		usermod -a -G epam jabber || die
-	fi
-}
-
-pkg_postinst() {
-	tmpfiles_process ${PN}.tmpfiles.conf
-
-	if [[ ! ${REPLACING_VERSIONS} ]]; then
-		echo
-		elog "For configuration instructions, please see"
-		elog "  https://docs.ejabberd.im/"
-		echo
-	fi
-	if [[ " ${REPLACING_VERSIONS} " =~ \ 17\. ]]; then
-		ewarn If you are updating from an older version like 17.x
-		ewarn you may need to add an access_rules section to your
-		ewarn ejabberd.yml config file.
-		ewarn Otherwise authentication will be broken and users
-		ewarn will not be able to log in.
-		echo
-	fi
-
-	if ejabberd_cert_missing; then
-		ejabberd_cert_install
-	fi
-}

diff --git a/net-im/ejabberd/ejabberd-21.04-r2.ebuild b/net-im/ejabberd/ejabberd-21.04-r2.ebuild
deleted file mode 100644
index d8911b3b288c..000000000000
--- a/net-im/ejabberd/ejabberd-21.04-r2.ebuild
+++ /dev/null
@@ -1,245 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit pam rebar systemd
-
-DESCRIPTION="Robust, scalable and extensible XMPP server"
-HOMEPAGE="https://www.ejabberd.im/ https://github.com/processone/ejabberd/"
-SRC_URI="https://static.process-one.net/${PN}/downloads/${PV}/${P}.tgz
-	-> ${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~ia64 ~sparc ~x86"
-REQUIRED_USE="mssql? ( odbc )"
-# TODO: Add 'tools' flag.
-IUSE="captcha debug full-xml ldap mssql mysql odbc pam postgres redis
-	roster-gw selinux sip sqlite +stun zlib"
-
-RESTRICT="test"
-
-# TODO: Add dependencies for 'tools' flag enabled.
-# TODO: tools? (
-# TODO:		>=dev-erlang/luerl-0.3
-# TODO: )
-DEPEND=">=dev-lang/erlang-19.3[odbc?,ssl]
-	>=dev-erlang/cache_tab-1.0.28
-	>=dev-erlang/eimp-1.0.20
-	>=dev-erlang/fast_tls-1.1.12
-	>=dev-erlang/fast_xml-1.1.46
-	>=dev-erlang/fast_yaml-1.0.31
-	>=dev-erlang/yconf-1.0.11
-	>=dev-erlang/jiffy-1.0.5
-	>=dev-erlang/jose-1.9.0
-	>=dev-erlang/lager-3.6.10
-	>=dev-erlang/p1_oauth2-0.6.9
-	>=dev-erlang/p1_utils-1.0.22
-	>=dev-erlang/stringprep-1.0.25
-	>=dev-erlang/xmpp-1.5.3
-	>=dev-erlang/pkix-1.0.7
-	>=dev-erlang/mqtree-1.0.13
-	>=dev-erlang/idna-6.0.0-r1
-	>=dev-erlang/p1_acme-1.0.12
-	>=dev-erlang/base64url-1.0.1
-	ldap? ( =net-nds/openldap-2* )
-	mysql? ( >=dev-erlang/p1_mysql-1.0.18 )
-	odbc? ( dev-db/unixODBC )
-	pam? ( >=dev-erlang/epam-1.0.10 )
-	postgres? ( >=dev-erlang/p1_pgsql-1.1.11 )
-	redis? ( >=dev-erlang/eredis-1.0.8 )
-	sip? ( >=dev-erlang/esip-1.0.42 )
-	sqlite? ( >=dev-erlang/sqlite3-1.1.12 )
-	stun? ( >=dev-erlang/stun-1.0.43 )
-	zlib? ( >=dev-erlang/ezlib-1.0.9 )"
-RDEPEND="${DEPEND}
-	acct-user/ejabberd
-	captcha? ( media-gfx/imagemagick[truetype,png] )
-	selinux? ( sec-policy/selinux-jabber )
-"
-
-DOCS=( CHANGELOG.md README.md )
-PATCHES=( "${FILESDIR}/${PN}-19.08-ejabberdctl.patch"
-	"${FILESDIR}/${PN}-17.04-0002-Dont-overwrite-service-file.patch")
-
-# 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'
-}
-
-# 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.
-#
-# This is the path ./configure script Base for this path is path set in
-# ./configure script which is /usr/lib by default. If libdir is explicitely set
-# to something else than this should be adjusted here as well.
-get_ejabberd_path() {
-	echo "/usr/$(get_libdir)/${P}"
-}
-
-# Make ejabberd.service for systemd from upstream provided template.
-make_ejabberd_service() {
-	sed -r \
-		-e 's!@ctlscriptpath@!/usr/sbin!g' \
-		-e 's!^(After)=(.*)!\1=epmd.service network.target!' \
-		-e '/^After=/ a Requires=epmd.service' \
-		"${PN}.service.template" >"${PN}.service" \
-		|| die 'failed to make ejabberd.service'
-}
-
-src_prepare() {
-	default
-
-	rebar_remove_deps
-	correct_ejabberd_paths
-	make_ejabberd_service
-	customize_epam_wrapper "${FILESDIR}/epam-wrapper"
-
-	rebar_fix_include_path fast_xml
-	rebar_fix_include_path p1_utils
-	rebar_fix_include_path xmpp
-
-	# Fix bug #591862. ERL_LIBS should point directly to ejabberd directory
-	# rather than its parent which is default. That way ejabberd directory
-	# takes precedence is module lookup.
-	local ejabberd_erl_libs="$(get_ejabberd_path):$(get_erl_libs)"
-	sed -e "s|\(ERL_LIBS=\){{libdir}}.*|\1${ejabberd_erl_libs}|" \
-		-i "${S}/ejabberdctl.template" \
-		|| die 'failed to set ERL_LIBS in ejabberdctl.template'
-}
-
-src_configure() {
-	econf \
-		--docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
-		--localstatedir="${EPREFIX}/var" \
-		--enable-user=${PN} \
-		$(use_enable debug) \
-		$(use_enable full-xml) \
-		$(use_enable mssql) \
-		$(use_enable mysql) \
-		$(use_enable odbc) \
-		$(use_enable pam) \
-		$(use_enable postgres pgsql) \
-		$(use_enable redis) \
-		$(use_enable roster-gw roster-gateway-workaround) \
-		$(use_enable sqlite) \
-		$(use_enable sip) \
-		$(use_enable stun) \
-		$(use_enable zlib)
-
-	# more options to support
-	# --enable-elixir requires https://github.com/elixir-lang/elixir
-}
-
-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
-		into "$(get_ejabberd_path)/priv"
-		newbin epam-wrapper epam
-	fi
-
-	newconfd "${FILESDIR}/${PN}.confd" "${PN}"
-	newinitd "${FILESDIR}/${PN}.initd" "${PN}"
-	systemd_dounit "${PN}.service"
-
-	insinto /etc/logrotate.d
-	newins "${FILESDIR}/${PN}.logrotate" "${PN}"
-
-	# /var/lock/ejabberdctl is unused, see
-	# https://github.com/processone/ejabberd/pull/3724
-	rmdir "${ED}/var/lock/ejabberdctl" || die
-	rmdir "${ED}/var/lock" || die
-
-	keepdir /var/{lib,log}/ejabberd
-}
-
-pkg_preinst() {
-	if use pam; then
-		einfo "Adding ejabberd user to epam group to allow ejabberd to use PAM" \
-			"authentication"
-		# See
-		# <https://docs.ejabberd.im/admin/configuration/#pam-authentication>.
-		# epam binary is installed by dev-erlang/epam package, therefore SUID
-		# is set by that package. Instead of jabber group it uses epam group,
-		# therefore we need to add jabber user to epam group.
-		usermod -a -G epam ejabberd || die
-	fi
-}
-
-pkg_postinst() {
-	local migrate_to_ejabberd_user=false
-
-	if [[ ! ${REPLACING_VERSIONS} ]]; then
-		echo
-		elog "For configuration instructions, please see"
-		elog "  https://docs.ejabberd.im/"
-		echo
-	else
-		for v in ${REPLACING_VERSIONS}; do
-			if ver_test "${v}" -lt 21.04-r1; then
-				migrate_to_ejabberd_user=true
-				break
-			fi
-		done
-	fi
-
-	# Sarting with >=21.04-r1, the ejabberd configuration is now in
-	# /etc/ejabberd and no longer in /etc/jabber. See if we need to
-	# migrate the configuration. Furthermore, ejabberd no longer runs
-	# under the, shared via net-im/jabber-base, 'jabber' use, but under
-	# its own user. This increase isolation and hence robustness and
-	# security.
-	if $migrate_to_ejabberd_user; then
-		local -A dirs_to_migrate=(
-			[/etc/jabber]=/etc/ejabberd
-			[/var/spool/jabber]=/var/lib/ejabberd
-		)
-
-		for src_dir in "${!dirs_to_migrate[@]}"; do
-			local eroot_src_dir="${EROOT}${src_dir}"
-			local eroot_dst_dir="${EROOT}${dirs_to_migrate[${src_dir}]}"
-
-			cp -r "${eroot_src_dir}"/. "${eroot_dst_dir}" || die "Could not copy ${eroot_src_dir} to ${eroot_dst_dir}"
-
-			if [[ -f "${eroot_dst_dir}"/.keep_net-im_jabber-base-0 ]]; then
-				rm "${eroot_dst_dir}"/.keep_net-im_jabber-base-0 || die
-			fi
-			if ! use prefix; then
-				chown --recursive ejabberd:ejabberd "${eroot_dst_dir}" || die
-			fi
-		done
-
-		ewarn "Newer versions of the ejabberd Gentoo package use /etc/ejabberd"
-		ewarn "(just as upstream) and *not* /etc/jabber."
-		ewarn "The files from /etc/jabber where copied to /etc/ejabberd."
-		ewarn "Also ejabberd's spool directory became /var/lib/ejabberd (was /var/spool/jabber)."
-		ewarn "Please check your configuration."
-	fi
-}

diff --git a/net-im/ejabberd/ejabberd-21.04.ebuild b/net-im/ejabberd/ejabberd-21.04.ebuild
deleted file mode 100644
index 245c006f1141..000000000000
--- a/net-im/ejabberd/ejabberd-21.04.ebuild
+++ /dev/null
@@ -1,275 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-SSL_CERT_MANDATORY=1
-
-inherit pam rebar ssl-cert systemd tmpfiles
-
-DESCRIPTION="Robust, scalable and extensible XMPP server"
-HOMEPAGE="https://www.ejabberd.im/ https://github.com/processone/ejabberd/"
-SRC_URI="https://static.process-one.net/${PN}/downloads/${PV}/${P}.tgz
-	-> ${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64 ~arm ~ia64 ~sparc x86"
-REQUIRED_USE="mssql? ( odbc )"
-# TODO: Add 'tools' flag.
-IUSE="captcha debug full-xml ldap mssql mysql odbc pam postgres redis
-	roster-gw selinux sip sqlite +stun zlib"
-
-RESTRICT="test"
-
-# TODO: Add dependencies for 'tools' flag enabled.
-# TODO: tools? (
-# TODO:		>=dev-erlang/luerl-0.3
-# TODO: )
-DEPEND=">=dev-lang/erlang-19.3[odbc?,ssl]
-	>=dev-erlang/cache_tab-1.0.28
-	>=dev-erlang/eimp-1.0.20
-	>=dev-erlang/fast_tls-1.1.12
-	>=dev-erlang/fast_xml-1.1.46
-	>=dev-erlang/fast_yaml-1.0.31
-	>=dev-erlang/yconf-1.0.11
-	>=dev-erlang/jiffy-1.0.5
-	>=dev-erlang/jose-1.9.0
-	>=dev-erlang/lager-3.6.10
-	>=dev-erlang/p1_oauth2-0.6.9
-	>=dev-erlang/p1_utils-1.0.22
-	>=dev-erlang/stringprep-1.0.25
-	>=dev-erlang/xmpp-1.5.3
-	>=dev-erlang/pkix-1.0.7
-	>=dev-erlang/mqtree-1.0.13
-	>=dev-erlang/idna-6.0.0-r1
-	>=dev-erlang/p1_acme-1.0.12
-	>=dev-erlang/base64url-1.0.1
-	>=net-im/jabber-base-0.01
-	ldap? ( =net-nds/openldap-2* )
-	mysql? ( >=dev-erlang/p1_mysql-1.0.18 )
-	odbc? ( dev-db/unixODBC )
-	pam? ( >=dev-erlang/epam-1.0.10 )
-	postgres? ( >=dev-erlang/p1_pgsql-1.1.11 )
-	redis? ( >=dev-erlang/eredis-1.0.8 )
-	sip? ( >=dev-erlang/esip-1.0.42 )
-	sqlite? ( >=dev-erlang/sqlite3-1.1.12 )
-	stun? ( >=dev-erlang/stun-1.0.43 )
-	zlib? ( >=dev-erlang/ezlib-1.0.9 )"
-RDEPEND="${DEPEND}
-	captcha? ( media-gfx/imagemagick[truetype,png] )
-	selinux? ( sec-policy/selinux-jabber )
-"
-
-DOCS=( CHANGELOG.md README.md )
-PATCHES=( "${FILESDIR}/${PN}-19.08-ejabberdctl.patch"
-	"${FILESDIR}/${PN}-17.04-0002-Dont-overwrite-service-file.patch")
-
-EJABBERD_CERT="${EPREFIX}/etc/ssl/ejabberd/server.pem"
-# 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 certificate.
-adjust_config() {
-	sed -rne "/^#?\s+certfiles:/{p;a\  - ${EJABBERD_CERT}" -e ":a;n;/^#?\s+-/ba};p" \
-		-i "${S}/ejabberd.yml.example" \
-		|| die 'failed to adjust example config'
-	sed -re 's/^#\s+(certfiles)/\1/' \
-		-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'
-}
-
-# 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'
-}
-
-# Check if we are missing a default certificate.
-ejabberd_cert_missing() {
-	if grep -qs "^\s\+- ${EJABBERD_CERT}" "${EROOT%/}${JABBER_ETC}/ejabberd.yml"; then
-		if [[ -f "${EROOT%/}${EJABBERD_CERT}" ]]; then
-			# default certificate is present in config and exists - not installing
-			return 1
-		else
-			# default certificate is present in config
-			# but doesn't exist - need to install one
-			return 0
-		fi
-	fi
-	# no default certificate in config - not installing
-	return 1
-}
-
-# Generate and install sample ejabberd certificate. It's installed into
-# EJABBERD_CERT path.
-ejabberd_cert_install() {
-	SSL_ORGANIZATION="${SSL_ORGANIZATION:-ejabberd XMPP Server}"
-	install_cert "${EJABBERD_CERT%.*}"
-	chown root:jabber "${EROOT%/}${EJABBERD_CERT}" || die
-	chmod 0440 "${EROOT%/}${EJABBERD_CERT}" || die
-}
-
-# Get path to ejabberd lib directory.
-#
-# This is the path ./configure script Base for this path is path set in
-# ./configure script which is /usr/lib by default. If libdir is explicitely set
-# to something else than this should be adjusted here as well.
-get_ejabberd_path() {
-	echo "/usr/$(get_libdir)/${P}"
-}
-
-# Make ejabberd.service for systemd from upstream provided template.
-make_ejabberd_service() {
-	sed -r \
-		-e 's!@ctlscriptpath@!/usr/sbin!g' \
-		-e 's!^(User|Group)=(.*)!\1=jabber!' \
-		-e 's!^(After)=(.*)!\1=epmd.service network.target!' \
-		-e '/^After=/ a Requires=epmd.service' \
-		"${PN}.service.template" >"${PN}.service" \
-		|| die 'failed to make ejabberd.service'
-}
-
-# 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'
-}
-
-src_prepare() {
-	default
-
-	rebar_remove_deps
-	correct_ejabberd_paths
-	set_jabberbase_paths
-	make_ejabberd_service
-	adjust_config
-	customize_epam_wrapper "${FILESDIR}/epam-wrapper"
-
-	rebar_fix_include_path fast_xml
-	rebar_fix_include_path p1_utils
-	rebar_fix_include_path xmpp
-
-	# Fix bug #591862. ERL_LIBS should point directly to ejabberd directory
-	# rather than its parent which is default. That way ejabberd directory
-	# takes precedence is module lookup.
-	local ejabberd_erl_libs="$(get_ejabberd_path):$(get_erl_libs)"
-	sed -e "s|\(ERL_LIBS=\){{libdir}}.*|\1${ejabberd_erl_libs}|" \
-		-i "${S}/ejabberdctl.template" \
-		|| die 'failed to set ERL_LIBS in ejabberdctl.template'
-}
-
-src_configure() {
-	econf \
-		--docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
-		--enable-user=jabber \
-		$(use_enable debug) \
-		$(use_enable full-xml) \
-		$(use_enable mssql) \
-		$(use_enable mysql) \
-		$(use_enable odbc) \
-		$(use_enable pam) \
-		$(use_enable postgres pgsql) \
-		$(use_enable redis) \
-		$(use_enable roster-gw roster-gateway-workaround) \
-		$(use_enable sqlite) \
-		$(use_enable sip) \
-		$(use_enable stun) \
-		$(use_enable zlib)
-
-	# more options to support
-	# --enable-elixir requires https://github.com/elixir-lang/elixir
-}
-
-src_compile() {
-	emake REBAR='rebar -v' src
-}
-
-src_install() {
-	default
-
-	keepdir /var/lib/lock/ejabberdctl
-	rm -rf "${ED%/}/var/log" || die
-	rm -rf "${ED%/}/var/spool" || die
-
-	if use pam; then
-		local epam_path="$(get_ejabberd_path)/priv/bin/epam"
-
-		pamd_mimic_system xmpp auth account
-		into "$(get_ejabberd_path)/priv"
-		newbin epam-wrapper epam
-	fi
-
-	newconfd "${FILESDIR}/${PN}.confd" "${PN}"
-	newinitd "${FILESDIR}/${PN}.initd" "${PN}"
-	systemd_dounit "${PN}.service"
-	dotmpfiles "${FILESDIR}/${PN}.tmpfiles.conf"
-
-	insinto /etc/logrotate.d
-	newins "${FILESDIR}/${PN}.logrotate" "${PN}"
-}
-
-pkg_preinst() {
-	if use pam; then
-		einfo "Adding jabber user to epam group to allow ejabberd to use PAM" \
-			"authentication"
-		# See
-		# <https://docs.ejabberd.im/admin/configuration/#pam-authentication>.
-		# epam binary is installed by dev-erlang/epam package, therefore SUID
-		# is set by that package. Instead of jabber group it uses epam group,
-		# therefore we need to add jabber user to epam group.
-		usermod -a -G epam jabber || die
-	fi
-}
-
-pkg_postinst() {
-	tmpfiles_process ${PN}.tmpfiles.conf
-
-	if [[ ! ${REPLACING_VERSIONS} ]]; then
-		echo
-		elog "For configuration instructions, please see"
-		elog "  https://docs.ejabberd.im/"
-		echo
-	fi
-	if [[ " ${REPLACING_VERSIONS} " =~ \ 17\. ]]; then
-		ewarn If you are updating from an older version like 17.x
-		ewarn you may need to add an access_rules section to your
-		ewarn ejabberd.yml config file.
-		ewarn Otherwise authentication will be broken and users
-		ewarn will not be able to log in.
-		echo
-	fi
-
-	if ejabberd_cert_missing; then
-		ejabberd_cert_install
-	fi
-}

diff --git a/net-im/ejabberd/files/ejabberd-17.04-0002-Dont-overwrite-service-file.patch b/net-im/ejabberd/files/ejabberd-17.04-0002-Dont-overwrite-service-file.patch
deleted file mode 100644
index 2bea750ef04e..000000000000
--- a/net-im/ejabberd/files/ejabberd-17.04-0002-Dont-overwrite-service-file.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/Makefile.in b/Makefile.in
-index a0b4553d..4675b88a 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -204,8 +204,8 @@ install: all copy-files
- 	chmod 755 ejabberd.init
- 	#
- 	# Service script
--	$(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*g" ejabberd.service.template \
--		> ejabberd.service
-+	[ -f ejabberd.service ] || $(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*g" \
-+		ejabberd.service.template > ejabberd.service
- 	chmod 644 ejabberd.service
- 	#
- 	# Spool directory

diff --git a/net-im/ejabberd/files/ejabberd.tmpfiles.conf b/net-im/ejabberd/files/ejabberd.tmpfiles.conf
deleted file mode 100644
index 6a9cc9e61b7a..000000000000
--- a/net-im/ejabberd/files/ejabberd.tmpfiles.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-d /run/lock/ejabberdctl 0750 jabber jabber
-d /run/ejabberd 0750 jabber jabber

diff --git a/net-im/ejabberd/metadata.xml b/net-im/ejabberd/metadata.xml
index 787de61bb992..df085f63589b 100644
--- a/net-im/ejabberd/metadata.xml
+++ b/net-im/ejabberd/metadata.xml
@@ -12,7 +12,6 @@
 		<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>


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-im/ejabberd/, net-im/ejabberd/files/
@ 2022-05-17 20:02 Florian Schmaus
  0 siblings, 0 replies; 9+ messages in thread
From: Florian Schmaus @ 2022-05-17 20:02 UTC (permalink / raw
  To: gentoo-commits

commit:     c8d1e4560d3eff6e034ef1ef2e83ef37f4702510
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Tue May 17 18:46:36 2022 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Tue May 17 20:01:27 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c8d1e456

net-im/ejabberd: add 22.05

Fix bashism in OpenRC init script. Drop support for logrotate in favor
of ejabberd's built-in log rotation mechanism.

Also depend on >=acct-user/ejabberd-1, which will create the ejabberd
with HOME set to /var/lib/ejabberd, i.e., ejabberd's spool
directory. This allows us to drop ${PN}-19.08-ejabberdctl.patch.

Closes: https://bugs.gentoo.org/841976
Closes: https://github.com/gentoo/gentoo/pull/25540
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 net-im/ejabberd/Manifest                   |   2 +
 net-im/ejabberd/ejabberd-22.05.ebuild      | 232 +++++++++++++++++++++++++++++
 net-im/ejabberd/files/ejabberd-22.05.initd |  54 +++++++
 3 files changed, 288 insertions(+)

diff --git a/net-im/ejabberd/Manifest b/net-im/ejabberd/Manifest
index 4507c95a647f..e8815deaf151 100644
--- a/net-im/ejabberd/Manifest
+++ b/net-im/ejabberd/Manifest
@@ -1,2 +1,4 @@
 DIST ejabberd-21.12.tar.gz 2532288 BLAKE2B 847fa90ce0140c384add489a97d566e3edf9927f71c4abf4f51869f2e0ba4a5183002cb5e4f7a9d7f4ad5ed5902a47b2dd336ab1ef854673a3a2f337326a3fc2 SHA512 4f1e56becb9970355b98c0ad177ee162130346e53aa92c274e502fe300d6f4dc7fda8fcca845821087da78379a19a2962b50794b71d139c91764539fcfeec73c
 DIST ejabberd-21.12.tar.gz.asc 195 BLAKE2B 6e2b409dd6e5eb24890b0ecaa58019cb1cfcfef78eddedb5fe4436ba72f15c1525ba6f254d24b6a11b84c2360d67d93036f47007cf6af9c3475fefbd10f48093 SHA512 81d838b35d1ea54205187d4c74fb2232b18466e562bce01ed6287aa17b80c5b287041d456a7fda9de4791eb635c102c25b19a9b26d794723cd9d36c740513bc1
+DIST ejabberd-22.05.tar.gz 2527957 BLAKE2B d7fc614b8fe88bc8997d78821334a5e26a4201a5d199e6a04fe668e192ed0c7a37b68aff2fd9c6740844634c005b492b1dd76de4b9ed841863d0285f6097edd9 SHA512 33f98a9c45ff8257d240e7b90181e399ecab84e361f5619dc8d57252642e81d4958467cfa89b90681f3cf0d1d56a3079eb98d4e80cc6af5ca11938bb2a69f865
+DIST ejabberd-22.05.tar.gz.asc 195 BLAKE2B 634cb0a338c68d8ee1d3b2e3e267a758deff3a925c93273c5aaa209d12a5bb40565831869cc7e81fa66de8648211eb60f9644ac7d4d0ec557e9332a8cdd9dfce SHA512 42ffc224915f3f0ac4df42cfe0c35e65861be38856e398ac6172cdcbf5de543ae808a4b201a1c1d64d10234d02d754d1376ff21ee9d679095497479c717c17da

diff --git a/net-im/ejabberd/ejabberd-22.05.ebuild b/net-im/ejabberd/ejabberd-22.05.ebuild
new file mode 100644
index 000000000000..029431d351cb
--- /dev/null
+++ b/net-im/ejabberd/ejabberd-22.05.ebuild
@@ -0,0 +1,232 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools pam rebar systemd verify-sig
+
+DESCRIPTION="Robust, scalable and extensible XMPP server"
+HOMEPAGE="https://www.ejabberd.im/ https://github.com/processone/ejabberd/"
+SRC_URI="
+	https://github.com/processone/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
+	verify-sig? ( https://github.com/processone/${PN}/releases/download/${PV}/${P}.tar.gz.asc )
+"
+VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/process-one.net.asc
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ia64 ~sparc ~x86"
+REQUIRED_USE="mssql? ( odbc )"
+# TODO: Add 'tools' flag.
+IUSE="captcha debug full-xml ldap mssql mysql odbc pam postgres redis
+	roster-gw selinux sip sqlite +stun zlib"
+
+RESTRICT="test"
+
+# TODO: Add dependencies for 'tools' flag enabled.
+# TODO: tools? (
+# TODO:		>=dev-erlang/luerl-0.3
+# TODO: )
+DEPEND="
+	>=dev-lang/erlang-19.3[odbc?,ssl]
+	>=dev-erlang/cache_tab-1.0.30
+	>=dev-erlang/eimp-1.0.22
+	>=dev-erlang/fast_tls-1.1.15
+	>=dev-erlang/fast_xml-1.1.49
+	>=dev-erlang/fast_yaml-1.0.33
+	>=dev-erlang/yconf-1.0.13
+	>=dev-erlang/jiffy-1.0.5
+	>=dev-erlang/jose-1.11.2
+	>=dev-erlang/lager-3.9.1
+	>=dev-erlang/p1_oauth2-0.6.11
+	>=dev-erlang/p1_utils-1.0.25
+	>=dev-erlang/stringprep-1.0.28
+	>=dev-erlang/xmpp-1.5.6
+	>=dev-erlang/pkix-1.0.9
+	>=dev-erlang/mqtree-1.0.15
+	>=dev-erlang/idna-6.0.0-r1
+	>=dev-erlang/p1_acme-1.0.19
+	>=dev-erlang/base64url-1.0.1
+	ldap? ( =net-nds/openldap-2* )
+	mysql? ( >=dev-erlang/p1_mysql-1.0.19 )
+	odbc? ( dev-db/unixODBC )
+	pam? ( >=dev-erlang/epam-1.0.12 )
+	postgres? ( >=dev-erlang/p1_pgsql-1.1.18 )
+	redis? ( >=dev-erlang/eredis-1.2.0 )
+	sip? ( >=dev-erlang/esip-1.0.45 )
+	sqlite? ( >=dev-erlang/sqlite3-1.1.13 )
+	stun? ( >=dev-erlang/stun-1.2.2 )
+	zlib? ( >=dev-erlang/ezlib-1.0.12 )
+"
+RDEPEND="
+	${DEPEND}
+	>=acct-user/ejabberd-1
+	captcha? ( media-gfx/imagemagick[truetype,png] )
+	selinux? ( sec-policy/selinux-jabber )
+"
+BDEPEND="verify-sig? ( sec-keys/openpgp-keys-processone )"
+
+DOCS=( CHANGELOG.md README.md )
+PATCHES=(
+	"${FILESDIR}/adjust-ejabberd.service.template-to-Gentoo.patch"
+)
+
+# Get path to ejabberd lib directory.
+#
+# This is the path ./configure script Base for this path is path set in
+# ./configure script which is /usr/lib by default. If libdir is explicitely set
+# to something else than this should be adjusted here as well.
+get_ejabberd_path() {
+	echo "/usr/$(get_libdir)/${P}"
+}
+
+src_prepare() {
+	default
+
+	eautoreconf
+
+	rebar_remove_deps
+
+	# Set paths to ejabberd lib directory consistently to point always to directory
+	# suffixed with version.
+	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'
+
+	# 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.
+	local epam_wrapper_src="${FILESDIR}/epam-wrapper"
+	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'
+
+	rebar_fix_include_path fast_xml
+	rebar_fix_include_path p1_utils
+	rebar_fix_include_path xmpp
+
+	# Fix bug #591862. ERL_LIBS should point directly to ejabberd directory
+	# rather than its parent which is default. That way ejabberd directory
+	# takes precedence is module lookup.
+	local ejabberd_erl_libs="$(get_ejabberd_path):$(get_erl_libs)"
+	sed -e "s|\(ERL_LIBS=\)'{{libdir}}'\.*|\1${ejabberd_erl_libs}|" \
+		-i "${S}/ejabberdctl.template" \
+		|| die 'failed to set ERL_LIBS in ejabberdctl.template'
+}
+
+src_configure() {
+	econf \
+		--docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
+		--localstatedir="${EPREFIX}/var" \
+		--enable-user=${PN} \
+		$(use_enable debug) \
+		$(use_enable full-xml) \
+		$(use_enable mssql) \
+		$(use_enable mysql) \
+		$(use_enable odbc) \
+		$(use_enable pam) \
+		$(use_enable postgres pgsql) \
+		$(use_enable redis) \
+		$(use_enable roster-gw roster-gateway-workaround) \
+		$(use_enable sqlite) \
+		$(use_enable sip) \
+		$(use_enable stun) \
+		$(use_enable zlib)
+
+	# more options to support
+	# --enable-elixir requires https://github.com/elixir-lang/elixir
+}
+
+src_compile() {
+	# Note that we also add ejabberdctl.example, which will be used by
+	# ejabberd's build system to create /usr/sbin/ejabberdctl, as
+	# target. Otherwise, ejabberdctl.example is due to be created by the
+	# 'install' target (as per upstream's Makefile.in). However when
+	# invoke the 'install' target (in src_install below), DESTDIR is
+	# set, which causes DESTDIR to scope into the ejabberdctl.example
+	# generation.
+	emake REBAR='rebar -v' src ejabberdctl.example
+}
+
+src_install() {
+	default
+
+	if use pam; then
+		local epam_path="$(get_ejabberd_path)/priv/bin/epam"
+
+		pamd_mimic_system xmpp auth account
+		into "$(get_ejabberd_path)/priv"
+		newbin epam-wrapper epam
+	fi
+
+	newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+	newinitd "${FILESDIR}/${PN}-22.05.initd" "${PN}"
+	systemd_dounit "${PN}.service"
+
+	keepdir /var/{lib,log}/ejabberd
+}
+
+pkg_preinst() {
+	if use pam; then
+		einfo "Adding ejabberd user to epam group to allow ejabberd to use PAM" \
+			"authentication"
+		# See
+		# <https://docs.ejabberd.im/admin/configuration/#pam-authentication>.
+		# epam binary is installed by dev-erlang/epam package, therefore SUID
+		# is set by that package. Instead of jabber group it uses epam group,
+		# therefore we need to add jabber user to epam group.
+		usermod -a -G epam ejabberd || die
+	fi
+}
+
+pkg_postinst() {
+	local migrate_to_ejabberd_user=false
+
+	if [[ ${REPLACING_VERSIONS} ]]; then
+		for v in ${REPLACING_VERSIONS}; do
+			if ver_test "${v}" -lt 21.04-r1; then
+				migrate_to_ejabberd_user=true
+				break
+			fi
+		done
+	fi
+
+	# Sarting with >=21.04-r1, the ejabberd configuration is now in
+	# /etc/ejabberd and no longer in /etc/jabber. See if we need to
+	# migrate the configuration. Furthermore, ejabberd no longer runs
+	# under the, shared via net-im/jabber-base, 'jabber' use, but under
+	# its own user. This increase isolation and hence robustness and
+	# security.
+	if $migrate_to_ejabberd_user; then
+		ewarn "Newer versions of the ejabberd Gentoo package use /etc/ejabberd"
+		ewarn "(just as upstream) and *not* /etc/jabber."
+		ewarn "The files from /etc/jabber will now be copied to /etc/ejabberd."
+		ewarn "Also ejabberd's spool directory became /var/lib/ejabberd (was /var/spool/jabber)."
+		ewarn "Please check your configuration, and finish the migration by stopping ejabberd"
+		ewarn "followed by rsync'ing /var/spool/jabber to /var/lib/ejabberd."
+
+		local -A dirs_to_migrate=(
+			[/etc/jabber]=/etc/ejabberd
+			[/var/spool/jabber]=/var/lib/ejabberd
+		)
+
+		for src_dir in "${!dirs_to_migrate[@]}"; do
+			local eroot_src_dir="${EROOT}${src_dir}"
+			local eroot_dst_dir="${EROOT}${dirs_to_migrate[${src_dir}]}"
+
+			cp -r "${eroot_src_dir}"/. "${eroot_dst_dir}" || die "Could not copy ${eroot_src_dir} to ${eroot_dst_dir}"
+
+			if [[ -f "${eroot_dst_dir}"/.keep_net-im_jabber-base-0 ]]; then
+				rm "${eroot_dst_dir}"/.keep_net-im_jabber-base-0 || die
+			fi
+			if ! use prefix; then
+				chown --recursive ejabberd:ejabberd "${eroot_dst_dir}" || die
+			fi
+		done
+	fi
+}

diff --git a/net-im/ejabberd/files/ejabberd-22.05.initd b/net-im/ejabberd/files/ejabberd-22.05.initd
new file mode 100644
index 000000000000..57f9cd5aa335
--- /dev/null
+++ b/net-im/ejabberd/files/ejabberd-22.05.initd
@@ -0,0 +1,54 @@
+#!/sbin/openrc-run
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="reload"
+
+depend() {
+	use dns
+	need epmd net
+	provide jabber-server
+}
+
+start() {
+	if ejabberdctl status >/dev/null 2>&1; then
+		ewarn "ejabberd is already started (manually?)."
+		return 0
+	fi
+	ebegin "Starting ejabberd"
+	/usr/sbin/ejabberdctl ${EJABBERDCTL_OPTS} start
+	eend $?
+}
+
+reload() {
+	ebegin "Reloading ejabberd configuration"
+	/usr/sbin/ejabberdctl ${EJABBERDCTL_OPTS} reload_config
+	eend $?
+}
+
+stop() {
+	ejabberdctl status >/dev/null 2>&1
+	if test $? = 3; then
+		ewarn "ejabberd is already stopped (manually?)."
+		return 0
+	fi
+	ebegin "Stopping ejabberd"
+	if /usr/sbin/ejabberdctl stop >/dev/null 2>&1; then
+		cnt=0
+		sleep 1
+		while ejabberdctl status >/dev/null 2>&1 || test $? = 1; do
+			echo .
+			cnt=`expr $cnt + 1`
+			if [ $cnt -ge 60 ] ; then
+				eend 1
+				break
+			fi
+			sleep 1
+		done
+		eend 0
+	else
+		eend 1
+		einfo "Please, run '/usr/sbin/ejabberdctl stop' to see what's going on."
+	fi
+	eend 0
+}


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-05-17 20:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-23  8:33 [gentoo-commits] repo/gentoo:master commit in: net-im/ejabberd/, net-im/ejabberd/files/ Florian Schmaus
  -- strict thread matches above, loose matches on Subject: below --
2022-05-17 20:02 Florian Schmaus
2020-08-23 10:42 Hanno Böck
2017-07-09 20:14 Amadeusz Piotr Żołnowski
2016-11-13 10:08 Amadeusz Piotr Żołnowski
2016-08-27 13:12 Amadeusz Piotr Żołnowski
2016-06-13 21:55 Amadeusz Piotr Żołnowski
2016-06-07 22:24 Amadeusz Piotr Żołnowski
2016-02-21 14:25 Amadeusz Piotr Żołnowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox