All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server
@ 2015-01-12  9:32 Johan Oudinet
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 01/16] package/erlang: export EI_VSN so other packages can use it Johan Oudinet
                   ` (16 more replies)
  0 siblings, 17 replies; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

Hi All,

Since ejabberd build system relies on rebar to download its
dependencies, we've packaged all of them separately and modified
ejabberd makefile to not download any dependency.

Actually, every erlang package that is introduced here rely on the
rebar software. Thus, we also introduce a new infrastructure to
simplify the development of such packages in buildroot.

Changes v5 -> v6:  (Thomas)
  - erlang-p1-zlib depends on zlib
  - remove extra SoB lines.

Changes v4 -> v5:  (Thomas)
  - rename some variables in pkg-rebar.mk
  - rebar infrastructure adds the dependencies to erlang and host-erlang-rebar
  - update rebar manual accordingly
  - remove unnecessary dependency to erlang for erlang packages
  - add missing links and licenses to some erlang packages

Changes v3 -> v4:
  - fix build and install commands in pkg-rebar.mk.
  - look for erlang libraries in STAGING_DIR instead of TARGET_DIR.
  - run configure script for p1-xml, p1-iconv, and ejabberd packages.

Changes v2 -> v3:
  - split out the autotools patch into the 7 first ones
  - split out the pkg-rebar into patches 8-11
  - other packages left untouched

Changes v1 -> v2:
  - use BR_PATH instead of an hard-coded path in pkg-rebar.mk.
  - update erlang-p1-iconv version to fix a link error with libiconv.

Johan Oudinet (14):
  package/pkg-rebar: new infrastructure
  erlang-goldrush: new package.
  erlang-lager: new package.
  erlang-p1-zlib: new package.
  erlang-p1-yaml: new package.
  erlang-p1-xml: new package.
  erlang-p1-utils: new package.
  erlang-p1-tls: new package.
  erlang-p1-stun: new package.
  erlang-p1-stringprep: new package.
  erlang-p1-sip: new package.
  erlang-p1-iconv: new package.
  erlang-p1-cache-tab: new package.
  ejabberd: new package.

Yann E. MORIN (2):
  package/erlang: export EI_VSN so other packages can use it
  docs/manual: add documentation for the pkg-rebar infrastructure

 docs/manual/adding-packages-rebar.txt              | 102 +++++++++
 docs/manual/adding-packages.txt                    |   2 +
 package/Config.in                                  |  17 ++
 package/Makefile.in                                |   1 +
 package/ejabberd/0001-remove-deps.patch            |  20 ++
 package/ejabberd/0002-disable-rebar-deps.patch     |  70 +++++++
 package/ejabberd/0003-disable-test.patch           |  21 ++
 package/ejabberd/0004-disable-version-check.patch  |  20 ++
 package/ejabberd/0005-fix-includes.patch           |  45 ++++
 package/ejabberd/0006-remove-doc.patch             |  26 +++
 package/ejabberd/0007-fix-init.patch               |  99 +++++++++
 .../ejabberd/0008-fix-install-permissions.patch    |  76 +++++++
 package/ejabberd/Config.in                         |  21 ++
 package/ejabberd/S50ejabberd                       |  35 ++++
 package/ejabberd/check-erlang-lib                  |  55 +++++
 package/ejabberd/ejabberd.mk                       |  52 +++++
 package/erlang-goldrush/Config.in                  |   7 +
 package/erlang-goldrush/erlang-goldrush.mk         |  14 ++
 package/erlang-lager/Config.in                     |  13 ++
 package/erlang-lager/erlang-lager.mk               |  14 ++
 package/erlang-p1-cache-tab/Config.in              |   7 +
 package/erlang-p1-cache-tab/erlang-p1-cache-tab.mk |  13 ++
 package/erlang-p1-iconv/Config.in                  |   7 +
 package/erlang-p1-iconv/erlang-p1-iconv.mk         |  18 ++
 package/erlang-p1-sip/Config.in                    |   9 +
 .../erlang-p1-sip-01-fix-includes.patch            |  19 ++
 package/erlang-p1-sip/erlang-p1-sip.mk             |  14 ++
 package/erlang-p1-stringprep/Config.in             |   6 +
 .../erlang-p1-stringprep/erlang-p1-stringprep.mk   |  12 ++
 package/erlang-p1-stun/Config.in                   |   8 +
 package/erlang-p1-stun/erlang-p1-stun.mk           |  14 ++
 package/erlang-p1-tls/Config.in                    |   6 +
 package/erlang-p1-tls/erlang-p1-tls.mk             |  13 ++
 package/erlang-p1-utils/Config.in                  |   6 +
 package/erlang-p1-utils/erlang-p1-utils.mk         |  13 ++
 package/erlang-p1-xml/Config.in                    |   7 +
 package/erlang-p1-xml/erlang-p1-xml.mk             |  16 ++
 package/erlang-p1-yaml/Config.in                   |   7 +
 package/erlang-p1-yaml/erlang-p1-yaml.mk           |  13 ++
 package/erlang-p1-zlib/Config.in                   |   7 +
 package/erlang-p1-zlib/erlang-p1-zlib.mk           |  13 ++
 package/erlang/erlang.mk                           |   5 +
 package/pkg-rebar.mk                               | 229 +++++++++++++++++++++
 43 files changed, 1172 insertions(+)
 create mode 100644 docs/manual/adding-packages-rebar.txt
 create mode 100644 package/ejabberd/0001-remove-deps.patch
 create mode 100644 package/ejabberd/0002-disable-rebar-deps.patch
 create mode 100644 package/ejabberd/0003-disable-test.patch
 create mode 100644 package/ejabberd/0004-disable-version-check.patch
 create mode 100644 package/ejabberd/0005-fix-includes.patch
 create mode 100644 package/ejabberd/0006-remove-doc.patch
 create mode 100644 package/ejabberd/0007-fix-init.patch
 create mode 100644 package/ejabberd/0008-fix-install-permissions.patch
 create mode 100644 package/ejabberd/Config.in
 create mode 100644 package/ejabberd/S50ejabberd
 create mode 100755 package/ejabberd/check-erlang-lib
 create mode 100644 package/ejabberd/ejabberd.mk
 create mode 100644 package/erlang-goldrush/Config.in
 create mode 100644 package/erlang-goldrush/erlang-goldrush.mk
 create mode 100644 package/erlang-lager/Config.in
 create mode 100644 package/erlang-lager/erlang-lager.mk
 create mode 100644 package/erlang-p1-cache-tab/Config.in
 create mode 100644 package/erlang-p1-cache-tab/erlang-p1-cache-tab.mk
 create mode 100644 package/erlang-p1-iconv/Config.in
 create mode 100644 package/erlang-p1-iconv/erlang-p1-iconv.mk
 create mode 100644 package/erlang-p1-sip/Config.in
 create mode 100644 package/erlang-p1-sip/erlang-p1-sip-01-fix-includes.patch
 create mode 100644 package/erlang-p1-sip/erlang-p1-sip.mk
 create mode 100644 package/erlang-p1-stringprep/Config.in
 create mode 100644 package/erlang-p1-stringprep/erlang-p1-stringprep.mk
 create mode 100644 package/erlang-p1-stun/Config.in
 create mode 100644 package/erlang-p1-stun/erlang-p1-stun.mk
 create mode 100644 package/erlang-p1-tls/Config.in
 create mode 100644 package/erlang-p1-tls/erlang-p1-tls.mk
 create mode 100644 package/erlang-p1-utils/Config.in
 create mode 100644 package/erlang-p1-utils/erlang-p1-utils.mk
 create mode 100644 package/erlang-p1-xml/Config.in
 create mode 100644 package/erlang-p1-xml/erlang-p1-xml.mk
 create mode 100644 package/erlang-p1-yaml/Config.in
 create mode 100644 package/erlang-p1-yaml/erlang-p1-yaml.mk
 create mode 100644 package/erlang-p1-zlib/Config.in
 create mode 100644 package/erlang-p1-zlib/erlang-p1-zlib.mk
 create mode 100644 package/pkg-rebar.mk

-- 
2.1.0

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 01/16] package/erlang: export EI_VSN so other packages can use it
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 02/16] package/pkg-rebar: new infrastructure Johan Oudinet
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

Packages that depend on Erlang may need the Erlang Interface Version
(aka EI_VSN), so just export it.

We do export a static value instead of looking in the file, to avoid
spawning a shell every time the variable is dereferenced.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[johan.oudinet at gmail.com: update EI_VSN since the erlang update]
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 package/erlang/erlang.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/erlang/erlang.mk b/package/erlang/erlang.mk
index 81ac436..0c76531 100644
--- a/package/erlang/erlang.mk
+++ b/package/erlang/erlang.mk
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# See note below when updating Erlang
 ERLANG_VERSION = 17.4
 ERLANG_SITE = http://www.erlang.org/download
 ERLANG_SOURCE = otp_src_$(ERLANG_VERSION).tar.gz
@@ -16,6 +17,10 @@ ERLANG_INSTALL_STAGING = YES
 # Touching erts/configure.in
 ERLANG_AUTORECONF = YES
 
+# Whenever updating Erlang, this value should be updated as well, to the
+# value of EI_VSN in the file lib/erl_interface/vsn.mk
+ERLANG_EI_VSN = 3.7.20
+
 # The configure checks for these functions fail incorrectly
 ERLANG_CONF_ENV = ac_cv_func_isnan=yes ac_cv_func_isinf=yes
 
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 02/16] package/pkg-rebar: new infrastructure
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 01/16] package/erlang: export EI_VSN so other packages can use it Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-02-03  9:28   ` Thomas Petazzoni
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 03/16] docs/manual: add documentation for the pkg-rebar infrastructure Johan Oudinet
                   ` (14 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

Ease the development of packages that use the erlang rebar tool as
their build system.

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
[yann.morin.1998 at free.fr: split the patch into semantically separated
patches; large rewrites of the rest]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>

---
Changes v4 -> v5:  (Thomas)
  - commonalise more variables
  - slightly-more obvious extract of raw package name
  - rename some variables
  - fix some comments

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 package/Makefile.in  |   1 +
 package/pkg-rebar.mk | 229 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 230 insertions(+)
 create mode 100644 package/pkg-rebar.mk

diff --git a/package/Makefile.in b/package/Makefile.in
index 2055f00..70529f8 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -416,3 +416,4 @@ include package/pkg-python.mk
 include package/pkg-virtual.mk
 include package/pkg-generic.mk
 include package/pkg-kconfig.mk
+include package/pkg-rebar.mk
diff --git a/package/pkg-rebar.mk b/package/pkg-rebar.mk
new file mode 100644
index 0000000..05158ed
--- /dev/null
+++ b/package/pkg-rebar.mk
@@ -0,0 +1,229 @@
+################################################################################
+# rebar package infrastructure for Erlang packages
+#
+# This file implements an infrastructure that eases development of
+# package .mk files for rebar packages.  It should be used for all
+# packages that use rebar as their build system.
+#
+# In terms of implementation, this rebar infrastructure requires the
+# .mk file to only specify metadata information about the package:
+# name, version, download URL, etc.
+#
+# We still allow the package .mk file to override what the different
+# steps are doing, if needed. For example, if <PKG>_BUILD_CMDS is
+# already defined, it is used as the list of commands to perform to
+# build the package, instead of the default rebar behaviour. The
+# package can also define some post operation hooks.
+#
+################################################################################
+
+# Directories to store rebar dependencies in.
+#
+# These directories actually only contain symbolic links to Erlang
+# applications in either $(HOST_DIR) or $(STAGING_DIR).  One needs
+# them to avoid rebar complaining about missing dependencies, as this
+# infrastructure tells rebar to NOT download dependencies during
+# the build stage.
+#
+REBAR_HOST_DEPS_DIR = $(HOST_DIR)/usr/share/rebar/deps
+REBAR_TARGET_DEPS_DIR = $(STAGING_DIR)/usr/share/rebar/deps
+
+# Tell rebar where to find the dependencies
+#
+REBAR_HOST_DEPS_ENV = \
+	ERL_COMPILER_OPTIONS='{i, "$(REBAR_HOST_DEPS_DIR)"}' \
+	ERL_EI_LIBDIR=$(HOST_DIR)/usr/lib/erlang/lib/erl_interface-$(ERLANG_EI_VSN)/lib
+REBAR_TARGET_DEPS_ENV = \
+	ERL_COMPILER_OPTIONS='{i, "$(REBAR_TARGET_DEPS_DIR)"}' \
+	ERL_EI_LIBDIR=$(STAGING_DIR)/usr/lib/erlang/lib/erl_interface-$(ERLANG_EI_VSN)/lib
+
+################################################################################
+# Helper functions
+################################################################################
+
+# Install an Erlang application from $(@D).
+#
+# i.e., define a recipe that installs the "ebin priv $(2)" directories
+# from $(@D) to $(1)$($(PKG)_ERLANG_LIBDIR).
+#
+#  argument 1 should typically be $(HOST_DIR), $(TARGET_DIR),
+#	      or $(STAGING_DIR).
+#  argument 2 is typically empty when installing in $(TARGET_DIR) and
+#             "include" when installing in $(HOST_DIR) or
+#             $(STAGING_DIR).
+#
+# Note: calling this function must be done with $$(call ...) because it
+# expands package-related variables.
+#
+define install-erlang-directories
+	$(INSTALL) -d $(1)/$($(PKG)_ERLANG_LIBDIR)
+	for dir in ebin priv $(2); do                                   \
+		if test -d $(@D)/$$dir; then                            \
+			cp -r $(@D)/$$dir $(1)$($(PKG)_ERLANG_LIBDIR);  \
+		fi;                                                     \
+	done
+endef
+
+# Setup a symbolic link in rebar's deps_dir to the actual location
+# where an Erlang application is installed.
+#
+# i.e., define a recipe that creates a symbolic link
+# from $($(PKG)_REBAR_DEPS_DIR)/$($(PKG)_ERLANG_APP)
+# to $(1)$($(PKG)_ERLANG_LIBDIR).
+#
+# One typically uses this to setup symbolic links from
+# $(BUILD_DIR)/rebar-deps/<HOST_OR_TARGET>/<ERLANG_APP> to the
+# appropriate application directory in $(HOST_DIR) or $(STAGING_DIR).
+# This avoids rebar complaining about missing dependencies, as this
+# infrastructure tells rebar to NOT download dependencies during
+# the build stage.
+#
+# Therefore,
+#  argument 1 is $(HOST_DIR) (for host packages) or
+#	      $(STAGING_DIR) (for target packages).
+#
+#  argument 2 is HOST (for host packages) or
+#	      TARGET (for target packages).
+#
+# Note: calling this function must be done with $$(call ...) because it
+# expands package-related variables.
+#
+define install-rebar-deps
+	$(INSTALL) -d $(REBAR_$(2)_DEPS_DIR)
+	ln -f -s $(1)/$($(PKG)_ERLANG_LIBDIR) \
+		$(REBAR_$(2)_DEPS_DIR)/$($(PKG)_ERLANG_APP)
+endef
+
+################################################################################
+# inner-rebar-package -- defines how the configuration, compilation
+# and installation of a rebar package should be done, implements a few
+# hooks to tune the build process according to rebar specifities, and
+# calls the generic package infrastructure to generate the necessary
+# make targets.
+#
+#  argument 1 is the lowercase package name
+#  argument 2 is the uppercase package name, including a HOST_ prefix
+#             for host packages
+#  argument 3 is the uppercase package name, without the HOST_ prefix
+#             for host packages
+#  argument 4 is the type (target or host)
+#
+################################################################################
+
+define inner-rebar-package
+
+# Extract just the raw package name, lowercase without the leading
+# erlang- or host- prefix, as this is used by rebar to find the
+# dependencies a package specifies.
+#
+$(2)_ERLANG_APP = $(subst -,_,$(patsubst erlang-%,%,$(patsubst host-%,%,$(1))))
+
+# Path where to store the package's libs, relative to either $(HOST_DIR)
+# for host packages, or $(STAGING_DIR) for target packages.
+#
+$(2)_ERLANG_LIBDIR = \
+	/usr/lib/erlang/lib/$$($$(PKG)_ERLANG_APP)-$$($$(PKG)_VERSION)
+
+# Whether to use the generic rebar or the package's bundled rebar
+#
+ifeq ($$($(2)_USE_BUNDLED_REBAR),YES)
+$(2)_REBAR = ./rebar
+else
+$(2)_REBAR = rebar
+ifndef $(2)_DEPENDENCIES
+$(3)_DEPENDENCIES += host-erlang-rebar
+else
+$(2)_DEPENDENCIES += host-erlang-rebar
+endif
+endif
+
+
+# Define the build and install commands
+#
+ifeq ($(4),target)
+
+# Target packages need the erlang interpreter on the target
+$(2)_DEPENDENCIES += erlang
+
+# Used only if the package uses autotools underneath; otherwise, ignored
+$(2)_CONF_ENV += $$(REBAR_TARGET_DEPS_ENV)
+
+ifndef $(2)_BUILD_CMDS
+define $(2)_BUILD_CMDS
+	(cd $$(@D); \
+		CC="$$(TARGET_CC)" \
+		CFLAGS="$$(TARGET_CFLAGS)" \
+		LDFLAGS="$$(TARGET_LDFLAGS)" \
+		$$(REBAR_TARGET_DEPS_ENV) \
+		$$(TARGET_MAKE_ENV) \
+		$$($$(PKG)_REBAR_ENV) $$($$(PKG)_REBAR) deps_dir=$$(REBAR_TARGET_DEPS_DIR) compile \
+	)
+endef
+endif
+
+# We need to double-$ the 'call' because it wants to expand
+# package-related variables
+ifndef $(2)_INSTALL_STAGING_CMDS
+define $(2)_INSTALL_STAGING_CMDS
+	$$(call install-erlang-directories,$$(STAGING_DIR),include)
+	$$(call install-rebar-deps,$$(STAGING_DIR),TARGET)
+endef
+endif
+
+# We need to double-$ the 'call' because it wants to expand
+# package-related variables
+ifndef $(2)_INSTALL_TARGET_CMDS
+define $(2)_INSTALL_TARGET_CMDS
+	$$(call install-erlang-directories,$$(TARGET_DIR))
+endef
+endif
+
+else # !target
+
+# Host packages need the erlang interpreter on the host
+# If $(2)_DEPENDENCIES is empty, add it to $(3)_DEPENDENCIES so the
+# filter-out rule from pkg-generic still apply.
+ifndef $(2)_DEPENDENCIES
+$(3)_DEPENDENCIES += host-erlang
+else
+$(2)_DEPENDENCIES += host-erlang
+endif
+
+# Used only if the package uses autotools underneath; otherwise, ignored
+$(2)_CONF_ENV += $$(REBAR_HOST_DEPS_ENV)
+
+ifndef $(2)_BUILD_CMDS
+define $(2)_BUILD_CMDS
+	cd '$$(@D)'; \
+	CC='$$(HOST_CC)' \
+	CFLAGS='$$(HOST_CFLAGS)' \
+	LDFLAGS='$$(HOST_LDFLAGS)' \
+	$$(REBAR_HOST_DEPS_ENV) \
+	$$(HOST_MAKE_ENV) \
+	$$($$(PKG)_REBAR_ENV) $$($$(PKG)_REBAR) deps_dir=$$(REBAR_HOST_DEPS_DIR) compile
+endef
+endif
+
+# We need to double-$ the 'call' because it wants to expand
+# package-related variables
+ifndef $(2)_INSTALL_CMDS
+define $(2)_INSTALL_CMDS
+	$$(call install-erlang-directories,$$(HOST_DIR),include)
+	$$(call install-rebar-deps,$$(HOST_DIR),HOST)
+endef
+endif
+
+endif # !target
+
+# The package sub-infra to use
+#
+ifeq ($$($(2)_USE_AUTOCONF),YES)
+$(call inner-autotools-package,$(1),$(2),$(3),$(4))
+else
+$(call inner-generic-package,$(1),$(2),$(3),$(4))
+endif
+
+endef # inner-rebar-package
+
+rebar-package = $(call inner-rebar-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target)
+host-rebar-package = $(call inner-rebar-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host)
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 03/16] docs/manual: add documentation for the pkg-rebar infrastructure
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 01/16] package/erlang: export EI_VSN so other packages can use it Johan Oudinet
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 02/16] package/pkg-rebar: new infrastructure Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 04/16] erlang-goldrush: new package Johan Oudinet
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
[yann.morin.1998 at free.fr: split the doc into its own patch]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

---
Changes v4 -> v5:  (Thomas)
  - drop unused variables
  - drop implementation details
  - properly document the autotools case
  - add missing licensing variables
  - some rewording about everywhere  (YEM)

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 docs/manual/adding-packages-rebar.txt | 102 ++++++++++++++++++++++++++++++++++
 docs/manual/adding-packages.txt       |   2 +
 2 files changed, 104 insertions(+)
 create mode 100644 docs/manual/adding-packages-rebar.txt

diff --git a/docs/manual/adding-packages-rebar.txt b/docs/manual/adding-packages-rebar.txt
new file mode 100644
index 0000000..be9ede0
--- /dev/null
+++ b/docs/manual/adding-packages-rebar.txt
@@ -0,0 +1,102 @@
+// -*- mode:doc; -*-
+// vim: set syntax=asciidoc:
+
+=== Infrastructure for rebar-based packages
+
+[[rebar-package-tutorial]]
+
+==== +rebar-package+ tutorial
+
+First, let's see how to write a +.mk+ file for a rebar-based package,
+with an example :
+
+------------------------------
+01: ################################################################################
+02: #
+03: # erlang-foobar
+04: #
+05: ################################################################################
+06:
+07: ERLANG_FOOBAR_VERSION = 1.0
+08: ERLANG_FOOBAR_SOURCE = erlang-foobar-$(ERLANG_FOOBAR_VERSION).tar.xz
+09: ERLANG_FOOBAR_SITE = http://www.foosoftware.org/download
+10: ERLANG_FOOBAR_DEPENDENCIES = host-libaaa libbbb
+11:
+12: $(eval $(rebar-package))
+--------------------------------
+
+On line 7, we declare the version of the package.
+
+On line 8 and 9, we declare the name of the tarball (xz-ed tarball
+recommended) and the location of the tarball on the Web. Buildroot
+will automatically download the tarball from this location.
+
+On line 10, we declare our dependencies, so that they are built
+before the build process of our package starts.
+
+Finally, on line 12, we invoke the +rebar-package+ macro that
+generates all the Makefile rules that actually allows the package to
+be built.
+
+[[rebar-package-reference]]
+
+==== +rebar-package+ reference
+
+The main macro of the +rebar+ package infrastructure is
++rebar-package+. It is similar to the +generic-package+ macro. The
+ability to have host packages is also available, with the
++host-rebar-package+ macro.
+
+Just like the generic infrastructure, the +rebar+ infrastructure works
+by defining a number of variables before calling the +rebar-package+
+macro.
+
+First, all the package metadata information variables that exist in
+the generic infrastructure also exist in the +rebar+ infrastructure:
++ERLANG_FOOBAR_VERSION+, +ERLANG_FOOBAR_SOURCE+,
++ERLANG_FOOBAR_PATCH+, +ERLANG_FOOBAR_SITE+,
++ERLANG_FOOBAR_SUBDIR+, +ERLANG_FOOBAR_DEPENDENCIES+,
++ERLANG_FOOBAR_INSTALL_STAGING+, +ERLANG_FOOBAR_INSTALL_TARGET+,
++ERLANG_FOOBAR_LICENSE+ and +ERLANG_FOOBAR_LICENSE_FILES+.
+
+A few additional variables, specific to the +rebar+ infrastructure,
+can also be defined. Many of them are only useful in very specific
+cases, typical packages will therefore only use a few of them.
+
+* +ERLANG_FOOBAR_USE_AUTOCONF+, to specify that the package uses
+  _autoconf_ at the configuration step.  When a package sets this
+  variable to +YES+, the +autotools+ infrastructure is used.
++
+.Note
+You can also use some of the variables from the +autotools+
+  infrastructure: +ERLANG_FOOBAR_CONF_ENV+, +ERLANG_FOOBAR_CONF_OPTS+,
+  +ERLANG_FOOBAR_AUTORECONF+, +ERLANG_FOOBAR_AUTORECONF_ENV+ and
+  +ERLANG_FOOBAR_AUTORECONF_OPTS+.
+
+* +ERLANG_FOOBAR_USE_BUNDLED_REBAR+, to specify that the package has
+  a bundled version of _rebar_ *and* that it shall be used. Valid
+  values are +YES+ or +NO+ (the default).
++
+.Note
+If the package bundles a _rebar_ utility, but can use the generic
+  one that Buildroot provides, just say +NO+ (i.e., do not specify
+  this variable). Only set if it is mandatory to use the _rebar_
+  utility bundled in this package.
+
+* +ERLANG_FOOBAR_REBAR_ENV+, to specify additional environment
+  variables to pass to the _rebar_ utility.
+
+With the rebar infrastructure, all the steps required to build
+and install the packages are already defined, and they generally work
+well for most rebar-based packages. However, when required, it is
+still possible to customize what is done in any particular step:
+
+* By adding a post-operation hook (after extract, patch, configure,
+  build or install). See xref:hooks[] for details.
+
+* By overriding one of the steps. For example, even if the rebar
+  infrastructure is used, if the package +.mk+ file defines its
+  own +ERLANG_FOOBAR_BUILD_CMDS+ variable, it will be used instead
+  of the default rebar one. However, using this method should be
+  restricted to very specific cases. Do not use it in the general
+  case.
diff --git a/docs/manual/adding-packages.txt b/docs/manual/adding-packages.txt
index feb0d13..b8674f8 100644
--- a/docs/manual/adding-packages.txt
+++ b/docs/manual/adding-packages.txt
@@ -27,6 +27,8 @@ include::adding-packages-virtual.txt[]
 
 include::adding-packages-kconfig.txt[]
 
+include::adding-packages-rebar.txt[]
+
 include::adding-packages-asciidoc.txt[]
 
 include::adding-packages-hooks.txt[]
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 04/16] erlang-goldrush: new package.
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
                   ` (2 preceding siblings ...)
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 03/16] docs/manual: add documentation for the pkg-rebar infrastructure Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 05/16] erlang-lager: " Johan Oudinet
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 package/Config.in                          |  5 +++++
 package/erlang-goldrush/Config.in          |  7 +++++++
 package/erlang-goldrush/erlang-goldrush.mk | 14 ++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 package/erlang-goldrush/Config.in
 create mode 100644 package/erlang-goldrush/erlang-goldrush.mk

