d13f20eab41861beaf6ef90354af996e8cd5ef76
[openwrt/openwrt.git] / package / system / rpcd / Makefile
1 #
2 # Copyright (C) 2013-2016 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_RELEASE:=1
12
13 PKG_SOURCE_PROTO:=git
14 PKG_SOURCE_URL=$(LEDE_GIT)/project/rpcd.git
15 PKG_SOURCE_DATE:=2016-12-03
16 PKG_SOURCE_VERSION:=0577cfc1acdbaf30c31090e75045ba58d6dd8a78
17 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
18 PKG_MIRROR_HASH:=bbcd750df4867a57604e3b922e28f7a019cf940c3586d813d88001dc314e2a1c
19
20 PKG_LICENSE:=ISC
21 PKG_LICENSE_FILES:=
22
23 PKG_BUILD_PARALLEL:=1
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/cmake.mk
27
28 define Build/InstallDev
29 $(INSTALL_DIR) $(1)/usr/include
30 $(CP) $(PKG_BUILD_DIR)/include/rpcd $(1)/usr/include/
31 endef
32
33 define Package/rpcd/default
34 SECTION:=utils
35 CATEGORY:=Base system
36 TITLE:=OpenWrt ubus RPC backend server
37 DEPENDS:=+libubus +libubox
38 endef
39
40 define Package/rpcd
41 $(Package/rpcd/default)
42 DEPENDS+= +libuci +libblobmsg-json
43 endef
44
45 define Package/rpcd/description
46 This package provides the UBUS RPC backend server to expose various
47 functionality to frontend programs via JSON-RPC.
48 endef
49
50 define Package/rpcd/conffiles
51 /etc/config/rpcd
52 endef
53
54 TARGET_LDFLAGS += -lcrypt
55
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
65 endef
66
67
68 # 1: plugin name
69 # 2: extra dependencies
70 # 3: plugin title/description
71 define BuildPlugin
72
73 PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_luci-rpc-mod-$(1)
74
75 define Package/rpcd-mod-$(1)
76 $(Package/rpcd/default)
77 TITLE+= ($(1) plugin)
78 DEPENDS+=rpcd $(2)
79 endef
80
81 define Package/rpcd-mod-$(1)/description
82 $(3)
83 endef
84
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/
88 endef
89
90 $$(eval $$(call BuildPackage,rpcd-mod-$(1)))
91
92 endef
93
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.))