Move all to deprecated folder.

This commit is contained in:
2016-11-16 21:57:57 +01:00
parent 01738a7684
commit 05de7d6c04
9777 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
Description: remove make targets for deps
Without this patch, dependencies would be downloaded and compiled
using rebar at build time.
Author: Philipp Huebner <debalance@debian.org>
Index: ejabberd/rebar.config.script
===================================================================
diff --git a/rebar.config.script b/rebar.config.script
index 633433c..646a15a 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -187,9 +187,7 @@ Config = [{erl_opts, Macros ++ HiPE ++ DebugInfo ++
{xref_checks, []},
{xref_queries,
[{"(XC - UC) || (XU - X - B - "
- ++ string:join(CfgXrefs, " - ") ++ ")", []}]},
- {post_hooks, PostHooks ++ CfgPostHooks},
- {deps, AllDeps}] ++ ElixirConfig,
+ ++ string:join(CfgXrefs, " - ") ++ ")", []}]}],
%%io:format("ejabberd configuration:~n ~p~n", [Config]),
Config.

View File

@@ -0,0 +1,76 @@
Description: remove make targets for deps
Without this patch, dependencies would be downloaded and compiled
using rebar at build time.
Author: Philipp Huebner <debalance@debian.org>
Index: ejabberd/Makefile.in
===================================================================
diff --git a/Makefile.in b/Makefile.in
index 8dd6bf5..b9d783a 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
@@ -129,13 +114,10 @@ endef
$(foreach file,$(DEPS_FILES_FILTERED) $(MAIN_FILES),$(eval $(call COPY_template,$(file))))
-$(call TO_DEST,$(MAIN_DIRS) $(DEPS_DIRS)):
+$(call TO_DEST,$(MAIN_DIRS)):
$(INSTALL) -d $@
-$(call TO_DEST,deps/p1_pam/priv/bin/epam): $(LIBDIR)/%: deps/% $(call TO_DEST,deps/p1_pam/priv/bin/)
- $(INSTALL) -m 750 $(O_USER) $< $@
-
-copy-files: $(call TO_DEST,$(DEPS_FILES) $(MAIN_FILES))
+copy-files: $(call TO_DEST,$(MAIN_FILES))
install: all copy-files
#
@@ -172,10 +154,6 @@ install: all copy-files
-e "s*@installuser@*$(INIT_USER)*" ejabberd.init.template \
> ejabberd.init
chmod 755 ejabberd.init
- # Install Elixir and Elixir dependancies
- -$(INSTALL) -m 644 deps/*/lib/*/ebin/*.app $(BEAMDIR)
- -$(INSTALL) -m 644 deps/*/lib/*/ebin/*.beam $(BEAMDIR)
- rm -f $(BEAMDIR)/configure.beam
#
# Binary C programs
$(INSTALL) -d $(PBINDIR)
@@ -266,8 +244,6 @@ TAGS:
Makefile: Makefile.in
-deps := $(wildcard deps/*/ebin)
-
dialyzer/erlang.plt:
@mkdir -p dialyzer
@dialyzer --build_plt --output_plt dialyzer/erlang.plt \

View File

@@ -0,0 +1,27 @@
Description: remove testing with MySQL and PostgreSQL
Without this patch a test would be initiated after building ejabberd that
requires specially configured instances of MySQL and PostgreSQL to be up
and running.
Author: Philipp Huebner <debalance@debian.org>
Index: ejabberd/Makefile.in
===================================================================
diff --git a/Makefile.in b/Makefile.in
index ffd1d30..835d611 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -306,14 +306,8 @@ dialyzer: erlang_plt deps_plt ejabberd_plt
status=$$? ; if [ $$status -ne 2 ]; then exit $$status; else exit 0; fi
test:
- @echo "************************** NOTICE ***************************************"
- @cat test/README
- @echo "*************************************************************************"
- @cd priv && ln -sf ../sql
- $(REBAR) skip_deps=true ct
quicktest:
- $(REBAR) skip_deps=true ct suites=elixir
.PHONY: src edoc dialyzer Makefile TAGS clean clean-rel distclean rel \
install uninstall uninstall-binary uninstall-all translations deps test spec \

