ejabberd: new package
PATCH v2 1/1 ejabberd: new package
Signed-off-by Johan Oudinet <[email protected]>
---
Changes v1 -> v2:
- Run ejabberd as ejabberd user instead of root.
--- package/Config.in | 1 + package/ejabberd/Config.in | 13 +++++++ package/ejabberd/check-erlang-lib | 48 +++++++++++++++++++++++ package/ejabberd/ejabberd.mk | 81 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 143 insertions(+) create mode 100644 package/ejabberd/Config.in create mode 100755 package/ejabberd/check-erlang-lib create mode 100644 package/ejabberd/ejabberd.mk
package/Config.in +1 -0
@@ -937,6 +937,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"
package/ejabberd/Config.in new file +13 -0
@@ -0,0 +1,13 @@ +config BR2_PACKAGE_EJABBERD + bool "ejabberd" + select BR2_PACKAGE_OPENSSL + select BR2_PACKAGE_ERLANG + select BR2_PACKAGE_LIBYAML + select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE + select BR2_PACKAGE_EXPAT + 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
package/ejabberd/check-erlang-lib new file +48 -0
48 lines not on this page · raw message
package/ejabberd/ejabberd.mk new file +81 -0
81 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 1/1 ejabberd: new package
Johan, All,
On 2014-07-16 17:57 +0200, Johan Oudinet spake thusly:
Quoted 1 line
Signed-off-by Johan Oudinet <[email protected]>
Thanks for this follow-up!
I planned on reviewing it tonight, but I had a lot of connection issues at home, so I got side-tracked with those issues...
Anyway, I'm interested in this patch, so I've queued it for review. Don't worry, it's not forgotten. ;-)
Regards,
Yann E. MORIN.
Quoted 192 lines
---
Changes v1 -> v2:
- Run ejabberd as ejabberd user instead of root.--- package/Config.in | 1 + package/ejabberd/Config.in | 13 +++++++ package/ejabberd/check-erlang-lib | 48 +++++++++++++++++++++++ package/ejabberd/ejabberd.mk | 81 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 143 insertions(+) create mode 100644 package/ejabberd/Config.in create mode 100755 package/ejabberd/check-erlang-lib create mode 100644 package/ejabberd/ejabberd.mkpackage/Config.in +1
-0@@ -937,6 +937,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"package/ejabberd/Config.in new file +13
-0@@ -0,0 +1,13 @@ +config BR2_PACKAGE_EJABBERD + bool "ejabberd" + select BR2_PACKAGE_OPENSSL + select BR2_PACKAGE_ERLANG + select BR2_PACKAGE_LIBYAML + select BR2_PACKAGE_LIBICONV if !BR2_ENABLE_LOCALE + select BR2_PACKAGE_EXPAT + 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.impackage/ejabberd/check-erlang-lib new file +48
-0@@ -0,0 +1,48 @@ +#!/bin/sh -e +# Helper to bypass AC_ERLANG_CHECK_LIB + +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." + ;; +esacpackage/ejabberd/ejabberd.mk new file +81
-0@@ -0,0 +1,81 @@ +################################################################################ +# +# ejabberd +# +################################################################################ + +EJABBERD_VERSION = 14.05 +EJABBERD_SITE = $(call github,processone,ejabberd,$(EJABBERD_VERSION)) +EJABBERD_LICENSE = GPLv2+ +EJABBERD_LICENSE_FILES = COPYING +EJABBERD_DEPENDENCIES = libyaml expat openssl erlang + +ifeq ($(BR2_PACKAGE_LIBICONV),y) + EJABBERD_DEPENDENCIES += libiconv +endif + +EJABBERD_ERLANG_LIBS := sasl crypto public_key ssl mnesia inets compiler + +# Do AC_ERLANG_CHECK_LIB job without erlang. +define EJABBERD_SET_LIBS_DIR + for lib in $(EJABBERD_ERLANG_LIBS); do \ + export \ + erlang_lib_dir_$$lib="`package/ejabberd/check-erlang-lib $$lib`"; \ + done +endef + +# Set cross-compilation options to the configure called by rebar. +define EJABBERD_FIX_REBAR_CONFIG_SCRIPT + sed -e "s,./configure,./configure \\ \ + --target=$(GNU_TARGET_NAME) \\ \ + --host=$(GNU_TARGET_NAME) \\ \ + --build=$(GNU_HOST_NAME)," \ + -i "$(@D)"/rebar.config.script +endef + +EJABBERD_PRE_CONFIGURE_HOOKS += \ + EJABBERD_SET_LIBS_DIR \ + EJABBERD_FIX_REBAR_CONFIG_SCRIPT + +# 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)="$$erlang_lib_dir_$(lib)") + +# Set environment variables so the rebar compile command does +# cross-compile ejabberd dependencies. +EJABBERD_MAKE_ENV = \ + $(TARGET_CONFIGURE_OPTS) \ + $(TARGET_CONFIGURE_ARGS) \ + LDFLAGS="-L$(HOST_DIR)/usr/$(GNU_TARGET_NAME)/sysroot/usr/lib/erlang/usr/lib" + +# Delete HOST_DIR prefix from ERL path in ejabberctl script. +define EJABBERD_FIX_EJABBERDCTL + sed -e "s,ERL=$(HOST_DIR),ERL=," \ + -e "s,INSTALLUSER=,INSTALLUSER=ejabberd," \ + -i "$(TARGET_DIR)"/usr/sbin/ejabberdctl +endef + +EJABBERD_POST_INSTALL_TARGET_HOOKS += EJABBERD_FIX_EJABBERDCTL + +define EJABBERD_PERMISSIONS +/etc/ejabberd d 750 0 128 - - - - - +/etc/ejabberd/ejabberd.yml-new f 640 0 128 - - - - - +/etc/ejabberd/ejabberd.yml f 640 0 128 - - - - - +/etc/ejabberd/ejabberdctl.cfg-new f 640 0 128 - - - - - +/etc/ejabberd/ejabberdctl.cfg f 640 0 128 - - - - - +/etc/ejabberd/inetrc f 644 0 128 - - - - - +/usr/sbin/ejabberdctl f 550 0 128 - - - - - +/usr/lib/ejabberd/priv/bin/captcha.sh f 750 119 0 - - - - - +/usr/var/lib/ejabberd d 750 119 0 - - - - - +/usr/var/lock/ejabberdctl d 750 119 0 - - - - - +/usr/var/log/ejabberd d 750 119 0 - - - - - +endef + +define EJABBERD_USERS +ejabberd 119 ejabberd 128 * /var/run/ejabberd - - ejabberd daemon +endef + +$(eval $(autotools-package))Signature · 6 lines
1.9.1 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'