Makefile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. define Package/rpcd/install
  43. $(INSTALL_DIR) $(1)/etc/init.d
  44. $(INSTALL_BIN) ./files/rpcd.init $(1)/etc/init.d/rpcd
  45. $(INSTALL_DIR) $(1)/sbin
  46. $(INSTALL_BIN) $(PKG_BUILD_DIR)/rpcd $(1)/sbin/rpcd
  47. $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
  48. $(INSTALL_DATA) $(PKG_BUILD_DIR)/unauthenticated.json $(1)/usr/share/rpcd/acl.d/unauthenticated.json
  49. $(INSTALL_DIR) $(1)/etc/config
  50. $(INSTALL_CONF) ./files/rpcd.config $(1)/etc/config/rpcd
  51. endef
  52. # 1: plugin name
  53. # 2: extra dependencies
  54. # 3: plugin title/description
  55. define BuildPlugin
  56. PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_luci-rpc-mod-$(1)
  57. define Package/rpcd-mod-$(1)
  58. $(Package/rpcd/default)
  59. TITLE+= ($(1) plugin)
  60. DEPENDS+=rpcd $(2)
  61. endef
  62. define Package/rpcd-mod-$(1)/description
  63. $(3)
  64. endef
  65. define Package/rpcd-mod-$(1)/install
  66. $(INSTALL_DIR) $$(1)/usr/lib/rpcd
  67. $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(1).so $$(1)/usr/lib/rpcd/
  68. endef
  69. $$(eval $$(call BuildPackage,rpcd-mod-$(1)))
  70. endef
  71. $(eval $(call BuildPackage,rpcd))
  72. $(eval $(call BuildPlugin,file,,Provides ubus calls for file and directory operations.))
  73. $(eval $(call BuildPlugin,rpcsys,,Provides ubus calls for sysupgrade and password changing.))
  74. $(eval $(call BuildPlugin,iwinfo,+libiwinfo,Provides ubus calls for accessing iwinfo data.))