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