Skip to contentSkip to conversation

ejabberd: Bump to version 17.11

PATCH Superseded Johan Oudinet 3 participants 6 messages Jan 19, 2018 – Feb 9, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ejabberd: Bump to version 17.11

* Adapt all patches.
* Use the new configure option enable-system-deps even though there is still a patch needed to correct includes.
* Disable graphics to not depends on X libraries. Disable also mod_avatar from the default loaded modules, since this module requires graphics enabled.

---
Changes v1 -> v2:
- Remove Erlang cookie configuration.
- Link 0004-xxx patch to corresponding upstream discussion and explain how it has been created.
- Fix warnings found by utils/check-package.

---
 .../0001-remove-make-targets-for-deps.patch        |    5 +-
 ...002-remove-dependencies-from-rebar-config.patch |   82 +-
 package/ejabberd/0004-correct-include.patch        |   58 -
 package/ejabberd/0004-correct-includes.patch       | 1919 ++++++++++++++++++++
 package/ejabberd/0007-fix-ejabberdctl.patch        |   34 +-
 .../0008-handle-error-case-from-lib_dir.patch      |   32 +
 .../0008-rebar-uses-host-dependencies.patch        |   33 -
 package/ejabberd/0009-disable-mod_avatar.patch     |   32 +
 package/ejabberd/ejabberd.hash                     |    2 +-
 package/ejabberd/ejabberd.mk                       |   26 +-
 10 files changed, 2074 insertions(+), 149 deletions(-)
 delete mode 100644 package/ejabberd/0004-correct-include.patch
 create mode 100644 package/ejabberd/0004-correct-includes.patch
 create mode 100644 package/ejabberd/0008-handle-error-case-from-lib_dir.patch
 delete mode 100644 package/ejabberd/0008-rebar-uses-host-dependencies.patch
 create mode 100644 package/ejabberd/0009-disable-mod_avatar.patch
package/ejabberd/0001-remove-make-targets-for-deps.patch +3 -2
index aee09670a1..f012140a18 100644
@@ -9,10 +9,10 @@ using rebar at build time.
 Signed-off-by: Frank Hunleth <[email protected]>
 
 diff --git a/Makefile.in b/Makefile.in
-index a0b4553d..4190a515 100644
+index df2abfdc..8c8fd714 100644
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -77,26 +77,11 @@ else
+@@ -86,27 +86,11 @@ else
    INIT_USER=$(INSTALLUSER)
  endif
 
@@ -24,6 +24,7 @@ index a0b4553d..4190a515 100644
 -deps/.got:
 -	rm -rf deps/.got
 -	rm -rf deps/.built
+-	mkdir -p deps
 -	$(REBAR) get-deps && :> deps/.got
 -
 -deps/.built: deps/.got
package/ejabberd/0002-remove-dependencies-from-rebar-config.patch +47 -35

134 lines not on this page · raw message

package/ejabberd/0004-correct-include.patch deleted +0 -58

58 lines not on this page · raw message

package/ejabberd/0004-correct-includes.patch new file +1919 -0

1,919 lines not on this page · raw message

package/ejabberd/0007-fix-ejabberdctl.patch +19 -15
index ab70d8900a..090fcc52d2 100644
@@ -1,28 +1,32 @@
-From 53d7d654026afa163a55b860e33c6901129e8dc1 Mon Sep 17 00:00:00 2001
+From 168d5840dc2a541ec16385e666c1932cf02907e9 Mon Sep 17 00:00:00 2001
 From: Johan Oudinet <[email protected]>
-Date: Wed, 20 Jan 2016 09:35:07 -0500
+Date: Wed, 10 Jan 2018 15:00:07 +0100
 Subject: [PATCH] fix ejabberdctl
 
-Change default values so ejabberdctl run commands as ejabberd user
+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 <[email protected]>
+---
+ ejabberdctl.template | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
 
 diff --git a/ejabberdctl.template b/ejabberdctl.template
-index 5b34ebee..51acaca8 100755
+index 83637766..5a8a8795 100755
 --- a/ejabberdctl.template
 +++ b/ejabberdctl.template
