93610685eb830a93eceb9dfeb1990c50f8dbd95b
[openwrt/svn-archive/archive.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-13
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)
17 PKG_SOURCE_VERSION:=a23010d4072f01aa525e99f726ce49792c908473
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_DIR:=$(BUILD_DIR)/$(PKG_NAME)
25 PKG_BUILD_PARALLEL:=1
26
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/cmake.mk
29
30 define Build/InstallDev
31 $(INSTALL_DIR) $(1)/usr/include
32 $(CP) $(PKG_BUILD_DIR)/include/rpcd $(1)/usr/include/
33 endef
34
35 define Package/rpcd/default
36 SECTION:=utils
37 CATEGORY:=Base system
38 TITLE:=OpenWrt ubus RPC backend server
39 DEPENDS:=+libubus +libubox
40 endef
41
42 define Package/rpcd
43 $(Package/rpcd/default)
44 DEPENDS+= +libuci +libblobmsg-json
45 endef
46
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.
50 endef
51
52 define Package/rpcd/conffiles
53 /etc/config/rpcd
54 endef
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,iwinfo,+libiwinfo,Provides ubus calls for accessing iwinfo data.))