diff --git a/package/Config.in b/package/Config.in
index 10e50c2..ca2708a 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -398,6 +398,11 @@ endmenu
 menu "Interpreter languages and scripting"
 	source "package/enscript/Config.in"
 	source "package/erlang/Config.in"
+if BR2_PACKAGE_ERLANG
+menu "Erlang libraries/modules"
+	source "package/erlang-goldrush/Config.in"
+endmenu
+endif
 	source "package/guile/Config.in"
 	source "package/haserl/Config.in"
 	source "package/jamvm/Config.in"
diff --git a/package/erlang-goldrush/Config.in b/package/erlang-goldrush/Config.in
new file mode 100644
index 0000000..2ee579a
--- /dev/null
+++ b/package/erlang-goldrush/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_ERLANG_GOLDRUSH
+	bool "erlang-goldrush"
+	help
+	  Goldrush is a small Erlang app that provides fast event
+	  stream processing.
+
+	  https://github.com/DeadZen/goldrush
diff --git a/package/erlang-goldrush/erlang-goldrush.mk b/package/erlang-goldrush/erlang-goldrush.mk
new file mode 100644
index 0000000..b18a8ec
--- /dev/null
+++ b/package/erlang-goldrush/erlang-goldrush.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# erlang-goldrush
+#
+################################################################################
+
+ERLANG_GOLDRUSH_VERSION = 0.1.6
+ERLANG_GOLDRUSH_SITE = $(call github,DeadZen,goldrush,$(ERLANG_GOLDRUSH_VERSION))
+ERLANG_GOLDRUSH_LICENSE = ISC
+ERLANG_GOLDRUSH_LICENSE_FILES = LICENSE
+ERLANG_GOLDRUSH_INSTALL_STAGING = YES
+
+$(eval $(rebar-package))
+$(eval $(host-rebar-package))
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 05/16] erlang-lager: new package.
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
                   ` (3 preceding siblings ...)
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 04/16] erlang-goldrush: new package Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-02-03  9:29   ` Thomas Petazzoni
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 06/16] erlang-p1-zlib: " Johan Oudinet
                   ` (11 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 package/Config.in                    |  1 +
 package/erlang-lager/Config.in       | 13 +++++++++++++
 package/erlang-lager/erlang-lager.mk | 14 ++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 package/erlang-lager/Config.in
 create mode 100644 package/erlang-lager/erlang-lager.mk

diff --git a/package/Config.in b/package/Config.in
index ca2708a..fb1a060 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -401,6 +401,7 @@ menu "Interpreter languages and scripting"
 if BR2_PACKAGE_ERLANG
 menu "Erlang libraries/modules"
 	source "package/erlang-goldrush/Config.in"
+	source "package/erlang-lager/Config.in"
 endmenu
 endif
 	source "package/guile/Config.in"
diff --git a/package/erlang-lager/Config.in b/package/erlang-lager/Config.in
new file mode 100644
index 0000000..b7994fe
--- /dev/null
+++ b/package/erlang-lager/Config.in
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_ERLANG_LAGER
+	bool "erlang-lager"
+	select BR2_PACKAGE_ERLANG_GOLDRUSH
+	help
+	  Logging framework for Erlang.
+	  
+	  Lager (as in the beer) is a logging framework for
+	  Erlang. Its purpose is to provide a more traditional way to
+	  perform logging in an erlang application that plays nicely
+	  with traditional UNIX logging tools like logrotate and
+	  syslog.
+
+	  https://github.com/basho/lager
diff --git a/package/erlang-lager/erlang-lager.mk b/package/erlang-lager/erlang-lager.mk
new file mode 100644
index 0000000..b725bfd
--- /dev/null
+++ b/package/erlang-lager/erlang-lager.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# erlang-lager
+#
+################################################################################
+
+ERLANG_LAGER_VERSION = 2.0.3
+ERLANG_LAGER_SITE = $(call github,basho,lager,$(ERLANG_LAGER_VERSION))
+ERLANG_LAGER_LICENSE = Apache-2.0
+ERLANG_LAGER_LICENSE_FILES = LICENSE
+ERLANG_LAGER_DEPENDENCIES = erlang-goldrush
+
+$(eval $(rebar-package))
+$(eval $(host-rebar-package))
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 06/16] erlang-p1-zlib: new package.
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
                   ` (4 preceding siblings ...)
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 05/16] erlang-lager: " Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 07/16] erlang-p1-yaml: " Johan Oudinet
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>