-@@ -14,9 +14,12 @@ SCRIPT_DIR=`cd ${0%/*} && pwd`
- ERL={{erl}}
- IEX={{bindir}}/iex
- EPMD={{epmd}}
--INSTALLUSER={{installuser}}
+@@ -15,7 +15,10 @@ SCRIPT_DIR=$(cd "${0%/*}" && pwd)
+ ERL="{{erl}}"
+ IEX="{{bindir}}/iex"
+ EPMD="{{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"
+ 
+ # check the proper system user is used
+ case $(id -un) in
+-- 
+2.14.1
+
package/ejabberd/0008-handle-error-case-from-lib_dir.patch new file +32 -0
new file mode 100644
index 0000000000..f7931b4edc
@@ -0,0 +1,32 @@
+From d0bfcbbfd8a6e7ee6213112e4078b020e4e1d15d Mon Sep 17 00:00:00 2001
+From: Pawe? Chmielowski <[email protected]>
+Date: Wed, 10 Jan 2018 16:34:01 +0100
+Subject: [PATCH] Handle error case from code:lib_dir in ResolveDepPath in
+ rebar.config.script
+
+This patch have already been applied in upstream/master.
+
+Signed-off-by: Pawe? Chmielowski <[email protected]>
+
+---
+ rebar.config.script | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/rebar.config.script b/rebar.config.script
+index 85f918fffd..ba374e5c5f 100644
+--- a/rebar.config.script
++++ b/rebar.config.script
+@@ -233,9 +233,10 @@ ResolveDepPath = case {SystemDeps, IsRebar3} of
+ 		     {true, _} ->
+ 			 fun("deps/" ++ Rest) ->
+ 				 Slash = string:str(Rest, "/"),
+-				 code:lib_dir(
+-				   string:sub_string(Rest, 1, Slash -1)) ++
+-				     string:sub_string(Rest, Slash);
++				 case code:lib_dir(string:sub_string(Rest, 1, Slash -1)) of
++				     {error, _} -> Rest;
++				     V -> V ++ string:sub_string(Rest, Slash)
++				 end;
+ 			    (Path) ->
+ 				 Path
+ 			 end;
package/ejabberd/0008-rebar-uses-host-dependencies.patch deleted +0 -33
deleted file mode 100644
index 45f387993e..0000000000
@@ -1,33 +0,0 @@
-Fix location of rebar dependencies.
-
-Signed-off-by: Christophe Romain <[email protected]>
-
-diff --git a/rebar.config.script b/rebar.config.script
-index 19142b9e..9107af26 100644
---- a/rebar.config.script
-+++ b/rebar.config.script
-@@ -218,20 +218,10 @@ TestConfig = case file:read_file_info(TestConfigFile) of
- 		     ""
- 	     end,
-
--ResolveDepPath = case IsRebar3 of
--		     true ->
--			 fun("deps/" ++ Rest) ->
--				 Slash = string:str(Rest, "/"),
--				 Dir = "_build/default/lib/" ++
--				     string:sub_string(Rest, 1, Slash - 1),
--				 Dir ++ string:sub_string(Rest, Slash);
--			    (Path) ->
--				 Path
--			 end;
--		     _ ->
--			 fun(P) ->
--				 P
--			 end
-+ResolveDepPath = fun("deps/fast_xml/include") -> code:lib_dir(p1_xml) ++ "/include";
-+		    ("deps/xmpp/include") -> code:lib_dir(p1_xmpp) ++ "/include";
-+		    ("deps/p1_utils/include") -> code:lib_dir(p1_utils) ++ "/include";
-+		    (Path) -> Path
- 		 end,
-
- CtParams = fun(CompileOpts) ->
package/ejabberd/0009-disable-mod_avatar.patch new file +32 -0
new file mode 100644
index 0000000000..ab89ba1a29
@@ -0,0 +1,32 @@
+From e6eac74e82975e7d87b1f59c50eb007ab04c1392 Mon Sep 17 00:00:00 2001
+From: Johan Oudinet <[email protected]>
+Date: Tue, 16 Jan 2018 14:29:56 +0100
+Subject: [PATCH] disable mod_avatar
+
+This module requires to compile with graphics enabled.
+
+Signed-off-by: Johan Oudinet <[email protected]>
+---
+ ejabberd.yml.example | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/ejabberd.yml.example b/ejabberd.yml.example
+index e178e956..7c12b76c 100644
+--- a/ejabberd.yml.example
++++ b/ejabberd.yml.example
+@@ -796,9 +796,9 @@ modules:
+     search: false
+   mod_vcard_xupdate: {}
+   ## Convert all avatars posted by Android clients from WebP to JPEG
+-  mod_avatar:
+-    convert:
+-      webp: jpeg
++  ## mod_avatar:
++  ##   convert:
++  ##     webp: jpeg
+   mod_version: {}
+   mod_stream_mgmt: {}
+   ##   Non-SASL Authentication (XEP-0078) is now disabled by default
+-- 
+2.14.1
+
package/ejabberd/ejabberd.hash +1 -1
index 24a26d21d9..6fb90a2300 100644
@@ -1,2 +1,2 @@
 # Locally computed
