Ejabber-17.12

mhiretskiy
parent 0342c8702a
commit 654052cafa

@ -0,0 +1 @@
DIST cache_tab-1.0.12.tar.gz 18655 SHA256 5ef27d3be0ef2e8dc06468ec39dc3a43506d6f85af0edc21b9c14db860669d38 SHA512 8cea5d4a20ba14013bb2e947874c64ff7159855a518451c3aa83c74425f3525ec71d1eb539bb743c84c1fbe2ad3453aaffddf76a58cc6bfe7c9caa055c05ac76 WHIRLPOOL ce427225de8fbac55ce0a67a754c4c3f478eebeb6b3b9005fa07a982785aa8626045717ebaefa56d6f860e689bde83c98a819a71c48f2b955b6c9a8263ca9f9e

@ -0,0 +1,21 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit rebar
DESCRIPTION="In-memory cache Erlang and Elixir library"
HOMEPAGE="https://github.com/processone/cache_tab"
SRC_URI="https://github.com/processone/${PN}/archive/${PV}.tar.gz
-> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~sparc ~x86"
DEPEND=">=dev-erlang/p1_utils-1.0.10
>=dev-lang/erlang-17.1"
RDEPEND="${DEPEND}"
DOCS=( CHANGELOG.md README.md )

@ -0,0 +1 @@
DIST fast_tls-1.0.18.tar.gz 65557 SHA256 053b39ba6470c8dc9ddf9b3e7186c5ba823965581bd1d56b0844069c96d662b1 SHA512 d918505274d1d60c797b794d02937beb1b7ff3d451c9a47a42235f0b25a71283c69bfd275de023e5447767ad061b6bd9d82a91be26980dff2204be77ed4cf001 WHIRLPOOL d161b3da07144fb73df49306e6a8d803101859d2a93af8db1fbaffb554b0b8340d6597e17884794ff52eca0d20cc10d1f125a02c21b9605a933c866e794bf742

@ -0,0 +1,24 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit rebar
DESCRIPTION="TLS/SSL native driver for Erlang and Elixir"
HOMEPAGE="https://github.com/processone/fast_tls"
SRC_URI="https://github.com/processone/${PN}/archive/${PV}.tar.gz
-> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~ia64 ppc ~sparc ~x86"
IUSE="libressl"
DEPEND=">=dev-erlang/p1_utils-1.0.7
>=dev-lang/erlang-17.1
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )"
RDEPEND="${DEPEND}"
DOCS=( CHANGELOG.md README.md )

@ -0,0 +1 @@
DIST fs-2.12.0.tar.gz 21410 SHA256 9b22e717c91983e3dbd9a2d2bb0ccbdb5d80f7f1c21961eddd742ac2adbdbac3 SHA512 a5a708a9570417359bd4d3d34c26925c09453108fc4fdc8a9f8fbb59a5fa7e0dd4c60a30ebf4c4a2289a2b25a289cb731990600f78eedc4fb8a66ee9bfe2e221 WHIRLPOOL 5402bbd363def7d558cf058d1d2893de3c3b88a228ecfc7d43584de6f5cda1a6b406e232c41d6f86ef5c526c79702bf6dfaf4b1feb3e79a9c942a5c9e03a3477

@ -0,0 +1,28 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit rebar
DESCRIPTION="Erlang File System Listener"
HOMEPAGE="https://github.com/synrc/fs"
SRC_URI="https://github.com/synrc/fs/archive/${PV}.tar.gz
-> ${P}.tar.gz"
LICENSE="ISC"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="test"
RDEPEND=">=dev-erlang/fast_xml-1.1.21
>=dev-lang/erlang-17.1
sys-fs/inotify-tools"
DEPEND="${RDEPEND}"
DOCS=( README.md LICENSE )
src_prepare() {
rebar_src_prepare
rebar_fix_include_path fast_xml
}

@ -0,0 +1 @@
DIST p1_utils-1.0.10.tar.gz 55119 SHA256 57bfc575179733a723717f4fecb65b9f7fd056595f798b52e7bc0206e8a9333f SHA512 0e26d4962ca3e46ef3bf2e16ba6de1fd8629210c86c8dc8eabfe3d3bb96df069d07f95ee667a28c3b205c0b67b27d4384b044c22fbcea9c3e2babb8d98a7ba60 WHIRLPOOL 335d46e51f9d788de6a677582b5685a250daab43becb3007439ab1fd4089d2d37580fc0ae275fa5ab174e42eeb0b7d50a48232837eaf8101d16ed035dd8e5123

@ -0,0 +1,20 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit rebar
DESCRIPTION="Erlang utility modules from ProcessOne"
HOMEPAGE="https://github.com/processone/p1_utils"
SRC_URI="https://github.com/processone/${PN}/archive/${PV}.tar.gz
-> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~sparc ~x86"
DEPEND=">=dev-lang/erlang-17.1"
RDEPEND="${DEPEND}"
DOCS=( CHANGELOG.md README.md )

@ -0,0 +1 @@
DIST xmpp-1.1.17.tar.gz 397100 SHA256 d7e1564560cb2a1e036d0bd42079c138568e2caa494d2c004e5b756bfe19071b SHA512 ef0edb20164010256b269f59442868bc2cf9f69961dbe33cb049b3a838f19ebfee9ed5aed946b56243638fd3f4454484682ac09c37d71738dacbba80b0596ee5 WHIRLPOOL c86ab1c9df64882fc33fa1562d494459a1352b66dcf29bc01dc8323a1dba38f7dd14c7cd159247cd3c6718470c3adf91470ebaa51fe396108ea04ff2eb0541ae