---
Changes v5 -> v6:  (Thomas)
  - add dependency to zlib.

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 package/Config.in                        |  1 +
 package/erlang-p1-zlib/Config.in         |  7 +++++++
 package/erlang-p1-zlib/erlang-p1-zlib.mk | 13 +++++++++++++
 3 files changed, 21 insertions(+)
 create mode 100644 package/erlang-p1-zlib/Config.in
 create mode 100644 package/erlang-p1-zlib/erlang-p1-zlib.mk

diff --git a/package/Config.in b/package/Config.in
index fb1a060..883c3ac 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -402,6 +402,7 @@ if BR2_PACKAGE_ERLANG
 menu "Erlang libraries/modules"
 	source "package/erlang-goldrush/Config.in"
 	source "package/erlang-lager/Config.in"
+	source "package/erlang-p1-zlib/Config.in"
 endmenu
 endif
 	source "package/guile/Config.in"
diff --git a/package/erlang-p1-zlib/Config.in b/package/erlang-p1-zlib/Config.in
new file mode 100644
index 0000000..b7e48a1
--- /dev/null
+++ b/package/erlang-p1-zlib/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_ERLANG_P1_ZLIB
+	bool "erlang-p1-zlib"
+	select BR2_PACKAGE_ZLIB
+	help
+	  Erlang interface to zlib
+
+	  https://github.com/processone/zlib
diff --git a/package/erlang-p1-zlib/erlang-p1-zlib.mk b/package/erlang-p1-zlib/erlang-p1-zlib.mk
new file mode 100644
index 0000000..4ba3332
--- /dev/null
+++ b/package/erlang-p1-zlib/erlang-p1-zlib.mk
@@ -0,0 +1,13 @@
+################################################################################
+#
+# erlang-p1-zlib
+#
+################################################################################
+
+ERLANG_P1_ZLIB_VERSION = 52e82bb
+ERLANG_P1_ZLIB_SITE = $(call github,processone,zlib,$(ERLANG_P1_ZLIB_VERSION))
+ERLANG_P1_ZLIB_LICENSE = GPLv2+
+ERLANG_P1_ZLIB_LICENSE_FILES = COPYING
+ERLANG_P1_ZLIB_DEPENDENCIES = zlib
+
+$(eval $(rebar-package))
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 07/16] erlang-p1-yaml: new package.
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
                   ` (5 preceding siblings ...)
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 06/16] erlang-p1-zlib: " Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 08/16] erlang-p1-xml: " Johan Oudinet
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 package/Config.in                        |  1 +
 package/erlang-p1-yaml/Config.in         |  7 +++++++
 package/erlang-p1-yaml/erlang-p1-yaml.mk | 13 +++++++++++++
 3 files changed, 21 insertions(+)
 create mode 100644 package/erlang-p1-yaml/Config.in
 create mode 100644 package/erlang-p1-yaml/erlang-p1-yaml.mk

diff --git a/package/Config.in b/package/Config.in
index 883c3ac..6dca5f7 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -402,6 +402,7 @@ if BR2_PACKAGE_ERLANG
 menu "Erlang libraries/modules"
 	source "package/erlang-goldrush/Config.in"
 	source "package/erlang-lager/Config.in"
+	source "package/erlang-p1-yaml/Config.in"
 	source "package/erlang-p1-zlib/Config.in"
 endmenu
 endif
diff --git a/package/erlang-p1-yaml/Config.in b/package/erlang-p1-yaml/Config.in
new file mode 100644
index 0000000..25c9b02
--- /dev/null
+++ b/package/erlang-p1-yaml/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_ERLANG_P1_YAML
+	bool "erlang-p1-yaml"
+	select BR2_PACKAGE_LIBYAML
+	help
+	  Erlang wrapper for libyaml C library
+
+	  https://github.com/processone/p1_yaml
diff --git a/package/erlang-p1-yaml/erlang-p1-yaml.mk b/package/erlang-p1-yaml/erlang-p1-yaml.mk
new file mode 100644
index 0000000..346e398
--- /dev/null
+++ b/package/erlang-p1-yaml/erlang-p1-yaml.mk
@@ -0,0 +1,13 @@
+################################################################################
+#
+# erlang-p1-yaml
+#
+################################################################################
+
+ERLANG_P1_YAML_VERSION = 236b943
+ERLANG_P1_YAML_SITE = $(call github,processone,p1_yaml,$(ERLANG_P1_YAML_VERSION))
+ERLANG_P1_YAML_LICENSE = Apache-2.0
+ERLANG_P1_YAML_LICENSE_FILES = COPYING
+ERLANG_P1_YAML_DEPENDENCIES = libyaml
+
+$(eval $(rebar-package))
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 08/16] erlang-p1-xml: new package.
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
                   ` (6 preceding siblings ...)
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 07/16] erlang-p1-yaml: " Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-02-03  9:29   ` Thomas Petazzoni
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 09/16] erlang-p1-utils: " Johan Oudinet
                   ` (8 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 package/Config.in                      |  1 +
 package/erlang-p1-xml/Config.in        |  7 +++++++
 package/erlang-p1-xml/erlang-p1-xml.mk | 16 ++++++++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 package/erlang-p1-xml/Config.in
 create mode 100644 package/erlang-p1-xml/erlang-p1-xml.mk

diff --git a/package/Config.in b/package/Config.in
index 6dca5f7..e271b9f 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -402,6 +402,7 @@ if BR2_PACKAGE_ERLANG
 menu "Erlang libraries/modules"
 	source "package/erlang-goldrush/Config.in"
 	source "package/erlang-lager/Config.in"
+	source "package/erlang-p1-xml/Config.in"
 	source "package/erlang-p1-yaml/Config.in"
 	source "package/erlang-p1-zlib/Config.in"
 endmenu
diff --git a/package/erlang-p1-xml/Config.in b/package/erlang-p1-xml/Config.in
new file mode 100644
index 0000000..a6f4bd7
--- /dev/null
+++ b/package/erlang-p1-xml/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_ERLANG_P1_XML
+	bool "erlang-p1-xml"
+	select BR2_PACKAGE_EXPAT
+	help
+	  XML utilities for Erlang
+
+	  https://github.com/processone/xml
diff --git a/package/erlang-p1-xml/erlang-p1-xml.mk b/package/erlang-p1-xml/erlang-p1-xml.mk
new file mode 100644
index 0000000..ea5d058
--- /dev/null
+++ b/package/erlang-p1-xml/erlang-p1-xml.mk
@@ -0,0 +1,16 @@
+################################################################################
+#
+# erlang-p1-xml
+#
+################################################################################
+
+ERLANG_P1_XML_VERSION = b530983
+ERLANG_P1_XML_SITE = $(call github,processone,xml,$(ERLANG_P1_XML_VERSION))
+ERLANG_P1_XML_LICENSE = GPLv2
+ERLANG_P1_XML_LICENSE_FILES = COPYING
+ERLANG_P1_XML_DEPENDENCIES = expat
+ERLANG_P1_XML_INSTALL_STAGING = YES
+
+ERLANG_P1_XML_USE_AUTOCONF = YES
+
+$(eval $(rebar-package))
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 09/16] erlang-p1-utils: new package.
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
                   ` (7 preceding siblings ...)
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 08/16] erlang-p1-xml: " Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 10/16] erlang-p1-tls: " Johan Oudinet
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 package/Config.in                          |  1 +
 package/erlang-p1-utils/Config.in          |  6 ++++++
 package/erlang-p1-utils/erlang-p1-utils.mk | 13 +++++++++++++
 3 files changed, 20 insertions(+)
 create mode 100644 package/erlang-p1-utils/Config.in
 create mode 100644 package/erlang-p1-utils/erlang-p1-utils.mk

