Makefile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=rpcd
  9. PKG_VERSION:=2016-06-30
  10. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL=$(OPENWRT_GIT)/project/rpcd.git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)
  14. PKG_SOURCE_VERSION:=23417e94d25570e6d62542bac46edd51e8e0243a
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  16. PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
  17. PKG_LICENSE:=ISC
  18. PKG_LICENSE_FILES:=
  19. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
  20. PKG_BUILD_PARALLEL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. include $(INCLUDE_DIR)/cmake.mk
  23. define Build/InstallDev
  24. $(INSTALL_DIR) $(1)/usr/include
  25. $(CP) $(PKG_BUILD_DIR)/include/rpcd $(1)/usr/include/
  26. endef
  27. define Package/rpcd/default
  28. SECTION:=utils
  29. CATEGORY:=Base system
  30. TITLE:=OpenWrt ubus RPC backend server
  31. DEPENDS:=+libubus +libubox
  32. endef
  33. define Package/rpcd
  34. $(Package/rpcd/default)
  35. DEPENDS+= +libuci +libblobmsg-json
  36. endef
  37. define Package/rpcd/description
  38. This package provides the UBUS RPC backend server to expose various
  39. functionality to frontend programs via JSON-RPC.
  40. endef
  41. define Package/rpcd/conffiles
  42. /etc/config/rpcd
  43. endef
  44. define Package/rpcd/install
  45. $(INSTALL_DIR) $(1)/etc/init.d
  46. $(INSTALL_BIN) ./files/rpcd.init $(1)/etc/init.d/rpcd
  47. $(INSTALL_DIR) $(1)/sbin
  48. $(INSTALL_BIN) $(PKG_BUILD_DIR)/rpcd $(1)/sbin/rpcd
  49. $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
  50. $(INSTALL_DATA) $(PKG_BUILD_DIR)/unauthenticated.json $(1)/usr/share/rpcd/acl.d/unauthenticated.json
  51. $(INSTALL_DIR) $(1)/etc/config
  52. $(INSTALL_CONF) ./files/rpcd.config $(1)/etc/config/rpcd
  53. endef
  54. # 1: plugin name
  55. # 2: extra dependencies
  56. # 3: plugin title/description
  57. define BuildPlugin
  58. PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_luci-rpc-mod-$(1)
  59. define Package/rpcd-mod-$(1)
  60. $(Package/rpcd/default)
  61. TITLE+= ($(1) plugin)
  62. DEPENDS+=rpcd $(2)
  63. endef
  64. define Package/rpcd-mod-$(1)/description
  65. $(3)
  66. endef
  67. define Package/rpcd-mod-$(1)/install
  68. $(INSTALL_DIR) $$(1)/usr/lib/rpcd
  69. $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(1).so $$(1)/usr/lib/rpcd/
  70. endef
  71. $$(eval $$(call BuildPackage,rpcd-mod-$(1)))
  72. endef
  73. $(eval $(call BuildPackage,rpcd))
  74. $(eval $(call BuildPlugin,file,,Provides ubus calls for file and directory operations.))
  75. $(eval $(call BuildPlugin,rpcsys,,Provides ubus calls for sysupgrade and password changing.))
  76. $(eval $(call BuildPlugin,iwinfo,+libiwinfo,Provides ubus calls for accessing iwinfo data.))