Skip to contentSkip to conversation

erlang-p1-oauth2: New package

PATCH New Johan Oudinet 2 participants 3 messages Jun 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 erlang-p1-oauth2: New package

OAuth2 library for Erlang
https://github.com/processone/p1_oauth2

---
Changes v2 -> v3:
- Delete changes to ejabberd package that do not belong to this patch

Changes v1 -> v2:
- Fix github URL and rename the package accordingly (suggested by Thomas)
- Add en entry to the DEVELOPERS file

---
 DEVELOPERS                                     |  1 +
 package/Config.in                              |  1 +
 package/erlang-p1-oauth2/Config.in             |  6 ++++++
 package/erlang-p1-oauth2/erlang-p1-oauth2.hash |  2 ++
 package/erlang-p1-oauth2/erlang-p1-oauth2.mk   | 13 +++++++++++++
 5 files changed, 23 insertions(+)
 create mode 100644 package/erlang-p1-oauth2/Config.in
 create mode 100644 package/erlang-p1-oauth2/erlang-p1-oauth2.hash
 create mode 100644 package/erlang-p1-oauth2/erlang-p1-oauth2.mk
DEVELOPERS +1 -0
index cdd38e6655..77a3b6239b 100644
@@ -869,6 +869,7 @@ F:	package/erlang-jiffy/
 F:	package/erlang-lager/
 F:	package/erlang-p1-cache-tab/
 F:	package/erlang-p1-iconv/
+F:	package/erlang-p1-oauth2/
 F:	package/erlang-p1-sip/
 F:	package/erlang-p1-stringprep/
 F:	package/erlang-p1-stun/
package/Config.in +1 -0
index 497cac8b74..ce8ed370de 100644
@@ -515,6 +515,7 @@ menu "Erlang libraries/modules"
 	source "package/erlang-lager/Config.in"
 	source "package/erlang-p1-cache-tab/Config.in"
 	source "package/erlang-p1-iconv/Config.in"
+	source "package/erlang-p1-oauth2/Config.in"
 	source "package/erlang-p1-sip/Config.in"
 	source "package/erlang-p1-stringprep/Config.in"
 	source "package/erlang-p1-stun/Config.in"
package/erlang-p1-oauth2/Config.in new file +6 -0
new file mode 100644
index 0000000000..32e79ec99a
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_ERLANG_P1_OAUTH2
+	bool "erlang-p1-oauth2"
+	help
+	  OAuth2 library for Erlang
+
+	  https://github.com/processone/p1_oauth2
package/erlang-p1-oauth2/erlang-p1-oauth2.hash new file +2 -0
new file mode 100644
index 0000000000..3666519f5f
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 86e4d93f0206135bc6017b6001d061305513917f79c53294e534d6e66fd54727 erlang-p1-oauth2-0.6.1.tar.gz
package/erlang-p1-oauth2/erlang-p1-oauth2.mk new file +13 -0
new file mode 100644
index 0000000000..c85706c8db
@@ -0,0 +1,13 @@
+################################################################################
+#
+# erlang-p1-oauth2
+#
+################################################################################
+
+ERLANG_P1_OAUTH2_VERSION = 0.6.1
+ERLANG_P1_OAUTH2_SITE = $(call github,processone,p1_oauth2,$(ERLANG_P1_OAUTH2_VERSION))
+ERLANG_P1_OAUTH2_LICENSE = MIT
+ERLANG_P1_OAUTH2_LICENSE_FILES = LICENSE
+ERLANG_P1_OAUTH2_INSTALL_STAGING = YES
+
+$(eval $(rebar-package))
Signature · 1 line
2.11.0
#1 lore raw

PATCH v3 2/2 ejabberd: bump to version 17.04

There are new dependencies: erlang-p1-jiffy, erlang-p1-oauth2, erlang-p1-stun, erlang-p1-tls, erlang-p1-utils, erlang-p1-xmpp

as well as two host dependencies on erlang-p1-utils and erlang-p1-xmpp. Otherwise the compilation via rebar fails.

4 patches have been refreshed and a new patch have been introduced to tell rebar to use host dependencies instead of trying to download them. Hopefully this patch could be drop in ejabberd 17.06. Missing SoB in patches have been added as well.

---
Changes v2 -> v3:
- Add changes to package/ejabberd/Config.in that have been introduced to another commit by mistake (suggested by Thomas Petazzoni)
- Add missing SoB in patches (suggested by the check-package script)

Changes v1 -> v2:
- Describe in the commit log the new dependencies and patches

---
 .../0001-remove-make-targets-for-deps.patch        |  42 +------
 ...002-remove-dependencies-from-rebar-config.patch | 129 +++++++++++----------
 .../0003-remove-checking-erlang-version.patch      |   2 +
 package/ejabberd/0004-correct-include.patch        |   2 +
 .../0005-disable-ERLANG_DEPRECATED_CHECK.patch     |   2 +
 .../ejabberd/0006-fix-install-permissions.patch    |  42 +++----
 package/ejabberd/0007-fix-ejabberdctl.patch        |  12 +-
 .../0008-rebar-uses-host-dependencies.patch        |  33 ++++++
 package/ejabberd/Config.in                         |   8 +-
 package/ejabberd/ejabberd.hash                     |   4 +-
 package/ejabberd/ejabberd.mk                       |   6 +-
 11 files changed, 149 insertions(+), 133 deletions(-)
 create mode 100644 package/ejabberd/0008-rebar-uses-host-dependencies.patch
package/ejabberd/0001-remove-make-targets-for-deps.patch +4 -38
index 6917f71f31..aee09670a1 100644
@@ -7,21 +7,18 @@ Without this patch, dependencies would be downloaded and compiled
 using rebar at build time.
 
 Signed-off-by: Frank Hunleth <[email protected]>
