2 # Copyright (C) 2013-2016 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
11 PKG_VERSION:=2016-04-13
12 PKG_RELEASE=$(PKG_SOURCE_VERSION)
15 PKG_SOURCE_URL=$(LEDE_GIT)/project/rpcd.git
16 PKG_SOURCE_SUBDIR:=$(PKG_NAME)
17 PKG_SOURCE_VERSION:=73aea9b8b621a1ce034bc6ee00c9d058a40c8a3d
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
19 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
24 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/cmake.mk
30 define Build/InstallDev
31 $(INSTALL_DIR) $(1)/usr/include
32 $(CP) $(PKG_BUILD_DIR)/include/rpcd $(1)/usr/include/
35 define Package/rpcd/default
38 TITLE:=OpenWrt ubus RPC backend server
39 DEPENDS:=+libubus +libubox
43 $(Package/rpcd/default)
44 DEPENDS+= +libuci +libblobmsg-json
47 define Package/rpcd/description
48 This package provides the UBUS RPC backend server to expose various
49 functionality to frontend programs via JSON-RPC.
52 define Package/rpcd/conffiles
56 define Package/rpcd/install
57 $(INSTALL_DIR) $(1)/etc/init.d
58 $(INSTALL_BIN) ./files/rpcd.init $(1)/etc/init.d/rpcd
59 $(INSTALL_DIR) $(1)/sbin
60 $(INSTALL_BIN) $(PKG_BUILD_DIR)/rpcd $(1)/sbin/rpcd
61 $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
62 $(INSTALL_DATA) $(PKG_BUILD_DIR)/unauthenticated.json $(1)/usr/share/rpcd/acl.d/unauthenticated.json
63 $(INSTALL_DIR) $(1)/etc/config
64 $(INSTALL_CONF) ./files/rpcd.config $(1)/etc/config/rpcd
69 # 2: extra dependencies
70 # 3: plugin title/description
73 PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_luci-rpc-mod-$(1)
75 define Package/rpcd-mod-$(1)
76 $(Package/rpcd/default)
81 define Package/rpcd-mod-$(1)/description
85 define Package/rpcd-mod-$(1)/install
86 $(INSTALL_DIR) $$(1)/usr/lib/rpcd
87 $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(1).so $$(1)/usr/lib/rpcd/
90 $$(eval $$(call BuildPackage,rpcd-mod-$(1)))
94 $(eval $(call BuildPackage,rpcd))
95 $(eval $(call BuildPlugin,file,,Provides ubus calls for file and directory operations.))
96 $(eval $(call BuildPlugin,rpcsys,,Provides ubus calls for sysupgrade and password changing.))
97 $(eval $(call BuildPlugin,iwinfo,+libiwinfo,Provides ubus calls for accessing iwinfo data.))