batctl: upgrade package to latest release 2019.4
[feed/routing.git] / batctl / Makefile
1 #
2 # Copyright (C) 2014 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
10 PKG_NAME:=batctl
11
12 PKG_VERSION:=2019.4
13 PKG_RELEASE:=0
14 PKG_HASH:=a3564eb9727335352dc0cfa2f2b29474c2c837384689ac5fcb387784a56e7685
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
18 PKG_LICENSE:=GPL-2.0-only ISC MIT
19 PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT LICENSES/deprecated/ISC
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/batctl/Default
26 URL:=https://www.open-mesh.org/
27 SECTION:=net
28 CATEGORY:=Network
29 DEPENDS:=+libnl-tiny +libc +librt
30 PROVIDES:=batctl
31 MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de>
32 endef
33
34 define Package/batctl/description
35 batctl is a more intuitive managment utility for B.A.T.M.A.N.-Advanced.
36 It is an easier method for configuring batman-adv and provides some
37 additional tools for debugging as well. This package builds
38 version $(PKG_VERSION) of the user space utility.
39 endef
40
41 define Package/batctl-tiny
42 $(call Package/batctl/Default)
43 TITLE:=B.A.T.M.A.N. Advanced user space configuration tool (Minimal)
44 VARIANT:=tiny
45 PROVIDES:=batctl
46 ALTERNATIVES:=100:/usr/sbin/batctl:/usr/libexec/batctl-tiny
47 endef
48
49 define Package/batctl-tiny/description
50 $(Package/batctl/description)
51 Only configuration relevant subcommands are enabled.
52 endef
53
54 define Package/batctl-default
55 $(call Package/batctl/Default)
56 TITLE:=B.A.T.M.A.N. Advanced user space configuration tool (Default)
57 VARIANT:=default
58 ALTERNATIVES:=200:/usr/sbin/batctl:/usr/libexec/batctl-default
59 endef
60
61 define Package/batctl-default/description
62 $(Package/batctl/description)
63 Standard subcommands for configuration and online debugging are enabled.
64 endef
65
66 define Package/batctl-full
67 $(call Package/batctl/Default)
68 TITLE:=B.A.T.M.A.N. Advanced user space configuration tool (Full)
69 VARIANT:=full
70 ALTERNATIVES:=300:/usr/sbin/batctl:/usr/libexec/batctl-full
71 endef
72
73 define Package/batctl-full/description
74 $(Package/batctl/description)
75 Subcommands for configuration, online and offline debugging are enabled.
76 endef
77
78 # The linker can identify unused sections of a binary when each symbol is stored
79 # in a separate section. This mostly removes unused linker sections and reduces
80 # the size by ~3% on mipsel.
81
82 TARGET_CFLAGS += -ffunction-sections -fdata-sections
83 TARGET_LDFLAGS += -Wl,--gc-sections
84
85 # Link-time optimization allows to move parts of the optimization from the single
86 # source file to the global source view. This is done by emitting the GIMPLE
87 # representation in each object file and analyzing it again during the link step.
88
89 TARGET_CFLAGS += -flto
90 TARGET_LDFLAGS += -fuse-linker-plugin
91
92 MAKE_VARS += \
93 LIBNL_NAME="libnl-tiny" \
94 LIBNL_GENL_NAME="libnl-tiny"
95
96 MAKE_FLAGS += \
97 REVISION="openwrt-$(PKG_VERSION)-$(PKG_RELEASE)"
98
99 config-n := \
100 aggregation \
101 ap_isolation \
102 backbonetable \
103 bisect_iv \
104 bonding \
105 bridge_loop_avoidance \
106 claimtable \
107 dat_cache \
108 distributed_arp_table \
109 elp_interval \
110 event \
111 fragmentation \
112 gateways \
113 gw_mode \
114 hop_penalty \
115 interface \
116 isolation_mark \
117 loglevel \
118 mcast_flags \
119 multicast_fanout \
120 multicast_forceflood \
121 multicast_mode \
122 nc_nodes \
123 neighbors \
124 network_coding \
125 orig_interval \
126 originators \
127 ping \
128 routing_algo \
129 statistics \
130 tcpdump \
131 throughput_override \
132 throughputmeter \
133 traceroute \
134 transglobal \
135 translate \
136 translocal \
137
138 config-settings := \
139 aggregation \
140 ap_isolation \
141 bonding \
142 bridge_loop_avoidance \
143 distributed_arp_table \
144 elp_interval \
145 fragmentation \
146 gw_mode \
147 hop_penalty \
148 interface \
149 isolation_mark \
150 loglevel \
151 multicast_fanout \
152 multicast_forceflood \
153 multicast_mode \
154 network_coding \
155 orig_interval \
156 routing_algo \
157 throughput_override \
158
159 config-tables := \
160 backbonetable \
161 claimtable \
162 dat_cache \
163 gateways \
164 loglevel \
165 nc_nodes \
166 neighbors \
167 originators \
168 statistics \
169 transglobal \
170 translocal \
171
172 config-tools := \
173 event \
174 ping \
175 tcpdump \
176 throughputmeter \
177 traceroute \
178 translate \
179
180 config-extratools := \
181 bisect_iv \
182
183 ifeq ($(BUILD_VARIANT),tiny)
184
185 config-y := \
186 $(config-settings) \
187
188 endif
189
190 ifeq ($(BUILD_VARIANT),default)
191
192 config-y := \
193 $(config-settings) \
194 $(config-tables) \
195 $(config-tools) \
196
197 endif
198
199 ifeq ($(BUILD_VARIANT),full)
200
201 config-y := \
202 $(config-settings) \
203 $(config-tables) \
204 $(config-tools) \
205 $(config-extratools) \
206
207 endif
208
209 define ConfigVars
210 $(subst $(space),,$(foreach opt,$(config-$(1)),CONFIG_$(opt)=$(1)
211 ))
212 endef
213
214 define batctl_config
215 $(call ConfigVars,n)$(call ConfigVars,y)
216 endef
217 $(eval $(call shexport,batctl_config))
218
219 MAKE_FLAGS += $$$$$(call shvar,batctl_config)
220
221 define Package/batctl-tiny/install
222 $(INSTALL_DIR) $(1)/usr/libexec
223 $(INSTALL_BIN) $(PKG_BUILD_DIR)/batctl $(1)/usr/libexec/batctl-tiny
224 endef
225
226 define Package/batctl-default/install
227 $(INSTALL_DIR) $(1)/usr/libexec
228 $(INSTALL_BIN) $(PKG_BUILD_DIR)/batctl $(1)/usr/libexec/batctl-default
229 endef
230
231 define Package/batctl-full/install
232 $(INSTALL_DIR) $(1)/usr/libexec
233 $(INSTALL_BIN) $(PKG_BUILD_DIR)/batctl $(1)/usr/libexec/batctl-full
234 endef
235
236 $(eval $(call BuildPackage,batctl-default))
237 $(eval $(call BuildPackage,batctl-tiny))
238 $(eval $(call BuildPackage,batctl-full))