1
0

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