644e64d195f31b7eb7ad13a207c3ad27c8675081
[openwrt/openwrt.git] / package / system / ubox / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=ubox
4 PKG_RELEASE:=1
5
6 PKG_SOURCE_PROTO:=git
7 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubox.git
8 PKG_SOURCE_DATE:=2019-03-21
9 PKG_SOURCE_VERSION:=a782779552a0d68e3bb588e3039eb95da15ec7b0
10 PKG_MIRROR_HASH:=875e60dafb12c68a95b39cb29985540a815ff2823919cd963a9748b635303d21
11 CMAKE_INSTALL:=1
12
13 PKG_LICENSE:=GPL-2.0
14 PKG_LICENSE_FILES:=
15
16 PKG_MAINTAINER:=John Crispin <john@phrozen.org>
17
18 include $(INCLUDE_DIR)/package.mk
19 include $(INCLUDE_DIR)/cmake.mk
20
21 TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt)
22
23 define Package/ubox
24 SECTION:=base
25 CATEGORY:=Base system
26 DEPENDS:=+libubox +ubusd +ubus +libubus +libuci +USE_GLIBC:librt
27 TITLE:=OpenWrt system helper toolbox
28 endef
29
30 define Package/logd
31 SECTION:=base
32 CATEGORY:=Base system
33 DEPENDS:=+libubox +libubus +libblobmsg-json +USE_GLIBC:librt
34 TITLE:=OpenWrt system log implementation
35 endef
36
37 define Package/ubox/install
38 $(INSTALL_DIR) $(1)/sbin $(1)/usr/sbin $(1)/lib $(1)/usr/bin
39
40 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{kmodloader,validate_data} $(1)/sbin/
41 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getrandom $(1)/usr/bin/
42 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libvalidate.so $(1)/lib
43
44 $(LN) kmodloader $(1)/sbin/rmmod
45 $(LN) kmodloader $(1)/sbin/insmod
46 $(LN) kmodloader $(1)/sbin/lsmod
47 $(LN) kmodloader $(1)/sbin/modinfo
48 $(LN) kmodloader $(1)/sbin/modprobe
49 endef
50
51 define Package/logd/install
52 $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d/
53
54 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{logd,logread} $(1)/sbin/
55 $(INSTALL_BIN) ./files/log.init $(1)/etc/init.d/log
56 endef
57
58 $(eval $(call BuildPackage,ubox))
59 $(eval $(call BuildPackage,logd))