-sha256 b8395bc65b09f135a60320b62338258acd6056cc241e9e245fde267fb18dd3c9 ejabberd-17.04.tgz
+sha256 bd16b33a2f1345e5847fd05b70a5fa992181bac756cd6d5d621de9c18cb76801 ejabberd-17.11.tgz
package/ejabberd/ejabberd.mk +21 -5
index 35a1027efb..0f7af9b83e 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-EJABBERD_VERSION = 17.04
+EJABBERD_VERSION = 17.11
 EJABBERD_SOURCE = ejabberd-$(EJABBERD_VERSION).tgz
 EJABBERD_SITE = https://www.process-one.net/downloads/ejabberd/$(EJABBERD_VERSION)
 EJABBERD_LICENSE = GPL-2.0+ with OpenSSL exception
@@ -23,22 +23,38 @@ ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
 EJABBERD_DEPENDENCIES += linux-pam
 endif
 
-EJABBERD_ERLANG_LIBS = sasl crypto public_key ssl mnesia inets compiler
+# Install check-erlang-lib script to the directory in which the
+# package has been uncompressed, so it is available during the
+# configure step.
+define EJABBERD_INSTALL_CHECK_ERLANG_LIB
+	$(INSTALL) -m 0755 $(EJABBERD_PKGDIR)/check-erlang-lib \
+		$(@D)/check-erlang-lib
+endef
+
+EJABBERD_POST_EXTRACT_HOOKS += EJABBERD_INSTALL_CHECK_ERLANG_LIB
+
+EJABBERD_ERLANG_LIBS = sasl public_key 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)/lib/erlang" \
 	$(foreach lib,$(EJABBERD_ERLANG_LIBS), \
-		ac_cv_erlang_lib_dir_$(lib)="`package/ejabberd/check-erlang-lib $(lib)`")
+		ac_cv_erlang_lib_dir_$(lib)="`./check-erlang-lib $(lib)`")
+
+EJABBERD_CONF_OPTS = \
+	--enable-system-deps \
+	--disable-erlang-version-check \
+	--disable-graphics
 
 define EJABBERD_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) install -C $(@D)
 endef
 
-# Replace HOST_DIR prefix to /usr in ERL path of ejabberctl script.
+# Replace HOST_DIR prefix to /usr in environment variables of
+# ejabberctl script.
 define EJABBERD_FIX_EJABBERDCTL
-	$(SED) 's,ERL=$(HOST_DIR),ERL=/usr,' '$(TARGET_DIR)/usr/sbin/ejabberdctl'
+	$(SED) 's,="$(HOST_DIR),="/usr,' '$(TARGET_DIR)/usr/sbin/ejabberdctl'
 endef
 
 EJABBERD_POST_INSTALL_TARGET_HOOKS += EJABBERD_FIX_EJABBERDCTL
Signature · 1 line
2.14.1
#1 lore raw

PATCH v2 1/1 ejabberd: Bump to version 17.11

Hello,

Quoted 8 lines · Johan Oudinet

* Adapt all patches.
* Use the new configure option enable-system-deps even though there is still a patch needed to correct includes.
* Disable graphics to not depends on X libraries. Disable also mod_avatar from the default loaded modules, since this module requires graphics enabled.

Thanks for this new version, I've applied to master. However, I have one question below.

