Makefile 5.2 KB

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