summaryrefslogtreecommitdiff
path: root/package/system
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-09-02 15:36:51 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-09-02 15:36:51 +0000
commit6ad56bf49c675cfd2c2f4b7a99aca3a256b4d31c (patch)
tree4dc010ec1d13501bff1a71c114f0925e8740d572 /package/system
parentad2b7bfcc253cb137d69e4986e4c3e227cd7de55 (diff)
Add rpcd - an extensible backend server for ubus-over-json-rpc operations, session and acl management.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37877 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/system')
-rw-r--r--package/system/rpcd/Makefile83
-rwxr-xr-xpackage/system/rpcd/files/rpcd.init14
2 files changed, 97 insertions, 0 deletions
diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile
new file mode 100644
index 0000000000..0decaa651f
--- /dev/null
+++ b/package/system/rpcd/Makefile
@@ -0,0 +1,83 @@
+#
+# Copyright (C) 2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=rpcd
+PKG_VERSION:=2013-09-02
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://nbd.name/luci2/rpcd.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=11f37e28898b12bf53d8df6272fa28c48d79a96b
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
+
+PKG_LICENSE:=ISC
+PKG_LICENSE_FILES:=
+
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/rpcd/default
+ SECTION:=utils
+ CATEGORY:=Base system
+ TITLE:=OpenWrt ubus RPC backend server
+ DEPENDS:=+libubus +libubox
+endef
+
+define Package/rpcd
+ $(Package/rpcd/default)
+ DEPENDS+= +libuci +libblobmsg-json
+endef
+
+define Package/rpcd/description
+ This package provides the UBUS RPC backend server to expose various
+ functionality to frontend programs via JSON-RPC.
+endef
+
+define Package/rpcd/install
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/rpcd.init $(1)/etc/init.d/rpcd
+ $(INSTALL_DIR) $(1)/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/rpcd $(1)/sbin/rpcd
+endef
+
+
+# 1: plugin name
+# 2: extra dependencies
+# 3: plugin title/description
+define BuildPlugin
+
+ PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_luci-rpc-mod-$(1)
+
+ define Package/rpcd-mod-$(1)
+ $(Package/rpcd/default)
+ TITLE+= ($(1) plugin)
+ DEPENDS+=rpcd $(2)
+ endef
+
+ define Package/rpcd-mod-$(1)/description
+ $(3)
+ endef
+
+ define Package/rpcd-mod-$(1)/install
+ $(INSTALL_DIR) $$(1)/usr/lib/rpcd
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(1).so $$(1)/usr/lib/rpcd/
+ endef
+
+ $$(eval $$(call BuildPackage,rpcd-mod-$(1)))
+
+endef
+
+$(eval $(call BuildPackage,rpcd))
+$(eval $(call BuildPlugin,file,,Provides ubus calls for file and directory operations.))
+$(eval $(call BuildPlugin,luci2,,Provides LuCI2 specific backend calls.))
+$(eval $(call BuildPlugin,iwinfo,+libiwinfo,Provides ubus calls for accessing iwinfo data.))
diff --git a/package/system/rpcd/files/rpcd.init b/package/system/rpcd/files/rpcd.init
new file mode 100755
index 0000000000..2b8f04f848
--- /dev/null
+++ b/package/system/rpcd/files/rpcd.init
@@ -0,0 +1,14 @@
+#!/bin/sh /etc/rc.common
+
+START=12
+
+SERVICE_DAEMONIZE=1
+SERVICE_WRITE_PID=1
+
+start() {
+ service_start /sbin/rpcd
+}
+
+stop() {
+ service_stop /sbin/rpcd
+}