@ -0,0 +1,29 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit rebar
DESCRIPTION="XMPP parsing and serialization library on top of Fast XML"
HOMEPAGE="https://github.com/processone/xmpp"
SRC_URI="https://github.com/processone/${PN}/archive/${PV}.tar.gz
-> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~ia64 ppc ~sparc ~x86"
IUSE="test"
RDEPEND=">=dev-erlang/fast_xml-1.1.22
>=dev-erlang/stringprep-1.0.8
>=dev-lang/erlang-17.1
!=dev-lang/erlang-20.1"
DEPEND="${RDEPEND}"
DOCS=( CHANGELOG.md )
src_prepare() {
rebar_src_prepare
rebar_fix_include_path fast_xml
}

@ -0,0 +1 @@
DIST ejabberd-17.12.tgz 1881616 SHA256 4c818129bdc633e7eab682126478aef837c5582a2a30b86ce6c44553a03f8eec SHA512 6d8c16d72c24c8250fbf09fdde4219130c69086c7471f1bfff044a60e5dac031d0c7a4993b54e4a4eea315f5112196acf45058ef260c7fd0695c944865013fb3 WHIRLPOOL 7f93c3b92f6482254d50b879557983b44f5e21496b768f7ff9088b8d7d67709b2e311d223d46f4a8ba9edd7ac4c25c6d123c330d978b2e6878449dbdda01a439

@ -0,0 +1,337 @@
# Copyright 1999-2018 Gentoo Foundation
# 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="http://www.ejabberd.im/ https://github.com/processone/ejabberd/"
#SRC_URI="https://github.com/processone/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI="https://www.process-one.net/downloads/${PN}/${PV}/${P}.tgz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
REQUIRED_USE="mssql? ( odbc )"
# TODO: Add 'tools' flag.
IUSE="captcha debug full-xml graphics hipe ldap mssql mysql nls odbc pam postgres redis
riak roster-gw sip sqlite stun 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.12
>=dev-erlang/fast_tls-1.0.18
>=dev-erlang/fast_xml-1.1.21
>=dev-erlang/fast_yaml-1.0.9
>=dev-erlang/fs-2.12.0
>=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.10
>=dev-erlang/stringprep-1.0.8
>=dev-erlang/xmpp-1.1.17
>=dev-lang/erlang-17.1[hipe?,odbc?,ssl]
>=net-im/jabber-base-0.01
graphics? ( >=dev-erlang/eimp-1.0.2 )
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
)
sip? ( >=dev-erlang/esip-1.0.18 )
sqlite? ( >=dev-erlang/sqlite3-1.1.5 )
stun? ( >=dev-erlang/stun-1.0.17 )
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}-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'
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 graphics) \
$(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 sip) \
$(use_enable stun) \
$(use_enable zlib)
# more options to support
# --enable-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 || 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 " 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 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
}

@ -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

@ -0,0 +1,38 @@
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 /root is a directory when
instead it defaults to /dev/null on Gentoo.
---
diff --git a/ejabberdctl.template b/ejabberdctl.template
index 571b90b..71336c0 100755
--- a/ejabberdctl.template
+++ b/ejabberdctl.template
@@ -82,6 +82,7 @@ fi
ERL_LIBS={{libdir}}
ERL_CRASH_DUMP="$LOGS_DIR"/erl_crash_$(date "+%Y%m%d-%H%M%S").dump
ERL_INETRC="$ETC_DIR"/inetrc
+HOME=$SPOOL_DIR
# define ejabberd parameters
EJABBERD_OPTS="$EJABBERD_OPTS\
@@ -105,12 +106,13 @@ export ERL_MAX_ETS_TABLES
export CONTRIB_MODULES_PATH
export CONTRIB_MODULES_CONF_DIR
export ERL_LIBS
+export HOME
# run command either directly or via su $INSTALLUSER
exec_cmd()
{
case $EXEC_CMD in
- as_install_user) su -s /bin/sh -c '"$0" "$@"' "$INSTALLUSER" -- "$@" ;;
+ as_install_user) su -p -s /bin/sh -c '"$0" "$@"' "$INSTALLUSER" -- "$@" ;;
as_current_user) "$@" ;;
esac
}

@ -0,0 +1,5 @@
# Please configure everything at /etc/jabber/ejabberdctl.cfg
# Put here only command line arguments for ejabberdctl (if any are required)
#EJABBERDCTL_OPTS=""

@ -0,0 +1,54 @@
#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Foundation
# 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 -n .
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
}

@ -0,0 +1,13 @@
/var/log/jabber/*.log {
su jabber jabber
weekly
rotate 4
missingok
nocreate
sharedscripts
notifempty
compress
postrotate
/usr/sbin/ejabberdctl reopen-log > /dev/null 2>&1 || true
endscript
}

@ -0,0 +1,2 @@
d /run/lock/ejabberdctl 0750 jabber jabber
d /run/ejabberd 0750 jabber jabber

@ -0,0 +1,21 @@
#!/bin/sh
ERL_LIBS=/usr/lib/erlang/lib
for bin in "$ERL_LIBS"/epam-*/priv/bin/epam; do
if [ -x "$bin" ]; then
if [ -z "$epam" ]; then
epam="$bin"
else
echo "Multiple epam libraries - don't know what to do" >&2
exit 1
fi
fi
done
if [ -z "$epam" ]; then
echo "Couldn't find epam package" >&2
exit 1
fi
exec "$epam"
Loading…
Cancel
Save