Add rpcd - an extensible backend server for ubus-over-json-rpc operations, session...
[openwrt/staging/mkresin.git] / package / system / rpcd / Makefile
1 #
2 # Copyright (C) 2013 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=rpcd
11 PKG_VERSION:=2013-09-02
12 PKG_RELEASE=$(PKG_SOURCE_VERSION)
13
14 PKG_SOURCE_PROTO:=git
15 PKG_SOURCE_URL:=git://nbd.name/luci2/rpcd.git
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17 PKG_SOURCE_VERSION:=11f37e28898b12bf53d8df6272fa28c48d79a96b
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
19 PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
20
21 PKG_LICENSE:=ISC
22 PKG_LICENSE_FILES:=
23
24 PKG_BUILD_PARALLEL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27 include $(INCLUDE_DIR)/cmake.mk
28
29 define Package/rpcd/default
30 SECTION:=utils
31 CATEGORY:=Base system
32 TITLE:=OpenWrt ubus RPC backend server
33 DEPENDS:=+libubus +libubox
34 endef
35
36 define Package/rpcd
37 $(Package/rpcd/default)
38 DEPENDS+= +libuci +libblobmsg-json
39 endef
40
41 define Package/rpcd/description
42 This package provides the UBUS RPC backend server to expose various
43 functionality to frontend programs via JSON-RPC.
44 endef
45
46 define Package/rpcd/install
47 $(INSTALL_DIR) $(1)/etc/init.d
48 $(INSTALL_BIN) ./files/rpcd.init $(1)/etc/init.d/rpcd
49 $(INSTALL_DIR) $(1)/sbin
50 $(INSTALL_BIN) $(PKG_BUILD_DIR)/rpcd $(1)/sbin/rpcd
51 endef
52
53
54 # 1: plugin name
55 # 2: extra dependencies
56 # 3: plugin title/description
57 define BuildPlugin
58
59 PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_luci-rpc-mod-$(1)
60
61 define Package/rpcd-mod-$(1)
62 $(Package/rpcd/default)
63 TITLE+= ($(1) plugin)
64 DEPENDS+=rpcd $(2)
65 endef
66
67 define Package/rpcd-mod-$(1)/description
68 $(3)
69 endef
70
71 define Package/rpcd-mod-$(1)/install
72 $(INSTALL_DIR) $$(1)/usr/lib/rpcd
73 $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(1).so $$(1)/usr/lib/rpcd/
74 endef
75
76 $$(eval $$(call BuildPackage,rpcd-mod-$(1)))
77
78 endef
79
80 $(eval $(call BuildPackage,rpcd))
81 $(eval $(call BuildPlugin,file,,Provides ubus calls for file and directory operations.))
82 $(eval $(call BuildPlugin,luci2,,Provides LuCI2 specific backend calls.))
83 $(eval $(call BuildPlugin,iwinfo,+libiwinfo,Provides ubus calls for accessing iwinfo data.))