treewide: use APK compatible version schema
[openwrt/staging/stintel.git] / package / network / config / qosify / Makefile
1 #
2 # Copyright (C) 2021 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=qosify
12 PKG_SOURCE_URL=$(PROJECT_GIT)/project/qosify.git
13 PKG_SOURCE_PROTO:=git
14 PKG_SOURCE_DATE:=2023-03-07
15 PKG_SOURCE_VERSION:=9a47ea4b683dd845ec94534fcd82d3117c9ab313
16 PKG_MIRROR_HASH:=0df1dc6e9645691f1ce0c3c039afedbcd8d4635dad36923ce47174e8d5b4ce43
17 PKG_RELEASE:=1
18
19 PKG_LICENSE:=GPL-2.0
20 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
21
22 PKG_BUILD_DEPENDS:=bpf-headers
23 PKG_FLAGS:=nonshared
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/cmake.mk
27 include $(INCLUDE_DIR)/bpf.mk
28 include $(INCLUDE_DIR)/nls.mk
29
30 define Package/qosify
31 SECTION:=utils
32 CATEGORY:=Base system
33 TITLE:=A simple QoS solution based eBPF + CAKE
34 DEPENDS:=+libbpf +libubox +libubus +libnl-tiny +kmod-sched-cake +kmod-sched-bpf +kmod-ifb +tc $(BPF_DEPENDS)
35 endef
36
37 TARGET_CFLAGS += \
38 -Wno-error=deprecated-declarations \
39 -I$(STAGING_DIR)/usr/include/libnl-tiny \
40 -I$(STAGING_DIR)/usr/include
41
42 CMAKE_OPTIONS += \
43 -DLIBNL_LIBS=-lnl-tiny
44
45 define Build/Compile
46 $(call CompileBPF,$(PKG_BUILD_DIR)/qosify-bpf.c)
47 $(Build/Compile/Default)
48 endef
49
50 define Package/qosify/conffiles
51 /etc/config/qosify
52 /etc/qosify/00-defaults.conf
53 endef
54
55 define Package/qosify/install
56 $(INSTALL_DIR) \
57 $(1)/lib/bpf \
58 $(1)/usr/sbin \
59 $(1)/etc/init.d \
60 $(1)/etc/config \
61 $(1)/etc/qosify \
62 $(1)/etc/hotplug.d/net \
63 $(1)/etc/hotplug.d/iface
64 $(INSTALL_DATA) $(PKG_BUILD_DIR)/qosify-bpf.o $(1)/lib/bpf
65 $(INSTALL_BIN) \
66 $(PKG_INSTALL_DIR)/usr/bin/qosify \
67 ./files/qosify-status \
68 $(1)/usr/sbin/
69 $(INSTALL_BIN) ./files/qosify.init $(1)/etc/init.d/qosify
70 $(INSTALL_DATA) ./files/qosify-defaults.conf $(1)/etc/qosify/00-defaults.conf
71 $(INSTALL_DATA) ./files/qosify.conf $(1)/etc/config/qosify
72 $(INSTALL_DATA) ./files/qosify.hotplug $(1)/etc/hotplug.d/net/10-qosify
73 $(INSTALL_DATA) ./files/qosify.hotplug $(1)/etc/hotplug.d/iface/10-qosify
74 endef
75
76 $(eval $(call BuildPackage,qosify))