View File

@@ -0,0 +1,20 @@
Description: 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.
Author: Johan Oudinet <johan.oudinet@gmail.com>
Index: ejabberd/configure.ac
===================================================================
--- ejabberd.orig/configure.ac 2014-10-20 11:04:14.751256865 +0200
+++ ejabberd/configure.ac 2014-10-20 11:03:47.983578623 +0200
@@ -37,10 +37,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

View File

@@ -0,0 +1,45 @@
Description: 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.
Author: Philipp Huebner <debalance@debian.org>
Index: ejabberd/src/mod_sip_proxy.erl
===================================================================
--- ejabberd.orig/src/mod_sip_proxy.erl
+++ ejabberd/src/mod_sip_proxy.erl
@@ -21,7 +21,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.
Index: ejabberd/src/mod_sip.erl
===================================================================
--- ejabberd.orig/src/mod_sip.erl
+++ ejabberd/src/mod_sip.erl
@@ -20,7 +20,7 @@
-include("ejabberd.hrl").
-include("logger.hrl").
--include_lib("esip/include/esip.hrl").
+-include_lib("p1_sip/include/esip.hrl").
%%%===================================================================
%%% API
Index: ejabberd/src/mod_sip_registrar.erl
===================================================================
--- ejabberd.orig/src/mod_sip_registrar.erl
+++ ejabberd/src/mod_sip_registrar.erl
@@ -20,7 +20,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).

View File

@@ -0,0 +1,20 @@
Description: 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.
Author: Johan Oudinet <johan.oudinet@gmail.com>
Index: ejabberd/configure.ac
====================================================================
diff --git a/configure.ac b/configure.ac
index 6ae0a24..e5498df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -252,7 +252,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])

View File

@@ -0,0 +1,79 @@
Description: 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.
Author: Johan Oudinet <johan.oudinet@gmail.com>
Index: ejabberd/Makefile.in
===================================================================
diff --git a/Makefile.in b/Makefile.in
index b9d783a..6ec805a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -122,10 +122,8 @@ copy-files: $(call TO_DEST,$(MAIN_FILES))
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@*" \
@@ -135,14 +133,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
@@ -157,34 +152,11 @@ install: all copy-files
#
# Binary C programs
$(INSTALL) -d $(PBINDIR)
- $(INSTALL) -m 750 $(O_USER) tools/captcha.sh $(PBINDIR)
+ $(INSTALL) tools/captcha.sh $(PBINDIR)
#
# Copy lite.sql
[ -d deps/sqlite3 ] && $(INSTALL) -d $(SQLDIR) || true
[ -d deps/sqlite3 ] && $(INSTALL) -m 644 sql/lite.sql $(SQLDIR) || true
- #
- # 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

View File

@@ -0,0 +1,25 @@
Description: 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>
Index: ejabberd/ejabberdctl.template
===================================================================
diff --git a/ejabberdctl.template b/ejabberdctl.template
index c7d76ef..a7afce1 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"

View File

@@ -0,0 +1,22 @@
config BR2_PACKAGE_EJABBERD
bool "ejabberd"
depends on BR2_PACKAGE_ERLANG
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"
depends on !BR2_PACKAGE_ERLANG

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/15.11/ejabberd-15.11.tgz.md5
md5 a6997b88d44c5a5acff45bb1d938d0f3 ejabberd-15.11.tgz
# Locally computed
sha256 01044b5a25f9f8dda8c60726698bd27d650751b810e5bfa23f9bb49ba20e946a ejabberd-15.11.tgz

View File

@@ -0,0 +1,52 @@
################################################################################
#
# ejabberd
#
################################################################################
EJABBERD_VERSION = 15.11
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
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))