diff --git a/package/Config.in b/package/Config.in
index e271b9f..2879ad0 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -402,6 +402,7 @@ if BR2_PACKAGE_ERLANG
 menu "Erlang libraries/modules"
 	source "package/erlang-goldrush/Config.in"
 	source "package/erlang-lager/Config.in"
+	source "package/erlang-p1-utils/Config.in"
 	source "package/erlang-p1-xml/Config.in"
 	source "package/erlang-p1-yaml/Config.in"
 	source "package/erlang-p1-zlib/Config.in"
diff --git a/package/erlang-p1-utils/Config.in b/package/erlang-p1-utils/Config.in
new file mode 100644
index 0000000..a82e5f7
--- /dev/null
+++ b/package/erlang-p1-utils/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_ERLANG_P1_UTILS
+	bool "erlang-p1-utils"
+	help
+	  Set of small Erlang libraries
+
+	  https://github.com/processone/p1_utils
diff --git a/package/erlang-p1-utils/erlang-p1-utils.mk b/package/erlang-p1-utils/erlang-p1-utils.mk
new file mode 100644
index 0000000..0e63031
--- /dev/null
+++ b/package/erlang-p1-utils/erlang-p1-utils.mk
@@ -0,0 +1,13 @@
+################################################################################
+#
+# erlang-p1-utils
+#
+################################################################################
+
+ERLANG_P1_UTILS_VERSION = 940f42d
+ERLANG_P1_UTILS_SITE = $(call github,processone,p1_utils,$(ERLANG_P1_UTILS_VERSION))
+ERLANG_P1_UTILS_LICENSE = GPLv2+
+ERLANG_P1_UTILS_LICENSE_FILES = COPYING
+ERLANG_P1_UTILS_INSTALL_STAGING = YES
+
+$(eval $(rebar-package))
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 10/16] erlang-p1-tls: new package.
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
                   ` (8 preceding siblings ...)
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 09/16] erlang-p1-utils: " Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 11/16] erlang-p1-stun: " Johan Oudinet
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 package/Config.in                      |  1 +
 package/erlang-p1-tls/Config.in        |  6 ++++++
 package/erlang-p1-tls/erlang-p1-tls.mk | 13 +++++++++++++
 3 files changed, 20 insertions(+)
 create mode 100644 package/erlang-p1-tls/Config.in
 create mode 100644 package/erlang-p1-tls/erlang-p1-tls.mk

diff --git a/package/Config.in b/package/Config.in
index 2879ad0..bdb4263 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -402,6 +402,7 @@ if BR2_PACKAGE_ERLANG
 menu "Erlang libraries/modules"
 	source "package/erlang-goldrush/Config.in"
 	source "package/erlang-lager/Config.in"
+	source "package/erlang-p1-tls/Config.in"
 	source "package/erlang-p1-utils/Config.in"
 	source "package/erlang-p1-xml/Config.in"
 	source "package/erlang-p1-yaml/Config.in"
diff --git a/package/erlang-p1-tls/Config.in b/package/erlang-p1-tls/Config.in
new file mode 100644
index 0000000..42c6a3e
--- /dev/null
+++ b/package/erlang-p1-tls/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_ERLANG_P1_TLS
+	bool "erlang-p1-tls"
+	help
+	  Erlang interface to OpenSSL
+
+	  https://github.com/processone/tls
diff --git a/package/erlang-p1-tls/erlang-p1-tls.mk b/package/erlang-p1-tls/erlang-p1-tls.mk
new file mode 100644
index 0000000..d6e5801
--- /dev/null
+++ b/package/erlang-p1-tls/erlang-p1-tls.mk
@@ -0,0 +1,13 @@
+################################################################################
+#
+# erlang-p1-tls
+#
+################################################################################
+
+ERLANG_P1_TLS_VERSION = 53f0478
+ERLANG_P1_TLS_SITE = $(call github,processone,tls,$(ERLANG_P1_TLS_VERSION))
+ERLANG_P1_TLS_LICENSE = GPLv2+
+ERLANG_P1_TLS_LICENSE_FILES = COPYING
+ERLANG_P1_TLS_INSTALL_STAGING = YES
+
+$(eval $(rebar-package))
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 11/16] erlang-p1-stun: new package.
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
                   ` (9 preceding siblings ...)
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 10/16] erlang-p1-tls: " Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 12/16] erlang-p1-stringprep: " Johan Oudinet
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 package/Config.in                        |  1 +
 package/erlang-p1-stun/Config.in         |  8 ++++++++
 package/erlang-p1-stun/erlang-p1-stun.mk | 14 ++++++++++++++
 3 files changed, 23 insertions(+)
 create mode 100644 package/erlang-p1-stun/Config.in
 create mode 100644 package/erlang-p1-stun/erlang-p1-stun.mk

diff --git a/package/Config.in b/package/Config.in
index bdb4263..5a2707e 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -402,6 +402,7 @@ if BR2_PACKAGE_ERLANG
 menu "Erlang libraries/modules"
 	source "package/erlang-goldrush/Config.in"
 	source "package/erlang-lager/Config.in"
+	source "package/erlang-p1-stun/Config.in"
 	source "package/erlang-p1-tls/Config.in"
 	source "package/erlang-p1-utils/Config.in"
 	source "package/erlang-p1-xml/Config.in"
diff --git a/package/erlang-p1-stun/Config.in b/package/erlang-p1-stun/Config.in
new file mode 100644
index 0000000..70cdd91
--- /dev/null
+++ b/package/erlang-p1-stun/Config.in
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_ERLANG_P1_STUN
+	bool "erlang-p1-stun"
+	select BR2_PACKAGE_ERLANG_P1_TLS
+	select BR2_PACKAGE_ERLANG_P1_UTILS
+	help
+	  STUN library for Erlang
+
+	  https://github.com/processone/stun
diff --git a/package/erlang-p1-stun/erlang-p1-stun.mk b/package/erlang-p1-stun/erlang-p1-stun.mk
new file mode 100644
index 0000000..7b4b1a9
--- /dev/null
+++ b/package/erlang-p1-stun/erlang-p1-stun.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# erlang-p1-stun
+#
+################################################################################
+
+ERLANG_P1_STUN_VERSION = a7c07b6
+ERLANG_P1_STUN_SITE = $(call github,processone,stun,$(ERLANG_P1_STUN_VERSION))
+ERLANG_P1_STUN_LICENSE = GPLv2+
+ERLANG_P1_STUN_LICENSE_FILES = COPYING
+ERLANG_P1_STUN_DEPENDENCIES = erlang-p1-tls erlang-p1-utils
+ERLANG_P1_STUN_INSTALL_STAGING = YES
+
+$(eval $(rebar-package))
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 12/16] erlang-p1-stringprep: new package.
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
                   ` (10 preceding siblings ...)
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 11/16] erlang-p1-stun: " Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-02-03  9:54   ` Thomas Petazzoni
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 13/16] erlang-p1-sip: " Johan Oudinet
                   ` (4 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 package/Config.in                                    |  1 +
 package/erlang-p1-stringprep/Config.in               |  6 ++++++
 package/erlang-p1-stringprep/erlang-p1-stringprep.mk | 12 ++++++++++++
 3 files changed, 19 insertions(+)
 create mode 100644 package/erlang-p1-stringprep/Config.in
 create mode 100644 package/erlang-p1-stringprep/erlang-p1-stringprep.mk

diff --git a/package/Config.in b/package/Config.in
index 5a2707e..d48c305 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -402,6 +402,7 @@ if BR2_PACKAGE_ERLANG
 menu "Erlang libraries/modules"
 	source "package/erlang-goldrush/Config.in"
 	source "package/erlang-lager/Config.in"
+	source "package/erlang-p1-stringprep/Config.in"
 	source "package/erlang-p1-stun/Config.in"
 	source "package/erlang-p1-tls/Config.in"
 	source "package/erlang-p1-utils/Config.in"
diff --git a/package/erlang-p1-stringprep/Config.in b/package/erlang-p1-stringprep/Config.in
new file mode 100644
index 0000000..3ef77ed
--- /dev/null
+++ b/package/erlang-p1-stringprep/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_ERLANG_P1_STRINGPREP
+	bool "erlang-p1-stringprep"
+	help
+	  Erlang interface to stringprep
+
+	  https://github.com/processone/stringprep
diff --git a/package/erlang-p1-stringprep/erlang-p1-stringprep.mk b/package/erlang-p1-stringprep/erlang-p1-stringprep.mk
new file mode 100644
index 0000000..95b5402
--- /dev/null
+++ b/package/erlang-p1-stringprep/erlang-p1-stringprep.mk
@@ -0,0 +1,12 @@
+################################################################################
+#
+# erlang-p1-stringprep
+#
+################################################################################
+
+ERLANG_P1_STRINGPREP_VERSION = 9e9e0f8
+ERLANG_P1_STRINGPREP_SITE = $(call github,processone,stringprep,$(ERLANG_P1_STRINGPREP_VERSION))
+ERLANG_P1_STRINGPREP_LICENSE = GPLv2+
+ERLANG_P1_STRINGPREP_LICENSE_FILES = LICENSE.TCL
+
+$(eval $(rebar-package))
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 13/16] erlang-p1-sip: new package.
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
                   ` (11 preceding siblings ...)
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 12/16] erlang-p1-stringprep: " Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-02-03  9:55   ` Thomas Petazzoni
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 14/16] erlang-p1-iconv: " Johan Oudinet
                   ` (3 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 package/Config.in                                     |  1 +
 package/erlang-p1-sip/Config.in                       |  9 +++++++++
 .../erlang-p1-sip/erlang-p1-sip-01-fix-includes.patch | 19 +++++++++++++++++++
 package/erlang-p1-sip/erlang-p1-sip.mk                | 14 ++++++++++++++
 4 files changed, 43 insertions(+)
 create mode 100644 package/erlang-p1-sip/Config.in
 create mode 100644 package/erlang-p1-sip/erlang-p1-sip-01-fix-includes.patch
 create mode 100644 package/erlang-p1-sip/erlang-p1-sip.mk

diff --git a/package/Config.in b/package/Config.in
index d48c305..da5e2f2 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -402,6 +402,7 @@ if BR2_PACKAGE_ERLANG
 menu "Erlang libraries/modules"
 	source "package/erlang-goldrush/Config.in"
 	source "package/erlang-lager/Config.in"
+	source "package/erlang-p1-sip/Config.in"
 	source "package/erlang-p1-stringprep/Config.in"
 	source "package/erlang-p1-stun/Config.in"
 	source "package/erlang-p1-tls/Config.in"
diff --git a/package/erlang-p1-sip/Config.in b/package/erlang-p1-sip/Config.in
new file mode 100644
index 0000000..70cf819
--- /dev/null
+++ b/package/erlang-p1-sip/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_ERLANG_P1_SIP
+	bool "erlang-p1-sip"
+	select BR2_PACKAGE_ERLANG_P1_STUN
+	select BR2_PACKAGE_ERLANG_P1_TLS
+	select BR2_PACKAGE_ERLANG_P1_UTILS
+	help
+	  SIP library for Erlang
+
+	  https://github.com/processone/p1_sip
diff --git a/package/erlang-p1-sip/erlang-p1-sip-01-fix-includes.patch b/package/erlang-p1-sip/erlang-p1-sip-01-fix-includes.patch
new file mode 100644
index 0000000..80e2ab3
--- /dev/null
+++ b/package/erlang-p1-sip/erlang-p1-sip-01-fix-includes.patch
@@ -0,0 +1,19 @@
+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: erlang-p1-sip/src/esip_socket.erl
+===================================================================
+--- erlang-p1-sip.orig/src/esip_socket.erl
++++ erlang-p1-sip/src/esip_socket.erl
+@@ -22,7 +22,7 @@
+ 
+ -include("esip.hrl").
+ -include("esip_lib.hrl").
+--include("stun.hrl").
++-include_lib("p1_stun/include/stun.hrl").
+ 
+ -define(TCP_SEND_TIMEOUT, 15000).
+ -define(CONNECT_TIMEOUT, 20000).
diff --git a/package/erlang-p1-sip/erlang-p1-sip.mk b/package/erlang-p1-sip/erlang-p1-sip.mk
new file mode 100644
index 0000000..df5bcdd
--- /dev/null
+++ b/package/erlang-p1-sip/erlang-p1-sip.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# erlang-p1-sip
+#
+################################################################################
+
+ERLANG_P1_SIP_VERSION = bba4459
+ERLANG_P1_SIP_SITE = $(call github,processone,p1_sip,$(ERLANG_P1_SIP_VERSION))
+ERLANG_P1_SIP_LICENSE = GPLv2
+ERLANG_P1_SIP_LICENSE_FILES = COPYING
+ERLANG_P1_SIP_DEPENDENCIES = erlang-p1-stun erlang-p1-tls erlang-p1-utils
+ERLANG_P1_SIP_INSTALL_STAGING = YES
+
+$(eval $(rebar-package))
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 14/16] erlang-p1-iconv: new package.
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
                   ` (12 preceding siblings ...)
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 13/16] erlang-p1-sip: " Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 15/16] erlang-p1-cache-tab: " Johan Oudinet
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 package/Config.in                          |  1 +
 package/erlang-p1-iconv/Config.in          |  7 +++++++
 package/erlang-p1-iconv/erlang-p1-iconv.mk | 18 ++++++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 package/erlang-p1-iconv/Config.in
 create mode 100644 package/erlang-p1-iconv/erlang-p1-iconv.mk