----
- Makefile.in | 26 +++-----------------------
- 1 file changed, 3 insertions(+), 23 deletions(-)
 
 diff --git a/Makefile.in b/Makefile.in
-index 08cd837..2a6457c 100644
+index a0b4553d..4190a515 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:
@@ -35,7 +32,7 @@ index 08cd837..2a6457c 100644
 -src: deps/.built
 +src:
  	$(REBAR) skip_deps=true compile
- 
+
 -update:
 -	rm -rf deps/.got
 -	rm -rf deps/.built
@@ -43,34 +40,3 @@ index 08cd837..2a6457c 100644
 -
  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
-
package/ejabberd/0002-remove-dependencies-from-rebar-config.patch +69 -60

148 lines not on this page · raw message

package/ejabberd/0003-remove-checking-erlang-version.patch +2 -0
index ebcdd54645..da3bf2a89e 100644
@@ -6,6 +6,8 @@ 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.
+
+Signed-off-by: Johan Oudinet <[email protected]>
 ---
  configure.ac | 2 --
  1 file changed, 2 deletions(-)
package/ejabberd/0004-correct-include.patch +2 -0
index fd1dee2850..4db7395f75 100644
@@ -6,6 +6,8 @@ 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.
+
+Signed-off-by: Johan Oudinet <[email protected]>
 ---
  src/mod_sip.erl           | 2 +-
  src/mod_sip_proxy.erl     | 2 +-
package/ejabberd/0005-disable-ERLANG_DEPRECATED_CHECK.patch +2 -0
index 4b68f5ff85..09b356219d 100644
@@ -5,6 +5,8 @@ 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.
+
+Signed-off-by: Johan Oudinet <[email protected]>
 ---
  configure.ac | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
package/ejabberd/0006-fix-install-permissions.patch +22 -20

68 lines not on this page · raw message

package/ejabberd/0007-fix-ejabberdctl.patch +3 -9
index 36aa3a707f..ab70d8900a 100644
@@ -7,28 +7,22 @@ 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 f65c21f..ff9225f 100755
+index 5b34ebee..51acaca8 100755
 --- a/ejabberdctl.template
 +++ b/ejabberdctl.template
 @@ -14,9 +14,12 @@ SCRIPT_DIR=`cd ${0%/*} && pwd`
  ERL={{erl}}
  IEX={{bindir}}/iex
- EPMD={{bindir}}/epmd
+ 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"
--- 
-2.5.0
-
package/ejabberd/0008-rebar-uses-host-dependencies.patch new file +33 -0
new file mode 100644
index 0000000000..45f387993e
@@ -0,0 +1,33 @@
+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/Config.in +7 -1
index 5d176c3af6..a7542cd12d 100644
@@ -1,13 +1,19 @@
 config BR2_PACKAGE_EJABBERD
 	bool "ejabberd"
 	depends on BR2_PACKAGE_ERLANG
-	depends on BR2_INSTALL_LIBSTDCPP # stringprep
+	depends on BR2_INSTALL_LIBSTDCPP # jiffy, stringprep
+	select BR2_PACKAGE_ERLANG_JIFFY
 	select BR2_PACKAGE_ERLANG_LAGER
 	select BR2_PACKAGE_ERLANG_P1_CACHE_TAB
 	select BR2_PACKAGE_ERLANG_P1_ICONV
+	select BR2_PACKAGE_ERLANG_P1_OAUTH2
 	select BR2_PACKAGE_ERLANG_P1_SIP
 	select BR2_PACKAGE_ERLANG_P1_STRINGPREP
+	select BR2_PACKAGE_ERLANG_P1_STUN
+	select BR2_PACKAGE_ERLANG_P1_TLS
+	select BR2_PACKAGE_ERLANG_P1_UTILS
 	select BR2_PACKAGE_ERLANG_P1_XML
+	select BR2_PACKAGE_ERLANG_P1_XMPP
 	select BR2_PACKAGE_ERLANG_P1_YAML
 	select BR2_PACKAGE_ERLANG_P1_ZLIB
 	select BR2_PACKAGE_GETENT
package/ejabberd/ejabberd.hash +1 -3
index 4284eec8fb..24a26d21d9 100644
@@ -1,4 +1,2 @@
-# 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
+sha256 b8395bc65b09f135a60320b62338258acd6056cc241e9e245fde267fb18dd3c9 ejabberd-17.04.tgz
package/ejabberd/ejabberd.mk +4 -2
index 66686616ce..a835bc4549 100644
@@ -4,14 +4,16 @@
 #
 ################################################################################
 
-EJABBERD_VERSION = 16.01
+EJABBERD_VERSION = 17.04
 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
 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
+	erlang-p1-stringprep erlang-p1-stun erlang-p1-tls \
+	erlang-p1-utils erlang-p1-xml erlang-p1-xmpp erlang-p1-yaml \
+	erlang-p1-zlib host-erlang-p1-utils host-erlang-p1-xmpp
 
 # 0001-remove-make-targets-for-deps.patch updates Makefile.in
 EJABBERD_USE_AUTOCONF = YES
Signature · 1 line
2.11.0
#2 lore raw

PATCH v3 1/2 erlang-p1-oauth2: New package

In reply to Johan Oudinet

Hello,

Quoted 8 lines · Johan Oudinet

OAuth2 library for Erlang
https://github.com/processone/p1_oauth2

---
Changes v2 -> v3:
- Delete changes to ejabberd package that do not belong to this patch

Both patches applied. Thanks!

Thomas

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