Quoted 10 lines
package/ejabberd/ejabberd.mk +9 -1
-EJABBERD_ERLANG_LIBS = sasl crypto public_key ssl mnesia inets compiler
+# Install check-erlang-lib script to the directory in which the
+# package has been uncompressed, so it is available during the
+# configure step.
+define EJABBERD_INSTALL_CHECK_ERLANG_LIB
+	$(INSTALL) -m 0755 $(EJABBERD_PKGDIR)/check-erlang-lib \
+		$(@D)/check-erlang-lib
+endef
+
+EJABBERD_POST_EXTRACT_HOOKS += EJABBERD_INSTALL_CHECK_ERLANG_LIB

package/ejabberd/ejabberd.mk ifeq ($(BR2_PACKAGE_LINUX_PAM),y) · line 43

Quoted 10 lines
package/ejabberd/ejabberd.mk +3 -1
+
+EJABBERD_ERLANG_LIBS = sasl public_key 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)/lib/erlang" \
 	$(foreach lib,$(EJABBERD_ERLANG_LIBS), \
-		ac_cv_erlang_lib_dir_$(lib)="`package/ejabberd/check-erlang-lib $(lib)`")
+		ac_cv_erlang_lib_dir_$(lib)="`./check-erlang-lib $(lib)`")

Why did you change the location of check-erlang-lib ? What was the problem ? It looked like a good idea to directly used it from package/ejabberd/ instead of copying it.

Could you explain this ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#2 lore raw

PATCH v2 1/1 ejabberd: Bump to version 17.11

Hi Thomas,

Quoted 26 lines · Thomas Petazzoni
Quoted 10 lines · Johan Oudinet
package/ejabberd/ejabberd.mk +9 -1
-EJABBERD_ERLANG_LIBS = sasl crypto public_key ssl mnesia inets compiler
+# Install check-erlang-lib script to the directory in which the
+# package has been uncompressed, so it is available during the
+# configure step.
+define EJABBERD_INSTALL_CHECK_ERLANG_LIB
+     $(INSTALL) -m 0755 $(EJABBERD_PKGDIR)/check-erlang-lib \
+             $(@D)/check-erlang-lib
+endef
+
+EJABBERD_POST_EXTRACT_HOOKS += EJABBERD_INSTALL_CHECK_ERLANG_LIB

package/ejabberd/ejabberd.mk ifeq ($(BR2_PACKAGE_LINUX_PAM),y) · line 43

Quoted 10 lines
package/ejabberd/ejabberd.mk +3 -1
+
+EJABBERD_ERLANG_LIBS = sasl public_key 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)/lib/erlang" \
      $(foreach lib,$(EJABBERD_ERLANG_LIBS), \
-             ac_cv_erlang_lib_dir_$(lib)="`package/ejabberd/check-erlang-lib $(lib)`")
+             ac_cv_erlang_lib_dir_$(lib)="`./check-erlang-lib $(lib)`")

Why did you change the location of check-erlang-lib ? What was the problem ? It looked like a good idea to directly used it from package/ejabberd/ instead of copying it.

Quoted 1 line

Could you explain this ?

I changed it because I got "package/ejabberd/check-erlang-lib: command not found" during the configure step.
I guess it is not necessarily in the PATH and the configure is done inside $(@D).
TBH, I don't understand why this was working before.

Best,

Signature · 1 line
Johan
#3 lore raw

PATCH v2 1/1 ejabberd: Bump to version 17.11

Quoted 30 lines · Johan Oudinet

Hi Thomas,

Quoted 26 lines · Thomas Petazzoni
Quoted 10 lines · Johan Oudinet
package/ejabberd/ejabberd.mk +9 -1
-EJABBERD_ERLANG_LIBS = sasl crypto public_key ssl mnesia inets compiler
+# Install check-erlang-lib script to the directory in which the
+# package has been uncompressed, so it is available during the
+# configure step.
+define EJABBERD_INSTALL_CHECK_ERLANG_LIB
+     $(INSTALL) -m 0755 $(EJABBERD_PKGDIR)/check-erlang-lib \
+             $(@D)/check-erlang-lib
+endef
+
+EJABBERD_POST_EXTRACT_HOOKS += EJABBERD_INSTALL_CHECK_ERLANG_LIB