diff --git a/package/Config.in b/package/Config.in
index da5e2f2..8a7f723 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -402,6 +402,7 @@ if BR2_PACKAGE_ERLANG
 menu "Erlang libraries/modules"
 	source "package/erlang-goldrush/Config.in"
 	source "package/erlang-lager/Config.in"
+	source "package/erlang-p1-iconv/Config.in"
 	source "package/erlang-p1-sip/Config.in"
 	source "package/erlang-p1-stringprep/Config.in"
 	source "package/erlang-p1-stun/Config.in"
diff --git a/package/erlang-p1-iconv/Config.in b/package/erlang-p1-iconv/Config.in
new file mode 100644
index 0000000..98efb21
--- /dev/null
+++ b/package/erlang-p1-iconv/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_ERLANG_P1_ICONV
+	bool "erlang-p1-iconv"
+	select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE
+	help
+	  Erlang interface to libiconv
+
+	  https://github.com/processone/eiconv
diff --git a/package/erlang-p1-iconv/erlang-p1-iconv.mk b/package/erlang-p1-iconv/erlang-p1-iconv.mk
new file mode 100644
index 0000000..2189f01
--- /dev/null
+++ b/package/erlang-p1-iconv/erlang-p1-iconv.mk
@@ -0,0 +1,18 @@
+################################################################################
+#
+# erlang-p1-iconv
+#
+################################################################################
+
+ERLANG_P1_ICONV_VERSION = dff5ee5
+ERLANG_P1_ICONV_SITE = $(call github,processone,eiconv,$(ERLANG_P1_ICONV_VERSION))
+ERLANG_P1_ICONV_LICENSE = GPLv2+
+ERLANG_P1_ICONV_LICENSE_FILES = COPYING
+
+ifeq ($(BR2_PACKAGE_LIBICONV),y)
+ERLANG_P1_ICONV_DEPENDENCIES += libiconv
+endif
+
+ERLANG_P1_ICONV_USE_AUTOCONF = YES
+
+$(eval $(rebar-package))
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 15/16] erlang-p1-cache-tab: new package.
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
                   ` (13 preceding siblings ...)
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 14/16] erlang-p1-iconv: " Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 16/16] ejabberd: " Johan Oudinet
  2015-02-03  9:26 ` [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Thomas Petazzoni
  16 siblings, 0 replies; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 package/Config.in                                  |  1 +
 package/erlang-p1-cache-tab/Config.in              |  7 +++++++
 package/erlang-p1-cache-tab/erlang-p1-cache-tab.mk | 13 +++++++++++++
 3 files changed, 21 insertions(+)
 create mode 100644 package/erlang-p1-cache-tab/Config.in
 create mode 100644 package/erlang-p1-cache-tab/erlang-p1-cache-tab.mk

diff --git a/package/Config.in b/package/Config.in
index 8a7f723..48c3c4a 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -402,6 +402,7 @@ if BR2_PACKAGE_ERLANG
 menu "Erlang libraries/modules"
 	source "package/erlang-goldrush/Config.in"
 	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-sip/Config.in"
 	source "package/erlang-p1-stringprep/Config.in"
diff --git a/package/erlang-p1-cache-tab/Config.in b/package/erlang-p1-cache-tab/Config.in
new file mode 100644
index 0000000..eed2676
--- /dev/null
+++ b/package/erlang-p1-cache-tab/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_ERLANG_P1_CACHE_TAB
+	bool "erlang-p1-cache-tab"
+	select BR2_PACKAGE_ERLANG_P1_UTILS
+	help
+	  Erlang library implementing cache tables
+
+	  https://github.com/processone/cache_tab
diff --git a/package/erlang-p1-cache-tab/erlang-p1-cache-tab.mk b/package/erlang-p1-cache-tab/erlang-p1-cache-tab.mk
new file mode 100644
index 0000000..f651b06
--- /dev/null
+++ b/package/erlang-p1-cache-tab/erlang-p1-cache-tab.mk
@@ -0,0 +1,13 @@
+################################################################################
+#
+# erlang-p1-cache-tab
+#
+################################################################################
+
+ERLANG_P1_CACHE_TAB_VERSION = 7b89d6a
+ERLANG_P1_CACHE_TAB_SITE = $(call github,processone,cache_tab,$(ERLANG_P1_CACHE_TAB_VERSION))
+ERLANG_P1_CACHE_TAB_LICENSE = GPLv2+
+ERLANG_P1_CACHE_TAB_LICENSE_FILES = COPYING
+ERLANG_P1_CACHE_TAB_DEPENDENCIES = erlang-p1-utils
+
+$(eval $(rebar-package))
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 16/16] ejabberd: new package.
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
                   ` (14 preceding siblings ...)
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 15/16] erlang-p1-cache-tab: " Johan Oudinet
@ 2015-01-12  9:32 ` Johan Oudinet
  2015-02-03  9:56   ` Thomas Petazzoni
  2015-02-03  9:26 ` [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Thomas Petazzoni
  16 siblings, 1 reply; 32+ messages in thread
From: Johan Oudinet @ 2015-01-12  9:32 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
---
 package/Config.in                                  |  1 +
 package/ejabberd/0001-remove-deps.patch            | 20 +++++
 package/ejabberd/0002-disable-rebar-deps.patch     | 70 +++++++++++++++
 package/ejabberd/0003-disable-test.patch           | 21 +++++
 package/ejabberd/0004-disable-version-check.patch  | 20 +++++
 package/ejabberd/0005-fix-includes.patch           | 45 ++++++++++
 package/ejabberd/0006-remove-doc.patch             | 26 ++++++
 package/ejabberd/0007-fix-init.patch               | 99 ++++++++++++++++++++++
 .../ejabberd/0008-fix-install-permissions.patch    | 76 +++++++++++++++++
 package/ejabberd/Config.in                         | 21 +++++
 package/ejabberd/S50ejabberd                       | 35 ++++++++
 package/ejabberd/check-erlang-lib                  | 55 ++++++++++++
 package/ejabberd/ejabberd.mk                       | 52 ++++++++++++
 13 files changed, 541 insertions(+)
 create mode 100644 package/ejabberd/0001-remove-deps.patch
 create mode 100644 package/ejabberd/0002-disable-rebar-deps.patch
 create mode 100644 package/ejabberd/0003-disable-test.patch
 create mode 100644 package/ejabberd/0004-disable-version-check.patch
 create mode 100644 package/ejabberd/0005-fix-includes.patch
 create mode 100644 package/ejabberd/0006-remove-doc.patch
 create mode 100644 package/ejabberd/0007-fix-init.patch
 create mode 100644 package/ejabberd/0008-fix-install-permissions.patch
 create mode 100644 package/ejabberd/Config.in
 create mode 100644 package/ejabberd/S50ejabberd
 create mode 100755 package/ejabberd/check-erlang-lib
 create mode 100644 package/ejabberd/ejabberd.mk

diff --git a/package/Config.in b/package/Config.in
index 48c3c4a..6746618 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1061,6 +1061,7 @@ endif
 	source "package/dnsmasq/Config.in"
 	source "package/dropbear/Config.in"
 	source "package/ebtables/Config.in"
+	source "package/ejabberd/Config.in"
 	source "package/ethtool/Config.in"
 	source "package/faifa/Config.in"
 	source "package/fmc/Config.in"
diff --git a/package/ejabberd/0001-remove-deps.patch b/package/ejabberd/0001-remove-deps.patch
new file mode 100644
index 0000000..1982ca8
--- /dev/null
+++ b/package/ejabberd/0001-remove-deps.patch
@@ -0,0 +1,20 @@
+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
+===================================================================
+--- ejabberd.orig/rebar.config.script
++++ ejabberd/rebar.config.script
+@@ -126,9 +126,7 @@ Config = [{erl_opts, Macros ++ HiPE ++ D
+           {sub_dirs, ["rel"]},
+           {keep_build_info, true},
+           {ct_extra_params, "-include "
+-           ++ filename:join([Cwd, "tools"])},
+-          {post_hooks, PostHooks ++ CfgPostHooks},
+-          {deps, Deps ++ CfgDeps}],
++           ++ filename:join([Cwd, "tools"])}],
+ %%io:format("ejabberd configuration:~n  ~p~n", [Config]),
+ Config.
+ 
diff --git a/package/ejabberd/0002-disable-rebar-deps.patch b/package/ejabberd/0002-disable-rebar-deps.patch
new file mode 100644
index 0000000..80217ca
--- /dev/null
+++ b/package/ejabberd/0002-disable-rebar-deps.patch
@@ -0,0 +1,70 @@
+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
+===================================================================
+--- ejabberd.orig/Makefile.in
++++ ejabberd/Makefile.in
+@@ -68,26 +68,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
+-
+ translations:
+ 	contrib/extract_translations/prepare-translation.sh -updateall
+ 
+@@ -103,8 +88,6 @@ spec:
+ 	$(ERL) -noinput +B -pa ebin -pa deps/*/ebin -eval \
+ 	'case xml_gen:compile("tools/xmpp_codec.spec") of ok -> halt(0); _ -> halt(1) end.'
+ 
+-DLLs := $(wildcard deps/*/priv/*.so) $(wildcard deps/*/priv/lib/*.so)
+-
+ install: all
+ 	#
+ 	# Configuration files
+@@ -139,14 +122,11 @@ install: all
+ 	$(INSTALL) -d $(BEAMDIR)
+ 	$(INSTALL) -m 644 ebin/*.app $(BEAMDIR)
+ 	$(INSTALL) -m 644 ebin/*.beam $(BEAMDIR)
+-	$(INSTALL) -m 644 deps/*/ebin/*.app $(BEAMDIR)
+-	$(INSTALL) -m 644 deps/*/ebin/*.beam $(BEAMDIR)
+ 	rm -f $(BEAMDIR)/configure.beam
+ 	#
+ 	# ejabberd header files
+ 	$(INSTALL) -d $(INCLUDEDIR)
+ 	$(INSTALL) -m 644 include/*.hrl $(INCLUDEDIR)
+-	$(INSTALL) -m 644 deps/*/include/*.hrl $(INCLUDEDIR)
+ 	#
+ 	# Binary C programs
+ 	$(INSTALL) -d $(PBINDIR)
+@@ -156,7 +136,6 @@ install: all
+ 	#
+ 	# Binary system libraries
+ 	$(INSTALL) -d $(SODIR)
+-	$(INSTALL) -m 644 $(DLLs) $(SODIR)
+ 	#
+ 	# Translated strings
+ 	$(INSTALL) -d $(MSGSDIR)
diff --git a/package/ejabberd/0003-disable-test.patch b/package/ejabberd/0003-disable-test.patch
new file mode 100644
index 0000000..4354ab6
--- /dev/null
+++ b/package/ejabberd/0003-disable-test.patch
@@ -0,0 +1,21 @@
+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
+===================================================================
+--- ejabberd.orig/Makefile.in
++++ ejabberd/Makefile.in
+@@ -260,10 +260,6 @@ dialyzer: erlang_plt deps_plt ejabberd_p
+ 	status=$$? ; if [ $$status -ne 2 ]; then exit $$status; else exit 0; fi
+ 
+ test:
+-	@echo "************************** NOTICE ***************************************"
+-	@cat test/README
+-	@echo "*************************************************************************"
+-	$(REBAR) skip_deps=true ct
+ 
+ .PHONY: src doc edoc dialyzer Makefile TAGS clean clean-rel distclean rel \
+ 	install uninstall uninstall-binary uninstall-all translations deps test spec \
diff --git a/package/ejabberd/0004-disable-version-check.patch b/package/ejabberd/0004-disable-version-check.patch
new file mode 100644
index 0000000..f2f1e81
--- /dev/null
+++ b/package/ejabberd/0004-disable-version-check.patch
@@ -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
+ 
diff --git a/package/ejabberd/0005-fix-includes.patch b/package/ejabberd/0005-fix-includes.patch
new file mode 100644
index 0000000..27ad761
--- /dev/null
+++ b/package/ejabberd/0005-fix-includes.patch
@@ -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).
diff --git a/package/ejabberd/0006-remove-doc.patch b/package/ejabberd/0006-remove-doc.patch
new file mode 100644
index 0000000..0c0a21b
--- /dev/null
+++ b/package/ejabberd/0006-remove-doc.patch
@@ -0,0 +1,26 @@
+Description: remove installing documentation
+ Without this patch, the Makefile will try to install ejabberd
+ documentation even if it is not generated, which will fail.
+Author: Johan Oudinet <johan.oudinet@gmail.com>
+
+Index: ejabberd/Makefile.in
+===================================================================
+--- ejabberd.orig/Makefile.in	2014-10-21 16:43:42.604972005 +0200
++++ ejabberd/Makefile.in	2014-10-21 16:45:12.419989667 +0200
+@@ -156,16 +156,6 @@ install: all
+ 	$(INSTALL) -d -m 750 $(O_USER) $(LOGDIR)
+ 	$(CHOWN_COMMAND) -R @INSTALLUSER@ $(LOGDIR) >$(CHOWN_OUTPUT)
+ 	chmod -R 750 $(LOGDIR)
+-	#
+-	# Documentation
+-	$(INSTALL) -d $(DOCDIR)
+-	$(INSTALL) -m 644 doc/dev.html $(DOCDIR)
+-	$(INSTALL) -m 644 doc/guide.html $(DOCDIR)
+-	$(INSTALL) -m 644 doc/*.png $(DOCDIR)
+-	[ -f doc/guide.pdf ] \
+-		&& $(INSTALL) -m 644 doc/guide.pdf $(DOCDIR) \
+-		|| echo "No doc/guide.pdf was built"
+-	$(INSTALL) -m 644 COPYING $(DOCDIR)
+ 
+ uninstall: uninstall-binary
+ 
diff --git a/package/ejabberd/0007-fix-init.patch b/package/ejabberd/0007-fix-init.patch
new file mode 100644
index 0000000..7a46f78
--- /dev/null
+++ b/package/ejabberd/0007-fix-init.patch
@@ -0,0 +1,99 @@
+Description: adjust initscript template
+ Some tweaks to the initscript template are needed for Debian packaging to work
+ and to follow policy.
+Author: Philipp Huebner <debalance@debian.org>
+
+Index: ejabberd/ejabberd.init.template
+===================================================================
+--- ejabberd.orig/ejabberd.init.template
++++ ejabberd/ejabberd.init.template
+@@ -16,34 +16,52 @@
+ 
+ set -o errexit
+ 
+-DIR=@ctlscriptpath@
++. /lib/lsb/init-functions
++
++DIR=/usr/sbin
+ CTL="$DIR"/ejabberdctl
+-USER=@installuser@
++USER=ejabberd
++EJABBERDRUN=/var/run/ejabberd
+ 
+ test -x "$CTL" || {
+ 	echo "ERROR: ejabberd not found: $DIR"
+ 	exit 1
+ }
+-grep ^"$USER": /etc/passwd >/dev/null || {
+-	echo "ERROR: System user not found: $USER"
+-	exit 2
++
++mkrundir()
++{
++	if [ ! -d $EJABBERDRUN ]; then
++		mkdir -p $EJABBERDRUN
++		if [ $? -ne 0 ]; then
++			echo -n " failed"
++			return
++		fi
++		chmod 0755 $EJABBERDRUN
++		chown ejabberd:ejabberd $EJABBERDRUN
++	fi
+ }
+ 
++
+ export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
+ 
+ case "$1" in
+   start)
+     test -x "$CTL" || exit 0
++    mkrundir
+     echo "Starting ejabberd..."
+-    su - $USER -c "$CTL start"
+-    su - $USER -c "$CTL started"
++    if ! /etc/init.d/ejabberd status > /dev/null; then 
++	su - $USER -c "$CTL start"
++	su - $USER -c "$CTL started"
++    fi
+     echo "done."
+     ;;
+   stop)
+     test -x "$CTL" || exit 0
+     echo "Stopping ejabberd..."
+-    su - $USER -c "$CTL stop"
+-    su - $USER -c "$CTL stopped"
++    if $CTL status >/dev/null || test $? = 1 ; then
++	su - $USER -c "$CTL stop"
++	su - $USER -c "$CTL stopped"
++    fi
+     echo "done."
+     ;;
+   status)
+Index: ejabberd/ejabberdctl.template
+===================================================================
+--- ejabberd.orig/ejabberdctl.template
++++ ejabberd/ejabberdctl.template
+@@ -7,12 +7,12 @@ ERL_MAX_PORTS=32000
+ ERL_PROCESSES=250000
+ ERL_MAX_ETS_TABLES=1400
+ FIREWALL_WINDOW=""
+-ERLANG_NODE=ejabberd at localhost
++ERLANG_NODE=ejabberd
+ 
+ # define default environment variables
+ SCRIPT_DIR=`cd ${0%/*} && pwd`
+ ERL={{erl}}
+-INSTALLUSER={{installuser}}
++INSTALLUSER=ejabberd
+ 
+ # Compatibility in ZSH
+ #setopt shwordsplit 2>/dev/null
+@@ -22,7 +22,7 @@ if [ "$INSTALLUSER" != "" ] ; then
+     EXEC_CMD="false"
+     for GID in `id -G`; do
+         if [ $GID -eq 0 ] ; then
+-            EXEC_CMD="su $INSTALLUSER -p -c"
++            EXEC_CMD="su $INSTALLUSER -c"
+         fi
+     done
+     if [ `id -g` -eq `id -g $INSTALLUSER` ] ; then
diff --git a/package/ejabberd/0008-fix-install-permissions.patch b/package/ejabberd/0008-fix-install-permissions.patch
new file mode 100644
index 0000000..b4633aa
--- /dev/null
+++ b/package/ejabberd/0008-fix-install-permissions.patch
@@ -0,0 +1,76 @@
+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
+===================================================================
+--- ejabberd.orig/Makefile.in	2014-10-28 12:36:49.228713322 +0100
++++ ejabberd/Makefile.in	2014-10-28 13:53:13.538888807 +0100
+@@ -91,10 +91,10 @@ spec:
+ install: all
+ 	#
+ 	# Configuration files
+-	$(INSTALL) -d -m 750 $(G_USER) $(ETCDIR)
++	$(INSTALL) -d $(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) -b -m 644 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml-new \
++		|| $(INSTALL) -b -m 644 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml
+ 	$(SED) -e "s*{{rootdir}}*@prefix@*" \
+ 		-e "s*{{installuser}}*@INSTALLUSER@*" \
+ 		-e "s*{{libdir}}*@libdir@*" \
+@@ -104,13 +104,12 @@ install: all
+ 		-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) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg-new \
++		|| $(INSTALL) -b -m 644 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
+ 	$(INSTALL) -b -m 644 $(G_USER) 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
+ 	#
+ 	# Init script
+ 	$(SED) -e "s*@ctlscriptpath@*$(SBINDIR)*" \
+@@ -129,10 +128,7 @@ install: all
+ 	$(INSTALL) -m 644 include/*.hrl $(INCLUDEDIR)
+ 	#
+ 	# Binary C programs
+-	$(INSTALL) -d $(PBINDIR)
+-	$(INSTALL) -m 750 $(O_USER) tools/captcha.sh $(PBINDIR)
+-	-[ -f deps/p1_pam/priv/bin/epam ] \
+-		&& $(INSTALL) -m 750 $(O_USER) deps/p1_pam/priv/bin/epam $(PBINDIR)
++	$(INSTALL) -D tools/captcha.sh $(PBINDIR)/captcha.sh
+ 	#
+ 	# Binary system libraries
+ 	$(INSTALL) -d $(SODIR)
+@@ -140,22 +136,6 @@ install: all
+ 	# Translated strings
+ 	$(INSTALL) -d $(MSGSDIR)
+ 	$(INSTALL) -m 644 priv/msgs/*.msg $(MSGSDIR)
+-	#
+-	# 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)
+ 
+ uninstall: uninstall-binary
+
diff --git a/package/ejabberd/Config.in b/package/ejabberd/Config.in
new file mode 100644
index 0000000..2a8d274
--- /dev/null
+++ b/package/ejabberd/Config.in
@@ -0,0 +1,21 @@
+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_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 a toolchain w/ Erlang"
+	depends on !BR2_PACKAGE_ERLANG
diff --git a/package/ejabberd/S50ejabberd b/package/ejabberd/S50ejabberd
new file mode 100644
index 0000000..2656307
--- /dev/null
+++ b/package/ejabberd/S50ejabberd
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# Start/stop ejabberd
+#
+
+USER=ejabberd
+RUNDIR=/var/run/ejabberd
+
+mkrundir() {
+    install -d -o $USER -g $USER $RUNDIR
+}
+
+case "$1" in
+    start)
+	mkrundir
+        echo "Starting ejabberd..."
+        ejabberdctl start
+        ;;
+    stop)
+        echo -n "Stopping ejabberd... "
+        ejabberdctl stop > /dev/null
+        if [ $? -eq 3 ] || ejabberdctl stopped; then
+            echo "OK"
+        else
+            echo "failed"
+        fi
+        ;;
+    restart|reload)
+        "$0" stop
+        "$0" start
+        ;;
+    *)
+        echo "Usage: $0 {start|stop|restart}"
+        exit 1
+esac
diff --git a/package/ejabberd/check-erlang-lib b/package/ejabberd/check-erlang-lib
new file mode 100755
index 0000000..63f8bf1
--- /dev/null
+++ b/package/ejabberd/check-erlang-lib
@@ -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
diff --git a/package/ejabberd/ejabberd.mk b/package/ejabberd/ejabberd.mk
new file mode 100644
index 0000000..d785a49
--- /dev/null
+++ b/package/ejabberd/ejabberd.mk
@@ -0,0 +1,52 @@
+################################################################################
+#
+# ejabberd
+#
+################################################################################
+
+EJABBERD_VERSION = 14.07
+EJABBERD_SITE = $(call github,processone,ejabberd,$(EJABBERD_VERSION))
+EJABBERD_LICENSE = GPLv2+
+EJABBERD_LICENSE_FILES = COPYING
+EJABBERD_DEPENDENCIES = 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)='$(shell package/ejabberd/check-erlang-lib $(lib))')
+
+define EJABBERD_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(EJABBERD_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))
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server
  2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
                   ` (15 preceding siblings ...)
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 16/16] ejabberd: " Johan Oudinet
@ 2015-02-03  9:26 ` Thomas Petazzoni
  2015-02-03  9:56   ` Johan Oudinet
  16 siblings, 1 reply; 32+ messages in thread
From: Thomas Petazzoni @ 2015-02-03  9:26 UTC (permalink / raw)
  To: buildroot

Dear Johan Oudinet,

On Mon, 12 Jan 2015 10:32:04 +0100, Johan Oudinet wrote:

> Since ejabberd build system relies on rebar to download its
> dependencies, we've packaged all of them separately and modified
> ejabberd makefile to not download any dependency.
> 
> Actually, every erlang package that is introduced here rely on the
> rebar software. Thus, we also introduce a new infrastructure to
> simplify the development of such packages in buildroot.

I've applied the entire series, thanks for working on this! I'll reply
individually to some of the patches, to indicate the changes I've made,
and also ask some questions that may lead to follow-up patches if
needed.

Thanks a lot for your perseverance in working on those patches!

Best regards,

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 02/16] package/pkg-rebar: new infrastructure
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 02/16] package/pkg-rebar: new infrastructure Johan Oudinet
@ 2015-02-03  9:28   ` Thomas Petazzoni
  2015-02-24 17:07     ` Johan Oudinet
  0 siblings, 1 reply; 32+ messages in thread
From: Thomas Petazzoni @ 2015-02-03  9:28 UTC (permalink / raw)
  To: buildroot

Dear Johan Oudinet,

On Mon, 12 Jan 2015 10:32:06 +0100, Johan Oudinet wrote:
> Ease the development of packages that use the erlang rebar tool as
> their build system.
> 
> Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
> [yann.morin.1998 at free.fr: split the patch into semantically separated
> patches; large rewrites of the rest]
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>

On this patch (the most important one, obviously), we did a number of
changes:

    [Thomas, with help from Yann and Arnout:
     - Fix the comment about the symlink used to make sure rebar does not
       download dependencies. The comment was not up-to-date with where
       the symlink is actually created.
     - Make <pkg>_USE_BUNDLED_REBAR and <pkg>_USE_AUTOCONF be inherited by
       host packages from their corresponding target package.
     - Make sure host dependencies are inherited from the corresponding
       target packages dependencies. This requires copying some logic from
       inner-autotools-package and inner-generic-package, just like
       inner-autotools-package duplicates some logic from
       inner-generic-package.
     - Fix host variant of $(2)_BUILD_CMDS indentation, use double quotes
       instead of simple quotes. So that it matches the target
       $(2)_BUILD_CMDS, and what we do elsewhere in Buildroot.]

See some questions below.


> +# Directories to store rebar dependencies in.
> +#
> +# These directories actually only contain symbolic links to Erlang
> +# applications in either $(HOST_DIR) or $(STAGING_DIR).  One needs
> +# them to avoid rebar complaining about missing dependencies, as this
> +# infrastructure tells rebar to NOT download dependencies during
> +# the build stage.
> +#
> +REBAR_HOST_DEPS_DIR = $(HOST_DIR)/usr/share/rebar/deps
> +REBAR_TARGET_DEPS_DIR = $(STAGING_DIR)/usr/share/rebar/deps

Rather than having those paths, why don't we point directly rebar at
$(STAGING_DIR)/usr/lib/erlang/lib/ ? This directory already contains
<erlang-app>-<version> directory for each package, and we would only
have to create a symlink <erlang-app> --> <erlang-app>-<version>.

But maybe it's cleaner to have something completely separate, I don't know.

Thanks!

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 05/16] erlang-lager: new package.
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 05/16] erlang-lager: " Johan Oudinet
@ 2015-02-03  9:29   ` Thomas Petazzoni
  0 siblings, 0 replies; 32+ messages in thread
From: Thomas Petazzoni @ 2015-02-03  9:29 UTC (permalink / raw)
  To: buildroot

Dear Johan Oudinet,

On Mon, 12 Jan 2015 10:32:09 +0100, Johan Oudinet wrote:

> diff --git a/package/erlang-lager/Config.in b/package/erlang-lager/Config.in
> new file mode 100644
> index 0000000..b7994fe
> --- /dev/null
> +++ b/package/erlang-lager/Config.in
> @@ -0,0 +1,13 @@
> +config BR2_PACKAGE_ERLANG_LAGER
> +	bool "erlang-lager"
> +	select BR2_PACKAGE_ERLANG_GOLDRUSH
> +	help
> +	  Logging framework for Erlang.

This line of help text was not really needed, since it's an information
already part of the following paragraph.

> +	  

This had some trailing whitespace.

Committed with this fixed.

Thanks!

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 08/16] erlang-p1-xml: new package.
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 08/16] erlang-p1-xml: " Johan Oudinet
@ 2015-02-03  9:29   ` Thomas Petazzoni
  0 siblings, 0 replies; 32+ messages in thread
From: Thomas Petazzoni @ 2015-02-03  9:29 UTC (permalink / raw)
  To: buildroot

Dear Johan Oudinet,

On Mon, 12 Jan 2015 10:32:12 +0100, Johan Oudinet wrote:

> +ERLANG_P1_XML_VERSION = b530983
> +ERLANG_P1_XML_SITE = $(call github,processone,xml,$(ERLANG_P1_XML_VERSION))
> +ERLANG_P1_XML_LICENSE = GPLv2

License is really GPLv2+ and not GPLv2. Committed with this fixed.

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 12/16] erlang-p1-stringprep: new package.
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 12/16] erlang-p1-stringprep: " Johan Oudinet
@ 2015-02-03  9:54   ` Thomas Petazzoni
  0 siblings, 0 replies; 32+ messages in thread
From: Thomas Petazzoni @ 2015-02-03  9:54 UTC (permalink / raw)
  To: buildroot

Dear Johan Oudinet,

On Mon, 12 Jan 2015 10:32:16 +0100, Johan Oudinet wrote:

> +ERLANG_P1_STRINGPREP_VERSION = 9e9e0f8
> +ERLANG_P1_STRINGPREP_SITE = $(call github,processone,stringprep,$(ERLANG_P1_STRINGPREP_VERSION))
> +ERLANG_P1_STRINGPREP_LICENSE = GPLv2+

License was not GPLv2+, but TCL. Applied with this fixed.

Thanks,

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 13/16] erlang-p1-sip: new package.
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 13/16] erlang-p1-sip: " Johan Oudinet
@ 2015-02-03  9:55   ` Thomas Petazzoni
  0 siblings, 0 replies; 32+ messages in thread
From: Thomas Petazzoni @ 2015-02-03  9:55 UTC (permalink / raw)
  To: buildroot

Dear Johan Oudinet,

On Mon, 12 Jan 2015 10:32:17 +0100, Johan Oudinet wrote:

> +ERLANG_P1_SIP_VERSION = bba4459
> +ERLANG_P1_SIP_SITE = $(call github,processone,p1_sip,$(ERLANG_P1_SIP_VERSION))
> +ERLANG_P1_SIP_LICENSE = GPLv2

License is GPLv2 with OpenSSL exception. Applied with this fixed.

Thanks,

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 16/16] ejabberd: new package.
  2015-01-12  9:32 ` [Buildroot] [PATCH v6 16/16] ejabberd: " Johan Oudinet
@ 2015-02-03  9:56   ` Thomas Petazzoni
  2015-02-03 10:35     ` Johan Oudinet
  0 siblings, 1 reply; 32+ messages in thread
From: Thomas Petazzoni @ 2015-02-03  9:56 UTC (permalink / raw)
  To: buildroot

Dear Johan Oudinet,

On Mon, 12 Jan 2015 10:32:20 +0100, Johan Oudinet wrote:
> Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
> Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>

Applied, with a number of changes, please check the result is correct.

    [Thomas:
     - Adjust the comment about the dependency on erlang
     - Fix license to be 'GPLv2+ with OpenSSL exception' and not just 'GPLv2+'
     - Use double quotes instead of simple quotes in the .mk file.
     - Don't use the EJABBERD_MAKE_ENV variable, since it's not defined
       anywhere.
     - Remove the 0007-fix-init.patch patch, since we're not using the
       init script provided by ejabberd, and rename
       0008-fix-install-permissions.patch to
       0007-fix-install-permissions.patch.]

One question below.


> +EJABBERD_DEPENDENCIES = openssl host-erlang-lager erlang-lager \

I'm interested in hearing a bit more about the host-erlang-lager
dependency. Why would ejabberd need a logging framework built for the
host? This seems weird.

Thanks!

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server
  2015-02-03  9:26 ` [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Thomas Petazzoni
@ 2015-02-03  9:56   ` Johan Oudinet
  0 siblings, 0 replies; 32+ messages in thread
From: Johan Oudinet @ 2015-02-03  9:56 UTC (permalink / raw)
  To: buildroot

Dear Thomas,

On Tue, Feb 3, 2015 at 10:26 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
>
> I've applied the entire series, thanks for working on this! I'll reply
> individually to some of the patches, to indicate the changes I've made,
> and also ask some questions that may lead to follow-up patches if
> needed.
>
> Thanks a lot for your perseverance in working on those patches!

Thank you for your help on these patches and all your hard work on buildroot.

Best,

-- 
Johan Oudinet

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 16/16] ejabberd: new package.
  2015-02-03  9:56   ` Thomas Petazzoni
@ 2015-02-03 10:35     ` Johan Oudinet
  2015-02-03 11:32       ` Thomas Petazzoni
  0 siblings, 1 reply; 32+ messages in thread
From: Johan Oudinet @ 2015-02-03 10:35 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On Tue, Feb 3, 2015 at 10:56 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
>> +EJABBERD_DEPENDENCIES = openssl host-erlang-lager erlang-lager \
>
> I'm interested in hearing a bit more about the host-erlang-lager
> dependency. Why would ejabberd need a logging framework built for the
> host? This seems weird.

I also think it's weird but otherwise ejabberd compilation failed at
src/gen_mod.erl, which includes include/logger.hrl.
At line 23 of this file there is such statement:
-compile([{parse_transform, lager_transform}]).
And lager_transform is provided by erlang-lager.

I'm not an erlang guru but from lager documentation, it says this line
must be added to "the module you wish to compile with logging
enabled".
So, I guess it needs host-erlang-lager to add such capability to the
erlang compiler.
If an erlang expert reads this, it probably can provide a better explanation.

-- 
Johan

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 16/16] ejabberd: new package.
  2015-02-03 10:35     ` Johan Oudinet
@ 2015-02-03 11:32       ` Thomas Petazzoni
  2015-02-04 21:17         ` Frank Hunleth
  0 siblings, 1 reply; 32+ messages in thread
From: Thomas Petazzoni @ 2015-02-03 11:32 UTC (permalink / raw)
  To: buildroot

Dear Johan Oudinet,

On Tue, 3 Feb 2015 11:35:38 +0100, Johan Oudinet wrote:

> > I'm interested in hearing a bit more about the host-erlang-lager
> > dependency. Why would ejabberd need a logging framework built for the
> > host? This seems weird.
> 
> I also think it's weird but otherwise ejabberd compilation failed at
> src/gen_mod.erl, which includes include/logger.hrl.
> At line 23 of this file there is such statement:
> -compile([{parse_transform, lager_transform}]).
> And lager_transform is provided by erlang-lager.
> 
> I'm not an erlang guru but from lager documentation, it says this line
> must be added to "the module you wish to compile with logging
> enabled".
> So, I guess it needs host-erlang-lager to add such capability to the
> erlang compiler.
> If an erlang expert reads this, it probably can provide a better explanation.

Ok, thanks for the details. I clearly don't have any Erlang knowledge,
so I will not try to dive into this to understand what's going on.
Those dependencies are anyway fairly light, so it doesn't matter that
much.

Thanks,

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 16/16] ejabberd: new package.
  2015-02-03 11:32       ` Thomas Petazzoni
@ 2015-02-04 21:17         ` Frank Hunleth
  2015-02-05  7:55           ` Thomas Petazzoni
  0 siblings, 1 reply; 32+ messages in thread
From: Frank Hunleth @ 2015-02-04 21:17 UTC (permalink / raw)
  To: buildroot

Johan and Thomas,

On Tue, Feb 3, 2015 at 6:32 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Johan Oudinet,
>
> On Tue, 3 Feb 2015 11:35:38 +0100, Johan Oudinet wrote:
>
>> > I'm interested in hearing a bit more about the host-erlang-lager
>> > dependency. Why would ejabberd need a logging framework built for the
>> > host? This seems weird.
>>
>> I also think it's weird but otherwise ejabberd compilation failed at
>> src/gen_mod.erl, which includes include/logger.hrl.
>> At line 23 of this file there is such statement:
>> -compile([{parse_transform, lager_transform}]).
>> And lager_transform is provided by erlang-lager.
>>
>> I'm not an erlang guru but from lager documentation, it says this line
>> must be added to "the module you wish to compile with logging
>> enabled".
>> So, I guess it needs host-erlang-lager to add such capability to the
>> erlang compiler.
>> If an erlang expert reads this, it probably can provide a better explanation.

I'm not going to claim to be an Erlang expert, but I can add some
information. Applications that use lager need to enable Lager's parse
transform on the host Erlang compiler. The parse transform extracts
things like module, function, and line number information whenever
lager:warn, lager:info, etc. are called, so that it can be included in
the log messages. The parse transform actually has to be compiled for
the host. When you're not cross-compiling, it doesn't look as weird.

Also, I should say that I've been quietly watching the various Erlang
patches on the mailing list. What I've seen looks pretty good. I do
use Erlang with Buildroot, but I use the Erlang Release tools to
generate the final images. This makes for smaller root filesystems
(Erlang's libraries are huge and largely irrelevant to most apps) and
is more compatible with how Erlang people do things. However, it's
definitely not how I think that things should be done in the Buildroot
project. I think that you guys are doing it right, so if I work a
project that just needs ejabberd or another Erlang app, then I'm going
to switch over to this framework. Thanks for doing this!

Frank

>
> Ok, thanks for the details. I clearly don't have any Erlang knowledge,
> so I will not try to dive into this to understand what's going on.
> Those dependencies are anyway fairly light, so it doesn't matter that
> much.
>
> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 16/16] ejabberd: new package.
  2015-02-04 21:17         ` Frank Hunleth
@ 2015-02-05  7:55           ` Thomas Petazzoni
  2015-02-05 14:25             ` Frank Hunleth
  0 siblings, 1 reply; 32+ messages in thread
From: Thomas Petazzoni @ 2015-02-05  7:55 UTC (permalink / raw)
  To: buildroot

Dear Frank Hunleth,

On Wed, 4 Feb 2015 16:17:25 -0500, Frank Hunleth wrote:

> I'm not going to claim to be an Erlang expert, but I can add some
> information. Applications that use lager need to enable Lager's parse
> transform on the host Erlang compiler. The parse transform extracts
> things like module, function, and line number information whenever
> lager:warn, lager:info, etc. are called, so that it can be included in
> the log messages. The parse transform actually has to be compiled for
> the host. When you're not cross-compiling, it doesn't look as weird.

Ok, thanks for the explanation.

> Also, I should say that I've been quietly watching the various Erlang
> patches on the mailing list. What I've seen looks pretty good. I do
> use Erlang with Buildroot, but I use the Erlang Release tools to
> generate the final images. This makes for smaller root filesystems
> (Erlang's libraries are huge and largely irrelevant to most apps) and
> is more compatible with how Erlang people do things. However, it's
> definitely not how I think that things should be done in the Buildroot
> project. I think that you guys are doing it right, so if I work a
> project that just needs ejabberd or another Erlang app, then I'm going
> to switch over to this framework. Thanks for doing this!

Is there a way of doing the same as those Erlang Release tools, and
make sure only the really used libraries are kept?

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 16/16] ejabberd: new package.
  2015-02-05  7:55           ` Thomas Petazzoni
@ 2015-02-05 14:25             ` Frank Hunleth
  0 siblings, 0 replies; 32+ messages in thread
From: Frank Hunleth @ 2015-02-05 14:25 UTC (permalink / raw)
  To: buildroot

On Thu, Feb 5, 2015 at 2:55 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Frank Hunleth,
>
> On Wed, 4 Feb 2015 16:17:25 -0500, Frank Hunleth wrote:
>
>> I'm not going to claim to be an Erlang expert, but I can add some
>> information. Applications that use lager need to enable Lager's parse
>> transform on the host Erlang compiler. The parse transform extracts
>> things like module, function, and line number information whenever
>> lager:warn, lager:info, etc. are called, so that it can be included in
>> the log messages. The parse transform actually has to be compiled for
>> the host. When you're not cross-compiling, it doesn't look as weird.
>
> Ok, thanks for the explanation.
>
>> Also, I should say that I've been quietly watching the various Erlang
>> patches on the mailing list. What I've seen looks pretty good. I do
>> use Erlang with Buildroot, but I use the Erlang Release tools to
>> generate the final images. This makes for smaller root filesystems
>> (Erlang's libraries are huge and largely irrelevant to most apps) and
>> is more compatible with how Erlang people do things. However, it's
>> definitely not how I think that things should be done in the Buildroot
>> project. I think that you guys are doing it right, so if I work a
>> project that just needs ejabberd or another Erlang app, then I'm going
>> to switch over to this framework. Thanks for doing this!
>
> Is there a way of doing the same as those Erlang Release tools, and
> make sure only the really used libraries are kept?

It might be possible. Almost all Erlang applications use a framework
called OTP. I actually think that you can ignore applications that
don't use OTP since they're almost exclusively toy apps. OTP requires
that each application and library have or generate a .app file that
lists all of its dependencies and some other info. This .app file also
contains information used at run-time, so it's guaranteed to be
installed. If you knew the top level Erlang applications that you
wanted, you could construct the dependency graph through all of the
libraries and either include or exclude them in the final image. The
Erlang release tools do this, but their goal is to copy everything
they need to a "release" directory. It's kind of like copying just the
stuff you need from staging to the target directory, but probably
enough different that the Erlang release tools can't be used as is. I
also suspect that there are enough subtle differences between how
Erlang projects set up their directory structures to make this a
non-trivial effort, but I haven't looked deeply into it.

Frank

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

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 02/16] package/pkg-rebar: new infrastructure
  2015-02-03  9:28   ` Thomas Petazzoni
@ 2015-02-24 17:07     ` Johan Oudinet
  2015-02-24 18:09       ` Frank Hunleth
  0 siblings, 1 reply; 32+ messages in thread
From: Johan Oudinet @ 2015-02-24 17:07 UTC (permalink / raw)
  To: buildroot

Thomas, All,

Sorry for the long delay before replying to this email. I forgot it in
my list and went to holidays in the meantime.

On Tue, Feb 3, 2015 at 10:28 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
>> +# Directories to store rebar dependencies in.
>> +#
>> +# These directories actually only contain symbolic links to Erlang
>> +# applications in either $(HOST_DIR) or $(STAGING_DIR).  One needs
>> +# them to avoid rebar complaining about missing dependencies, as this
>> +# infrastructure tells rebar to NOT download dependencies during
>> +# the build stage.
>> +#
>> +REBAR_HOST_DEPS_DIR = $(HOST_DIR)/usr/share/rebar/deps
>> +REBAR_TARGET_DEPS_DIR = $(STAGING_DIR)/usr/share/rebar/deps
>
> Rather than having those paths, why don't we point directly rebar at
> $(STAGING_DIR)/usr/lib/erlang/lib/ ? This directory already contains
> <erlang-app>-<version> directory for each package, and we would only
> have to create a symlink <erlang-app> --> <erlang-app>-<version>.
>
> But maybe it's cleaner to have something completely separate, I don't know.
>

Indeed, this is to keep $(TARGET_DIR)/usr/lib/erlang/lib directory
clean from unnecessary symlinks.
I'm not even sure it won't break some erlang programs if we add
symlinks there. At least, there is none in my Erlang installation.
Maybe some Erlang guru can give its opinion on this?

-- 
Johan

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Buildroot] [PATCH v6 02/16] package/pkg-rebar: new infrastructure
  2015-02-24 17:07     ` Johan Oudinet
@ 2015-02-24 18:09       ` Frank Hunleth
  0 siblings, 0 replies; 32+ messages in thread
From: Frank Hunleth @ 2015-02-24 18:09 UTC (permalink / raw)
  To: buildroot

Johan, All,

On Tue, Feb 24, 2015 at 12:07 PM, Johan Oudinet <johan.oudinet@gmail.com> wrote:
> Thomas, All,
>
> Sorry for the long delay before replying to this email. I forgot it in
> my list and went to holidays in the meantime.
>
> On Tue, Feb 3, 2015 at 10:28 AM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
>>> +# Directories to store rebar dependencies in.
>>> +#
>>> +# These directories actually only contain symbolic links to Erlang
>>> +# applications in either $(HOST_DIR) or $(STAGING_DIR).  One needs
>>> +# them to avoid rebar complaining about missing dependencies, as this
>>> +# infrastructure tells rebar to NOT download dependencies during
>>> +# the build stage.
>>> +#
>>> +REBAR_HOST_DEPS_DIR = $(HOST_DIR)/usr/share/rebar/deps
>>> +REBAR_TARGET_DEPS_DIR = $(STAGING_DIR)/usr/share/rebar/deps
>>
>> Rather than having those paths, why don't we point directly rebar at
>> $(STAGING_DIR)/usr/lib/erlang/lib/ ? This directory already contains
>> <erlang-app>-<version> directory for each package, and we would only
>> have to create a symlink <erlang-app> --> <erlang-app>-<version>.
>>
>> But maybe it's cleaner to have something completely separate, I don't know.
>>
>
> Indeed, this is to keep $(TARGET_DIR)/usr/lib/erlang/lib directory
> clean from unnecessary symlinks.
> I'm not even sure it won't break some erlang programs if we add
> symlinks there. At least, there is none in my Erlang installation.
> Maybe some Erlang guru can give its opinion on this?

I initially liked the idea of just keeping everything in
/usr/lib/erlang/lib rather than having a rebar/deps directory. My
thinking was that there are other Erlang build tools out there
(rebar3, erlang.mk, mix), so having a deps directory just for rebar
wasn't right. However, I'm the point now where I'm watching how how
things go for me with the new rebar/buildroot integration. The current
rebar integration isn't broken for me, so until I become more
opinionated on this, I wasn't going suggest changing anything. Per
your question, I would be surprised if switching the directory broke
anything.

Frank

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2015-02-24 18:09 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-12  9:32 [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Johan Oudinet
2015-01-12  9:32 ` [Buildroot] [PATCH v6 01/16] package/erlang: export EI_VSN so other packages can use it Johan Oudinet
2015-01-12  9:32 ` [Buildroot] [PATCH v6 02/16] package/pkg-rebar: new infrastructure Johan Oudinet
2015-02-03  9:28   ` Thomas Petazzoni
2015-02-24 17:07     ` Johan Oudinet
2015-02-24 18:09       ` Frank Hunleth
2015-01-12  9:32 ` [Buildroot] [PATCH v6 03/16] docs/manual: add documentation for the pkg-rebar infrastructure Johan Oudinet
2015-01-12  9:32 ` [Buildroot] [PATCH v6 04/16] erlang-goldrush: new package Johan Oudinet
2015-01-12  9:32 ` [Buildroot] [PATCH v6 05/16] erlang-lager: " Johan Oudinet
2015-02-03  9:29   ` Thomas Petazzoni
2015-01-12  9:32 ` [Buildroot] [PATCH v6 06/16] erlang-p1-zlib: " Johan Oudinet
2015-01-12  9:32 ` [Buildroot] [PATCH v6 07/16] erlang-p1-yaml: " Johan Oudinet
2015-01-12  9:32 ` [Buildroot] [PATCH v6 08/16] erlang-p1-xml: " Johan Oudinet
2015-02-03  9:29   ` Thomas Petazzoni
2015-01-12  9:32 ` [Buildroot] [PATCH v6 09/16] erlang-p1-utils: " Johan Oudinet
2015-01-12  9:32 ` [Buildroot] [PATCH v6 10/16] erlang-p1-tls: " Johan Oudinet
2015-01-12  9:32 ` [Buildroot] [PATCH v6 11/16] erlang-p1-stun: " Johan Oudinet
2015-01-12  9:32 ` [Buildroot] [PATCH v6 12/16] erlang-p1-stringprep: " Johan Oudinet
2015-02-03  9:54   ` Thomas Petazzoni
2015-01-12  9:32 ` [Buildroot] [PATCH v6 13/16] erlang-p1-sip: " Johan Oudinet
2015-02-03  9:55   ` Thomas Petazzoni
2015-01-12  9:32 ` [Buildroot] [PATCH v6 14/16] erlang-p1-iconv: " Johan Oudinet
2015-01-12  9:32 ` [Buildroot] [PATCH v6 15/16] erlang-p1-cache-tab: " Johan Oudinet
2015-01-12  9:32 ` [Buildroot] [PATCH v6 16/16] ejabberd: " Johan Oudinet
2015-02-03  9:56   ` Thomas Petazzoni
2015-02-03 10:35     ` Johan Oudinet
2015-02-03 11:32       ` Thomas Petazzoni
2015-02-04 21:17         ` Frank Hunleth
2015-02-05  7:55           ` Thomas Petazzoni
2015-02-05 14:25             ` Frank Hunleth
2015-02-03  9:26 ` [Buildroot] [PATCH v6 00/16] ejabberd: XMPP server Thomas Petazzoni
2015-02-03  9:56   ` Johan Oudinet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.