1
0

Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=ubus
  3. PKG_RELEASE:=1
  4. PKG_SOURCE_PROTO:=git
  5. PKG_SOURCE_URL=$(PROJECT_GIT)/ubus.git
  6. PKG_SOURCE_DATE:=2023-06-05
  7. PKG_SOURCE_VERSION:=f787c97b34894a38b15599886cacbca01271684f
  8. PKG_MIRROR_HASH:=f4e898eb9207f069652f1767835f6aa9f015df2282d51e50ab57a0c3736f36e3
  9. PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
  10. CMAKE_INSTALL:=1
  11. PKG_LICENSE:=LGPL-2.1
  12. PKG_LICENSE_FILES:=
  13. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  14. PKG_BUILD_FLAGS:=lto
  15. PKG_ASLR_PIE_REGULAR:=1
  16. include $(INCLUDE_DIR)/package.mk
  17. include $(INCLUDE_DIR)/cmake.mk
  18. define Package/ubus
  19. SECTION:=base
  20. CATEGORY:=Base system
  21. DEPENDS:=+libubus +libblobmsg-json +ubusd
  22. TITLE:=libreCMC RPC client utility
  23. endef
  24. define Package/ubusd
  25. SECTION:=base
  26. CATEGORY:=Base system
  27. TITLE:=libreCMC RPC daemon
  28. DEPENDS:=+libubox +libblobmsg-json
  29. USERID:=ubus=81:ubus=81
  30. endef
  31. define Package/libubus
  32. SECTION:=libs
  33. CATEGORY:=Libraries
  34. DEPENDS:=+libubox
  35. ABI_VERSION:=$(PKG_ABI_VERSION)
  36. TITLE:=libreCMC RPC client library
  37. endef
  38. define Package/libubus-lua
  39. SECTION:=libs
  40. CATEGORY:=Libraries
  41. DEPENDS:=+libubus +liblua
  42. TITLE:=Lua binding for the libreCMC RPC client
  43. endef
  44. TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
  45. CMAKE_OPTIONS += \
  46. -DLUAPATH=/usr/lib/lua \
  47. -DABIVERSION="$(PKG_ABI_VERSION)"
  48. define Package/ubus/install
  49. $(INSTALL_DIR) $(1)/bin
  50. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ubus $(1)/bin/
  51. endef
  52. define Package/ubusd/install
  53. $(INSTALL_DIR) $(1)/sbin
  54. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ubusd $(1)/sbin/
  55. endef
  56. define Package/libubus/install
  57. $(INSTALL_DIR) $(1)/lib
  58. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libubus.so.* $(1)/lib/
  59. endef
  60. define Package/libubus-lua/install
  61. $(INSTALL_DIR) $(1)/usr/lib/lua
  62. $(CP) $(PKG_BUILD_DIR)/lua/ubus.so $(1)/usr/lib/lua/
  63. endef
  64. $(eval $(call BuildPackage,libubus))
  65. $(eval $(call BuildPackage,libubus-lua))
  66. $(eval $(call BuildPackage,ubus))
  67. $(eval $(call BuildPackage,ubusd))