From patchwork Sat Nov 28 00:15:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Prado X-Patchwork-Id: 549605 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 7325F1402D0 for ; Sat, 28 Nov 2015 11:16:10 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=e-labworks-com.20150623.gappssmtp.com header.i=@e-labworks-com.20150623.gappssmtp.com header.b=grf4eQXY; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5344A88340; Sat, 28 Nov 2015 00:16:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YwbxFJSPjYf9; Sat, 28 Nov 2015 00:16:04 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 77047887D8; Sat, 28 Nov 2015 00:16:04 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 06B871CF2CF for ; Sat, 28 Nov 2015 00:16:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 00CFA264FE for ; Sat, 28 Nov 2015 00:16:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id usaSZOLqb2-D for ; Sat, 28 Nov 2015 00:16:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qg0-f43.google.com (mail-qg0-f43.google.com [209.85.192.43]) by silver.osuosl.org (Postfix) with ESMTPS id C128625E1B for ; Sat, 28 Nov 2015 00:15:59 +0000 (UTC) Received: by qgea14 with SMTP id a14so81882863qge.0 for ; Fri, 27 Nov 2015 16:15:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=e-labworks-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=d/6cDpRWTvceP8i1viiemrMqSDKExR9wr8rZLqMwp/o=; b=grf4eQXY85XQi/pNrobJc8LtLJhwOJHbDbi8GjTRj3l9av23N3ppq4KWnj/EQeZivp 7GJEKyNpQc08nY1XlUkcuQBj7FX6mWCjvKgGlt+i3b+SGFI3uf/cRN3bZmcR8i1rdQ57 chpVbdmPLPuxLVaBxr3c4atWPBUBmZ7yOxUfEbo8Z+RHz7cTMikbQQ1DfrzVF7kWmGFG gOxVM7AQGSl4fz16ts/P8BZ1+PptFYcqGGCxpqi65VgB79ICdoZMchpOZhMCwjmZg8Pn AvRN1iWScl/qsFmvMBz0oXuDGu4wReF1FXBqm26wRuMsS2dmhjZk6Sm7u39X81sf2LOv yw0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=d/6cDpRWTvceP8i1viiemrMqSDKExR9wr8rZLqMwp/o=; b=BH7QJ2J1eNshgyJ3mkHJUlE651iSndlTdK3qEqLAsNGk6CYwWKE+1YA++QN+9NyTDB st8Pw2+VH+H7zl4O8YcHsYizeOk8O6JdXTBLU+4PIwm6D3chPheKCnYWWGG3LQ4OG1Z6 8ZV/vaX5Vayw0yNHGkZebKG3xUcYF/pBxfeiURyl66DbFusVJsZc70GO+P0TGWjHhjZw L7bInJw8LDMWV+v+h+w4RNvlVY7hV6caO8/QNFDUNJW9ZWpjf/P8t/ugr9HgNkbSn6f7 a5ewik1kgQH2pZFGWz1fBzrJSQ4Y8zdL5Hp1sPilYGE89Wm6sBHAtTlAWFeSYRRcFl+2 k2pQ== X-Gm-Message-State: ALoCoQlTYv2rfODMOaYUdhGd/EAFZy42CJBovecsPTx1q/WLV1H4CMoShdfJBDXSSVySXm1DL4sc X-Received: by 10.140.161.137 with SMTP id h131mr28922586qhh.57.1448669758846; Fri, 27 Nov 2015 16:15:58 -0800 (PST) Received: from localhost.localdomain ([177.141.170.120]) by smtp.gmail.com with ESMTPSA id d4sm10310642qga.39.2015.11.27.16.15.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Nov 2015 16:15:58 -0800 (PST) From: Sergio Prado To: buildroot@buildroot.org Date: Fri, 27 Nov 2015 22:15:38 -0200 Message-Id: <1448669738-18880-1-git-send-email-sergio.prado@e-labworks.com> X-Mailer: git-send-email 1.9.1 Subject: [Buildroot] [PATCH] ubus: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Sergio Prado --- package/Config.in | 1 + .../0001-Install-server-and-client-examples.patch | 22 ++++++++++ package/ubus/Config.in | 26 ++++++++++++ package/ubus/ubus.hash | 2 + package/ubus/ubus.mk | 47 ++++++++++++++++++++++ 5 files changed, 98 insertions(+) create mode 100644 package/ubus/0001-Install-server-and-client-examples.patch create mode 100644 package/ubus/Config.in create mode 100644 package/ubus/ubus.hash create mode 100644 package/ubus/ubus.mk diff --git a/package/Config.in b/package/Config.in index 988fe844b872..12a3e91c8e44 100644 --- a/package/Config.in +++ b/package/Config.in @@ -430,6 +430,7 @@ endif source "package/ti-utils/Config.in" source "package/triggerhappy/Config.in" source "package/uboot-tools/Config.in" + source "package/ubus/Config.in" source "package/udev/Config.in" source "package/udisks/Config.in" source "package/usb_modeswitch/Config.in" diff --git a/package/ubus/0001-Install-server-and-client-examples.patch b/package/ubus/0001-Install-server-and-client-examples.patch new file mode 100644 index 000000000000..81e664f2beea --- /dev/null +++ b/package/ubus/0001-Install-server-and-client-examples.patch @@ -0,0 +1,22 @@ +Install server and client examples + +Signed-off-by: Sergio Prado +--- + examples/CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index 0279f6e66b50..7cec87e5e8f9 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -10,3 +10,7 @@ IF (BUILD_EXAMPLES) + ADD_EXECUTABLE(client client.c count.c) + TARGET_LINK_LIBRARIES(client ubus ubox) + ENDIF() ++ ++INSTALL(TARGETS server client ++ RUNTIME DESTINATION sbin ++) +-- +1.9.1 + diff --git a/package/ubus/Config.in b/package/ubus/Config.in new file mode 100644 index 000000000000..fa89c8f3cd68 --- /dev/null +++ b/package/ubus/Config.in @@ -0,0 +1,26 @@ +config BR2_PACKAGE_UBUS + bool "ubus" + select BR2_PACKAGE_LIBUBOX + select BR2_PACKAGE_JSON_C + depends on !BR2_STATIC_LIBS # libubox + help + IPC/RPC bus that allows communication between processes. + + It consists of few parts including a daemon (ubusd), a library + (libubus) and a command line interface (ubus). Although created + for the OpenWRT project, it can be used as a general IPC/RPC + mechanism in other projects. + + * Select BR2_PACKAGE_LUA_5_1 if you want to have Lua support. + + https://wiki.openwrt.org/doc/techref/ubus + +if BR2_PACKAGE_UBUS + +config BR2_PACKAGE_UBUS_EXAMPLES + bool "build and install ubus examples" + default n + help + Build and install client and server ubus examples. + +endif diff --git a/package/ubus/ubus.hash b/package/ubus/ubus.hash new file mode 100644 index 000000000000..af9b652b0e1d --- /dev/null +++ b/package/ubus/ubus.hash @@ -0,0 +1,2 @@ +# No hash for this git snapshot +none xxx ubus-259450f414d8c9ee41896e8e6d6bc57ec00e2b63.tar.gz diff --git a/package/ubus/ubus.mk b/package/ubus/ubus.mk new file mode 100644 index 000000000000..2ecc023e110a --- /dev/null +++ b/package/ubus/ubus.mk @@ -0,0 +1,47 @@ +################################################################################ +# +# ubus +# +################################################################################ + +UBUS_VERSION = 259450f414d8c9ee41896e8e6d6bc57ec00e2b63 +UBUS_SITE = git://git.openwrt.org/project/ubus.git + +UBUS_LICENSE = LGPLv2.1 +UBUS_LICENSE_FILES = ubusd_acl.h + +UBUS_INSTALL_STAGING = YES + +UBUS_DEPENDENCIES = json-c libubox + +# package only compiles with Lua 5.1 +ifeq ($(BR2_PACKAGE_LUA_5_1),y) +UBUS_DEPENDENCIES += lua +UBUS_CONF_OPTS += -DBUILD_LUA=ON \ + -DLUA_CFLAGS=-I$(STAGING_DIR)/usr/include \ + -DLUAPATH=/usr/lib/lua/$(LUAINTERPRETER_ABIVER) +else +UBUS_CONF_OPTS += -DBUILD_LUA=OFF +endif + +ifeq ($(BR2_PACKAGE_SYSTEMD),y) +UBUS_DEPENDENCIES += systemd +UBUS_CONF_OPTS += -DENABLE_SYSTEMD=ON +else +UBUS_CONF_OPTS += -DENABLE_SYSTEMD=OFF +endif + +ifeq ($(BR2_PACKAGE_UBUS_EXAMPLES),y) +UBUS_CONF_OPTS += -DBUILD_EXAMPLES=ON +else +UBUS_CONF_OPTS += -DBUILD_EXAMPLES=OFF +endif + +define UBUS_INSTALL_STAGING_CMDS + $(INSTALL) -D -m 0755 $(@D)/libubus.so* $(STAGING_DIR)/usr/lib + $(INSTALL) -D -m 0644 $(@D)/ubusmsg.h $(STAGING_DIR)/usr/include + $(INSTALL) -D -m 0644 $(@D)/ubus_common.h $(STAGING_DIR)/usr/include + $(INSTALL) -D -m 0644 $(@D)/libubus.h $(STAGING_DIR)/usr/include +endef + +$(eval $(cmake-package))