update buildroot to 2017.02.11

This commit is contained in:
jbnadal
2018-05-22 15:35:47 +02:00
parent 4bf1f5e091
commit a3c10bd762
9257 changed files with 433426 additions and 1701 deletions

View File

@@ -0,0 +1,76 @@
From 21d1f05a8882657c151397d0e4723535402f1757 Mon Sep 17 00:00:00 2001
From: Philipp Huebner <debalance@debian.org>
Date: Wed, 20 Jan 2016 10:22:57 -0500
Subject: [PATCH] remove make targets for deps
Without this patch, dependencies would be downloaded and compiled
using rebar at build time.
Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
---
Makefile.in | 26 +++-----------------------
1 file changed, 3 insertions(+), 23 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 08cd837..2a6457c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -77,26 +77,11 @@ else
INIT_USER=$(INSTALLUSER)
endif
-all: deps src
+all: src
-deps: deps/.got
-
-deps/.got:
- rm -rf deps/.got
- rm -rf deps/.built
- $(REBAR) get-deps && :> deps/.got
-
-deps/.built: deps/.got
- $(REBAR) compile && :> deps/.built
-
-src: deps/.built
+src:
$(REBAR) skip_deps=true compile
-update:
- rm -rf deps/.got
- rm -rf deps/.built
- $(REBAR) update-deps && :> deps/.got
-
xref: all
$(REBAR) skip_deps=true xref
@@ -152,16 +137,13 @@ $(foreach file,$(DEPS_FILES_FILTERED) $(MAIN_FILES),$(eval $(call COPY_template,
$(sort $(call TO_DEST,$(MAIN_DIRS) $(DEPS_DIRS))):
$(INSTALL) -d $@
-$(call TO_DEST,deps/p1_pam/priv/bin/epam): $(LIBDIR)/%: deps/p1_pam/priv/bin/epam $(call TO_DEST,deps/p1_pam/priv/bin/)
- $(INSTALL) -m 750 $(O_USER) $< $@
-
$(call TO_DEST,priv/sql/lite.sql): sql/lite.sql $(call TO_DEST,priv/sql)
$(INSTALL) -m 644 $< $@
$(call TO_DEST,priv/bin/captcha.sh): tools/captcha.sh $(call TO_DEST,priv/bin)
$(INSTALL) -m 750 $(O_USER) $< $@
-copy-files-sub2: $(call TO_DEST,$(DEPS_FILES) $(MAIN_FILES) priv/bin/captcha.sh priv/sql/lite.sql)
+copy-files-sub2: $(call TO_DEST,$(MAIN_FILES) priv/bin/captcha.sh priv/sql/lite.sql)
endif
@@ -287,8 +269,6 @@ TAGS:
Makefile: Makefile.in
-deps := $(wildcard deps/*/ebin)
-
dialyzer/erlang.plt:
@mkdir -p dialyzer
@dialyzer --build_plt --output_plt dialyzer/erlang.plt \
--
2.5.0

View File

@@ -0,0 +1,85 @@
From d399ecdd99e62b5554210a3b5c733e738e4d54be Mon Sep 17 00:00:00 2001
From: Philipp Huebner <debalance@debian.org>
Date: Wed, 20 Jan 2016 08:08:42 -0500
Subject: [PATCH] remove dependencies from rebar config
Without this patch, dependencies would be downloaded and compiled
by rebar at build time.
Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
---
rebar.config | 51 ---------------------------------------------------
1 file changed, 51 deletions(-)
diff --git a/rebar.config b/rebar.config
index 30c0360..d6a5b4d 100644
--- a/rebar.config
+++ b/rebar.config
@@ -7,48 +7,6 @@
%%% Created : 1 May 2013 by Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%%-------------------------------------------------------------------
-{deps, [{if_var_true, lager, {lager, ".*", {git, "https://github.com/basho/lager", {tag, "3.0.2"}}}},
- {if_var_false, lager, {p1_logger, ".*", {git, "https://github.com/processone/p1_logger", {tag, "1.0.0"}}}},
- {p1_utils, ".*", {git, "https://github.com/processone/p1_utils", {tag, "1.0.2"}}},
- {cache_tab, ".*", {git, "https://github.com/processone/cache_tab", {tag, "1.0.1"}}},
- {p1_tls, ".*", {git, "https://github.com/processone/tls", {tag, "1.0.0"}}},
- {p1_stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.0"}}},
- {p1_xml, ".*", {git, "https://github.com/processone/xml", {tag, "1.1.1"}}},
- {p1_stun, ".*", {git, "https://github.com/processone/stun", "0.9.0"}},
- {esip, ".*", {git, "https://github.com/processone/p1_sip", "1.0.0"}},
- {p1_yaml, ".*", {git, "https://github.com/processone/p1_yaml", {tag, "1.0.0"}}},
- {jiffy, ".*", {git, "https://github.com/davisp/jiffy", {tag, "0.14.5"}}},
- {oauth2, ".*", {git, "https://github.com/kivra/oauth2", "8d129fbf8866930b4ffa6dd84e65bd2b32b9acb8"}},
- {xmlrpc, ".*", {git, "https://github.com/rds13/xmlrpc", {tag, "1.15"}}},
- {if_var_true, mysql, {p1_mysql, ".*", {git, "https://github.com/processone/mysql", {tag, "1.0.0"}}}},
- {if_var_true, pgsql, {p1_pgsql, ".*", {git, "https://github.com/processone/pgsql", {tag, "1.0.0"}}}},
- {if_var_true, sqlite, {sqlite3, ".*", {git, "https://github.com/alexeyr/erlang-sqlite3", "cbc3505f7a131254265d3ef56191b2581b8cc172"}}},
- {if_var_true, pam, {p1_pam, ".*", {git, "https://github.com/processone/epam", {tag, "1.0.0"}}}},
- {if_var_true, zlib, {p1_zlib, ".*", {git, "https://github.com/processone/zlib", {tag, "1.0.0"}}}},
- {if_var_true, riak, {hamcrest, ".*", {git, "https://github.com/hyperthunk/hamcrest-erlang", "908a24fda4a46776a5135db60ca071e3d783f9f6"}}}, % for riak_pb-2.1.0.7
- {if_var_true, riak, {riakc, ".*", {git, "https://github.com/basho/riak-erlang-client", "527722d12d0433b837cdb92a60900c2cb5df8942"}}},
- {if_var_true, elixir, {elixir, ".*", {git, "https://github.com/elixir-lang/elixir", {tag, "v1.1.0"}}}},
- {if_var_true, elixir, {rebar_elixir_plugin, ".*", {git, "https://github.com/processone/rebar_elixir_plugin", "0.1.0"}}},
- {if_var_true, iconv, {p1_iconv, ".*", {git, "https://github.com/processone/eiconv", {tag, "0.9.0"}}}},
- {if_var_true, tools, {meck, "0.8.2", {git, "https://github.com/eproxus/meck", {tag, "0.8.2"}}}},
- {if_var_true, redis, {eredis, ".*", {git, "https://github.com/wooga/eredis", {tag, "v1.0.8"}}}}]}.
-
-{if_var_true, latest_deps,
- {floating_deps, [p1_logger,
- cache_tab,
- p1_tls,
- p1_stringprep,
- p1_xml,
- esip,
- p1_stun,
- p1_yaml,
- p1_utils,
- p1_mysql,
- p1_pgsql,
- p1_pam,
- p1_zlib,
- p1_iconv]}}.
-
{erl_opts, [nowarn_deprecated_function,
{if_var_true, roster_gateway_workaround, {d, 'ROSTER_GATWAY_WORKAROUND'}},
{if_var_match, db_type, mssql, {d, 'mssql'}},
@@ -92,15 +50,6 @@
{eunit_compile_opts, [{i, "tools"}]}.
-{post_hook_configure, [{"p1_tls", []},
- {"p1_stringprep", []},
- {"p1_yaml", []},
- {"esip", []},
- {"p1_xml", [{if_var_true, full_xml, "--enable-full-xml"}]},
- {if_var_true, pam, {"p1_pam", []}},
- {if_var_true, zlib, {"p1_zlib", []}},
- {if_var_true, iconv, {"p1_iconv", []}}]}.
-
{port_env, [{"CFLAGS", "-g -O2 -Wall"}]}.
{port_specs, [{"priv/lib/jid.so", ["c_src/jid.c"]}]}.
--
2.5.0

View File

@@ -0,0 +1,30 @@
From f384518dedec4ad657ad69d55754076c13c22d96 Mon Sep 17 00:00:00 2001
From: Johan Oudinet <johan.oudinet@gmail.com>
Date: Wed, 20 Jan 2016 08:11:32 -0500
Subject: [PATCH] remove checking erlang version
Without this patch, the configure will try to run erlang to simply check
if the version is supported by ejabberd. Instead, we do this test
statically.
---
configure.ac | 2 --
1 file changed, 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 97e89a2..cd1ab08 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,10 +39,8 @@ AC_ARG_ENABLE(erlang-version-check,
[Check Erlang/OTP version @<:@default=yes@:>@])])
case "$enable_erlang_version_check" in
yes|'')
- ERLANG_VERSION_CHECK([$REQUIRE_ERLANG_MIN],[$REQUIRE_ERLANG_MAX])
;;
no)
- ERLANG_VERSION_CHECK([$REQUIRE_ERLANG_MIN],[$REQUIRE_ERLANG_MAX],[warn])
;;
esac
--
2.5.0

View File

@@ -0,0 +1,56 @@
From 705a9ad229de49cd9cce226a2025716902455663 Mon Sep 17 00:00:00 2001
From: Philipp Huebner <debalance@debian.org>
Date: Wed, 20 Jan 2016 08:13:21 -0500
Subject: [PATCH] correct include
This part of the code was moved into it's own project and was packaged
separately by me. To make the build process work, this small fix is
necessary.
---
src/mod_sip.erl | 2 +-
src/mod_sip_proxy.erl | 2 +-
src/mod_sip_registrar.erl | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/mod_sip.erl b/src/mod_sip.erl
index c8c9533..7f188a0 100644
--- a/src/mod_sip.erl
+++ b/src/mod_sip.erl
@@ -38,7 +38,7 @@
-include("ejabberd.hrl").
-include("logger.hrl").
--include_lib("esip/include/esip.hrl").
+-include_lib("p1_sip/include/esip.hrl").
%%%===================================================================
%%% API
diff --git a/src/mod_sip_proxy.erl b/src/mod_sip_proxy.erl
index bf297bc..d8b65cd 100644
--- a/src/mod_sip_proxy.erl
+++ b/src/mod_sip_proxy.erl
@@ -40,7 +40,7 @@
-include("ejabberd.hrl").
-include("logger.hrl").
--include_lib("esip/include/esip.hrl").
+-include_lib("p1_sip/include/esip.hrl").
-define(SIGN_LIFETIME, 300). %% in seconds.
diff --git a/src/mod_sip_registrar.erl b/src/mod_sip_registrar.erl
index 44091ed..4d2ec82 100644
--- a/src/mod_sip_registrar.erl
+++ b/src/mod_sip_registrar.erl
@@ -37,7 +37,7 @@
-include("ejabberd.hrl").
-include("logger.hrl").
--include_lib("esip/include/esip.hrl").
+-include_lib("p1_sip/include/esip.hrl").
-define(CALL_TIMEOUT, timer:seconds(30)).
-define(DEFAULT_EXPIRES, 3600).
--
2.5.0

View File

@@ -0,0 +1,27 @@
From d43a65b112ec995a5ee52aca2a16e5cf9699d7c1 Mon Sep 17 00:00:00 2001
From: Johan Oudinet <johan.oudinet@gmail.com>
Date: Wed, 20 Jan 2016 08:16:26 -0500
Subject: [PATCH] disable ERLANG_DEPRECATED_CHECK
Without this patch, the configure will try to execute erlang to check
if it uses deprecated types. Assume the answer is false.
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index cd1ab08..a4f1533 100644
--- a/configure.ac
+++ b/configure.ac
@@ -235,7 +235,7 @@ if test "$ENABLEUSER" != ""; then
AC_SUBST([INSTALLUSER], [$ENABLEUSER])
fi
-ERLANG_DEPRECATED_TYPES_CHECK
+AC_SUBST(erlang_deprecated_types, false)
if test "$sqlite" = "true"; then
AX_LIB_SQLITE3([3.6.19])
--
2.5.0

View File

@@ -0,0 +1,82 @@
From ef847479778cc58818e066b87aa1789ba1c4148b Mon Sep 17 00:00:00 2001
From: Johan Oudinet <johan.oudinet@gmail.com>
Date: Wed, 20 Jan 2016 09:34:07 -0500
Subject: [PATCH] fix install permissions
Without this patch, the makefile will try to install directories and
files with incompatible permissions for ejabberd, which run as an
ejabberd user.
Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
---
Makefile.in | 38 +++++---------------------------------
1 file changed, 5 insertions(+), 33 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 2a6457c..0be4c50 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -155,10 +155,8 @@ copy-files-sub: copy-files-sub2
install: all copy-files
#
# Configuration files
- $(INSTALL) -d -m 750 $(G_USER) $(ETCDIR)
- [ -f $(ETCDIR)/ejabberd.yml ] \
- && $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml-new \
- || $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml
+ $(INSTALL) -d $(ETCDIR)
+ $(INSTALL) -b -m 644 ejabberd.yml.example $(ETCDIR)/ejabberd.yml
$(SED) -e "s*{{rootdir}}*@prefix@*" \
-e "s*{{installuser}}*@INSTALLUSER@*" \
-e "s*{{bindir}}*@bindir@*" \
@@ -168,14 +166,11 @@ install: all copy-files
-e "s*{{docdir}}*@docdir@*" \
-e "s*{{erl}}*@ERL@*" ejabberdctl.template \
> ejabberdctl.example
- [ -f $(ETCDIR)/ejabberdctl.cfg ] \
- && $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg-new \
- || $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
- $(INSTALL) -b -m 644 $(G_USER) inetrc $(ETCDIR)/inetrc
+ $(INSTALL) -b -m 644 ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
+ $(INSTALL) -b -m 644 inetrc $(ETCDIR)/inetrc
#
# Administration script
- [ -d $(SBINDIR) ] || $(INSTALL) -d -m 755 $(SBINDIR)
- $(INSTALL) -m 550 $(G_USER) ejabberdctl.example $(SBINDIR)/ejabberdctl
+ $(INSTALL) -D ejabberdctl.example $(SBINDIR)/ejabberdctl
# Elixir binaries
[ -d $(BINDIR) ] || $(INSTALL) -d -m 755 $(BINDIR)
[ -f deps/elixir/bin/iex ] && $(INSTALL) -m 550 $(G_USER) deps/elixir/bin/iex $(BINDIR)/iex || true
@@ -187,29 +182,6 @@ install: all copy-files
-e "s*@installuser@*$(INIT_USER)*" ejabberd.init.template \
> ejabberd.init
chmod 755 ejabberd.init
- #
- # Spool directory
- $(INSTALL) -d -m 750 $(O_USER) $(SPOOLDIR)
- $(CHOWN_COMMAND) -R @INSTALLUSER@ $(SPOOLDIR) >$(CHOWN_OUTPUT)
- chmod -R 750 $(SPOOLDIR)
- [ ! -f $(COOKIEFILE) ] || { $(CHOWN_COMMAND) @INSTALLUSER@ $(COOKIEFILE) >$(CHOWN_OUTPUT) ; chmod 400 $(COOKIEFILE) ; }
- #
- # ejabberdctl lock directory
- $(INSTALL) -d -m 750 $(O_USER) $(CTLLOCKDIR)
- $(CHOWN_COMMAND) -R @INSTALLUSER@ $(CTLLOCKDIR) >$(CHOWN_OUTPUT)
- chmod -R 750 $(CTLLOCKDIR)
- #
- # Log directory
- $(INSTALL) -d -m 750 $(O_USER) $(LOGDIR)
- $(CHOWN_COMMAND) -R @INSTALLUSER@ $(LOGDIR) >$(CHOWN_OUTPUT)
- chmod -R 750 $(LOGDIR)
- #
- # Documentation
- $(INSTALL) -d $(DOCDIR)
- [ -f doc/guide.html ] \
- && $(INSTALL) -m 644 doc/guide.html $(DOCDIR) \
- || echo "Documentation not included in sources"
- $(INSTALL) -m 644 COPYING $(DOCDIR)
uninstall: uninstall-binary
--
2.5.0

View File

@@ -0,0 +1,34 @@
From 53d7d654026afa163a55b860e33c6901129e8dc1 Mon Sep 17 00:00:00 2001
From: Johan Oudinet <johan.oudinet@gmail.com>
Date: Wed, 20 Jan 2016 09:35:07 -0500
Subject: [PATCH] fix ejabberdctl
Change default values so ejabberdctl run commands as ejabberd user
Also add a way for the user to change default values.
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
ejabberdctl.template | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ejabberdctl.template b/ejabberdctl.template
index f65c21f..ff9225f 100755
--- a/ejabberdctl.template
+++ b/ejabberdctl.template
@@ -14,9 +14,12 @@ SCRIPT_DIR=`cd ${0%/*} && pwd`
ERL={{erl}}
IEX={{bindir}}/iex
EPMD={{bindir}}/epmd
-INSTALLUSER={{installuser}}
+INSTALLUSER=ejabberd
ERL_LIBS={{libdir}}
+# Read default configuration file if present
+[ ! -r /etc/default/ejabberd ] || . /etc/default/ejabberd
+
# check the proper system user is used if defined
if [ "$INSTALLUSER" != "" ] ; then
EXEC_CMD="false"
--
2.5.0

View File

@@ -0,0 +1,23 @@
config BR2_PACKAGE_EJABBERD
bool "ejabberd"
depends on BR2_PACKAGE_ERLANG
depends on BR2_INSTALL_LIBSTDCPP # stringprep
select BR2_PACKAGE_ERLANG_LAGER
select BR2_PACKAGE_ERLANG_P1_CACHE_TAB
select BR2_PACKAGE_ERLANG_P1_ICONV
select BR2_PACKAGE_ERLANG_P1_SIP
select BR2_PACKAGE_ERLANG_P1_STRINGPREP
select BR2_PACKAGE_ERLANG_P1_XML
select BR2_PACKAGE_ERLANG_P1_YAML
select BR2_PACKAGE_ERLANG_P1_ZLIB
select BR2_PACKAGE_GETENT
select BR2_PACKAGE_OPENSSL
help
Ejabberd is a Jabber/XMPP instant messaging server, written
in Erlang/OTP. Among other features, ejabberd is
cross-platform, fault-tolerant, clusterable and modular.
http://www.ejabberd.im
comment "ejabberd needs erlang, toolchain w/ C++"
depends on !BR2_PACKAGE_ERLANG || !BR2_INSTALL_LIBSTDCPP

View File

@@ -0,0 +1,54 @@
#!/bin/sh
#
# Start/stop ejabberd
#
CTL=/usr/sbin/ejabberdctl
DEFAULT=/etc/default/ejabberd
INSTALLUSER=ejabberd
RUNDIR=/var/run/ejabberd
# Read default configuration file if present.
[ -r "$DEFAULT" ] && . "$DEFAULT"
# Create RUNDIR.
mkrundir() {
install -d -o "$INSTALLUSER" -g "$INSTALLUSER" "$RUNDIR"
}
case "$1" in
start)
mkrundir || exit 1
printf "Starting ejabberd... "
"$CTL" start
# Wait until ejabberd is up and running.
if "$CTL" started; then
echo "done"
else
echo "failed"
fi
;;
stop)
printf "Stopping ejabberd... "
"$CTL" stop > /dev/null
if [ $? -eq 3 ] || "$CTL" stopped; then
echo "OK"
else
echo "failed"
fi
;;
status)
"$CTL" status
;;
restart|force-reload)
"$0" stop || true
"$0" start
;;
live)
mkrundir || exit 1
"$CTL" live
;;
*)
echo "Usage: $0 {start|stop|status|restart|force-reload|live}"
exit 1
esac

View File

@@ -0,0 +1,55 @@
#!/bin/sh -e
# Helper to bypass AC_ERLANG_CHECK_LIB
#
# Ejabberd releases do not download specific versions of its erlang
# dependencies. Instead, it clones the master branch of a git
# repository and asks erl to provide the library version. However,
# the target erl program cannot be called from the host. So, this
# script aims at finding the library version installed on the target,
# without calling erlang.
usage() {
cat <<EOF
Usage:
$0 library
Look for Erlang's library in TARGET_DIR/usr/lib/erlang/lib.
If the library is found, it returns the path to the latest version,
relative to TARGET_DIR. Otherwise, it returns "not found".
If there are several versions, it returns an error because it does not
know which one Erlang uses.
EOF
}
die () {
echo "$@" >&2
exit 1
}
if [ $# -ne 1 ]; then
usage
exit 0
else
library="$1"
fi
target_dir="${TARGET_DIR:-output/target}"
[ -d "$target_dir" ] || die "TARGET_DIR is not a directory. Please \
specify the TARGET_DIR environment variable."
case "$(ls -1d -- "$target_dir/usr/lib/erlang/lib/$library-"* | wc -l)" in
0)
echo "not found"
;;
1)
echo "$target_dir/usr/lib/erlang/lib/$library-"* \
| sed -e "s,^$target_dir,,"
;;
*)
die "Several versions of $library have been found. Please \
remove the unused ones."
;;
esac

View File

@@ -0,0 +1,4 @@
# From https://www.process-one.net/downloads/ejabberd/16.01/ejabberd-16.01.tgz.md5
md5 5e525c25c8f04287217b8a9522d7c942 ejabberd-16.01.tgz
# Locally computed
sha256 e2cc479d5870539b2e6756690b227969c88a541d464d1fc6e1cbf7270ad7d681 ejabberd-16.01.tgz

View File

@@ -0,0 +1,53 @@
################################################################################
#
# ejabberd
#
################################################################################
EJABBERD_VERSION = 16.01
EJABBERD_SOURCE = ejabberd-$(EJABBERD_VERSION).tgz
EJABBERD_SITE = https://www.process-one.net/downloads/ejabberd/$(EJABBERD_VERSION)
EJABBERD_LICENSE = GPLv2+ with OpenSSL exception
EJABBERD_LICENSE_FILES = COPYING
EJABBERD_DEPENDENCIES = getent openssl host-erlang-lager erlang-lager \
erlang-p1-cache-tab erlang-p1-iconv erlang-p1-sip \
erlang-p1-stringprep erlang-p1-xml erlang-p1-yaml erlang-p1-zlib
# 0001-remove-make-targets-for-deps.patch updates Makefile.in
EJABBERD_USE_AUTOCONF = YES
EJABBERD_AUTORECONF = YES
ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
EJABBERD_DEPENDENCIES += linux-pam
endif
EJABBERD_ERLANG_LIBS = sasl crypto public_key ssl mnesia inets compiler
# Guess answers for these tests, configure will bail out otherwise
# saying error: cannot run test program while cross compiling.
EJABBERD_CONF_ENV = \
ac_cv_erlang_root_dir="$(HOST_DIR)/usr/lib/erlang" \
$(foreach lib,$(EJABBERD_ERLANG_LIBS), \
ac_cv_erlang_lib_dir_$(lib)="`package/ejabberd/check-erlang-lib $(lib)`")
define EJABBERD_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) install -C $(@D)
endef
# Delete HOST_DIR prefix from ERL path in ejabberctl script.
define EJABBERD_FIX_EJABBERDCTL
$(SED) 's,ERL=$(HOST_DIR),ERL=,' '$(TARGET_DIR)/usr/sbin/ejabberdctl'
endef
EJABBERD_POST_INSTALL_TARGET_HOOKS += EJABBERD_FIX_EJABBERDCTL
define EJABBERD_USERS
ejabberd -1 ejabberd -1 * /var/lib/ejabberd /bin/sh - ejabberd daemon
endef
define EJABBERD_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/ejabberd/S50ejabberd \
$(TARGET_DIR)/etc/init.d/S50ejabberd
endef
$(eval $(rebar-package))