package/ejabberd/ejabberd.mk ifeq ($(BR2_PACKAGE_LINUX_PAM),y) · line 43

Quoted 10 lines
package/ejabberd/ejabberd.mk +3 -1
+
+EJABBERD_ERLANG_LIBS = sasl public_key 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)/lib/erlang" \
      $(foreach lib,$(EJABBERD_ERLANG_LIBS), \
-             ac_cv_erlang_lib_dir_$(lib)="`package/ejabberd/check-erlang-lib $(lib)`")
+             ac_cv_erlang_lib_dir_$(lib)="`./check-erlang-lib $(lib)`")

Why did you change the location of check-erlang-lib ? What was the problem ? It looked like a good idea to directly used it from package/ejabberd/ instead of copying it.

Quoted 7 lines
Quoted 1 line

Could you explain this ?

I changed it because I got "package/ejabberd/check-erlang-lib: command not found" during the configure step.
I guess it is not necessarily in the PATH and the configure is done inside $(@D).
TBH, I don't understand why this was working before.

Originally, this was done with $(shell ....) so it would have worked. Two years
ago, in commit 7d69a79624b1f (signed off by yours truly) all the $(shell ...) constructs were replaced with backticks `` and it stopped working. So it just means all those variables would have been empty (the error messages would have been visible on stderr but nobody looks at them). And I guess that the libraries are just in default locations so it still works even if the lib_dir variables are empty.

To be honest, I find the solution of copying the script a bit fragile. It would
be safer to just prepend $TOPDIR to the path so it is absolute.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#4 lore raw

PATCH v2 1/1 ejabberd: Bump to version 17.11

Hi Arnout,

Quoted 7 lines · Arnout Vandecappelle

Originally, this was done with $(shell ....) so it would have worked. Two years
ago, in commit 7d69a79624b1f (signed off by yours truly) all the $(shell ...) constructs were replaced with backticks `` and it stopped working. So it just means all those variables would have been empty (the error messages would have been visible on stderr but nobody looks at them). And I guess that the libraries are just in default locations so it still works even if the lib_dir variables are empty.

Thanks for the explanation. Indeed, commit 7d69a79624 changed $(shell ...) to backticks and introduces this bug two years ago :-/ As you said, this was only visible on stderr and I notice it when bumping ejabberd to 17.11 only.

Quoted 2 lines

To be honest, I find the solution of copying the script a bit fragile. It would
be safer to just prepend $TOPDIR to the path so it is absolute.

Great, I was not aware of $TOPDIR. I looked for something like PACKAGE_DIR but failed to find a solution and finally resigned to copy this script to $(@D).
I'll send a small patch to remove this unnecessary copy and use $TOPDIR instead. Thanks.

Best,

Signature · 1 line
Johan
#5 lore raw

PATCH v2 1/1 ejabberd: Bump to version 17.11

Quoted 16 lines · Johan Oudinet

Hi Arnout,

Quoted 7 lines · Arnout Vandecappelle

Originally, this was done with $(shell ....) so it would have worked. Two years
ago, in commit 7d69a79624b1f (signed off by yours truly) all the $(shell ...) constructs were replaced with backticks `` and it stopped working. So it just means all those variables would have been empty (the error messages would have been visible on stderr but nobody looks at them). And I guess that the libraries are just in default locations so it still works even if the lib_dir variables are empty.

Thanks for the explanation. Indeed, commit 7d69a79624 changed $(shell ...) to backticks and introduces this bug two years ago :-/ As you said, this was only visible on stderr and I notice it when bumping ejabberd to 17.11 only.

Quoted 6 lines
Quoted 2 lines

To be honest, I find the solution of copying the script a bit fragile. It would
be safer to just prepend $TOPDIR to the path so it is absolute.

Great, I was not aware of $TOPDIR. I looked for something like PACKAGE_DIR but failed to find a solution and finally resigned to copy this script to $(@D).

Right, I forgot about that one! EJABBERD_PKGDIR would work as well. Hm, except,
no, it's actually not an absolute path so that won't work. Pity.

Regards,
Arnout

Quoted 5 lines

I'll send a small patch to remove this unnecessary copy and use $TOPDIR instead. Thanks.

Best,

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF