batctl: update to version 2024.0
[feed/routing.git] / batctl / Makefile
1 # SPDX-License-Identifier: GPL-2.0-only
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=batctl
6 PKG_VERSION:=2024.0
7 PKG_RELEASE:=1
8
9 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
10 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
11 PKG_HASH:=76853e87201af63c411db152fd0c625a729a9733115897d1331604e2c5a67c7d
12 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
13
14 PKG_MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de>
15 PKG_LICENSE:=GPL-2.0-only ISC MIT
16 PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT LICENSES/deprecated/ISC
17
18 PKG_BUILD_PARALLEL:=1
19 PKG_BUILD_FLAGS:=gc-sections lto
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/batctl/Default
24 SECTION:=net
25 CATEGORY:=Network
26 URL:=https://www.open-mesh.org/
27 DEPENDS:=+libnl-tiny +libc +librt
28 PROVIDES:=batctl
29 endef
30
31 define Package/batctl/description
32 batctl is a more intuitive managment utility for B.A.T.M.A.N.-Advanced.
33 It is an easier method for configuring batman-adv and provides some
34 additional tools for debugging as well. This package builds
35 version $(PKG_VERSION) of the user space utility.
36 endef
37
38 define Package/batctl-tiny
39 $(call Package/batctl/Default)
40 TITLE:=B.A.T.M.A.N. Advanced user space configuration tool (Minimal)
41 VARIANT:=tiny
42 ALTERNATIVES:=100:/usr/sbin/batctl:/usr/libexec/batctl-tiny
43 endef
44
45 define Package/batctl-tiny/description
46 $(Package/batctl/description)
47 Only configuration relevant subcommands are enabled.
48 endef
49
50 define Package/batctl-default
51 $(call Package/batctl/Default)
52 TITLE:=B.A.T.M.A.N. Advanced user space configuration tool (Default)
53 VARIANT:=default
54 ALTERNATIVES:=200:/usr/sbin/batctl:/usr/libexec/batctl-default
55 endef
56
57 define Package/batctl-default/description
58 $(Package/batctl/description)
59 Standard subcommands for configuration and online debugging are enabled.
60 endef
61
62 define Package/batctl-full
63 $(call Package/batctl/Default)
64 TITLE:=B.A.T.M.A.N. Advanced user space configuration tool (Full)
65 VARIANT:=full
66 ALTERNATIVES:=300:/usr/sbin/batctl:/usr/libexec/batctl-full
67 endef
68
69 define Package/batctl-full/description
70 $(Package/batctl/description)
71 Subcommands for configuration, online and offline debugging are enabled.
72 endef
73
74 MAKE_VARS += \
75 LIBNL_NAME="libnl-tiny" \
76 LIBNL_GENL_NAME="libnl-tiny"
77
78 MAKE_FLAGS += \
79 REVISION="$(PKG_VERSION)-openwrt-$(PKG_RELEASE)"
80
81 config-n := \
82 aggregation \
83 ap_isolation \
84 backbonetable \
85 bisect_iv \
86 bonding \
87 bla_backbone_json \
88 bla_claim_json \
89 bridge_loop_avoidance \
90 claimtable \
91 dat_cache \
92 dat_cache_json \
93 distributed_arp_table \
94 elp_interval \
95 event \
96 fragmentation \
97 gateways \
98 gateways_json \
99 gw_mode \
100 hardif_json \
101 hardifs_json \
102 hop_penalty \
103 interface \
104 isolation_mark \
105 loglevel \
106 mcast_flags \
107 mcast_flags_json \
108 mesh_json \
109 multicast_fanout \
110 multicast_forceflood \
111 multicast_mode \
112 neighbors \
113 neighbors_json \
114 network_coding \
115 orig_interval \
116 originators \
117 originators_json \
118 ping \
119 routing_algo \
120 statistics \
121 tcpdump \
122 throughput_override \
123 throughputmeter \
124 traceroute \
125 transglobal \
126 translate \
127 translocal \
128 transtable_global_json \
129 transtable_local_json \
130 vlan_json \
131
132 config-settings := \
133 aggregation \
134 ap_isolation \
135 bonding \
136 bridge_loop_avoidance \
137 distributed_arp_table \
138 elp_interval \
139 fragmentation \
140 gw_mode \
141 hop_penalty \
142 interface \
143 isolation_mark \
144 loglevel \
145 multicast_fanout \
146 multicast_forceflood \
147 multicast_mode \
148 network_coding \
149 orig_interval \
150 routing_algo \
151 throughput_override \
152
153 config-tables := \
154 backbonetable \
155 claimtable \
156 dat_cache \
157 gateways \
158 mcast_flags \
159 neighbors \
160 originators \
161 statistics \
162 transglobal \
163 translocal \
164
165 config-json := \
166 bla_backbone_json \
167 bla_claim_json \
168 dat_cache_json \
169 gateways_json \
170 hardif_json \
171 hardifs_json \
172 mcast_flags_json \
173 mesh_json \
174 neighbors_json \
175 originators_json \
176 transtable_global_json \
177 transtable_local_json \
178 vlan_json \
179
180 config-tools := \
181 event \
182 ping \
183 tcpdump \
184 throughputmeter \
185 traceroute \
186 translate \
187
188 config-extratools := \
189 bisect_iv \
190
191 ifeq ($(BUILD_VARIANT),tiny)
192
193 config-y := \
194 $(config-settings) \
195
196 endif
197
198 ifeq ($(BUILD_VARIANT),default)
199
200 config-y := \
201 $(config-settings) \
202 $(config-tables) \
203 $(config-json) \
204 $(config-tools) \
205
206 endif
207
208 ifeq ($(BUILD_VARIANT),full)
209
210 config-y := \
211 $(config-settings) \
212 $(config-tables) \
213 $(config-json) \
214 $(config-tools) \
215 $(config-extratools) \
216
217 endif
218
219 define ConfigVars
220 $(subst $(space),,$(foreach opt,$(config-$(1)),CONFIG_$(opt)=$(1)
221 ))
222 endef
223
224 define batctl_config
225 $(call ConfigVars,n)$(call ConfigVars,y)
226 endef
227 $(eval $(call shexport,batctl_config))
228
229 MAKE_FLAGS += $$$$$(call shvar,batctl_config)
230
231 define Package/batctl-tiny/install
232 $(INSTALL_DIR) $(1)/usr/libexec
233 $(INSTALL_BIN) $(PKG_BUILD_DIR)/batctl $(1)/usr/libexec/batctl-tiny
234 endef
235
236 define Package/batctl-default/install
237 $(INSTALL_DIR) $(1)/usr/libexec
238 $(INSTALL_BIN) $(PKG_BUILD_DIR)/batctl $(1)/usr/libexec/batctl-default
239 endef
240
241 define Package/batctl-full/install
242 $(INSTALL_DIR) $(1)/usr/libexec
243 $(INSTALL_BIN) $(PKG_BUILD_DIR)/batctl $(1)/usr/libexec/batctl-full
244 endef
245
246 $(eval $(call BuildPackage,batctl-default))
247 $(eval $(call BuildPackage,batctl-tiny))
248 $(eval $(call BuildPackage,batctl-full))