You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

394 lines
10 KiB

  1. #
  2. # Copyright (C) 2019 Lucian Cristian <lucian.cristian@gmail.com>
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=frr
  9. PKG_VERSION:=7.1
  10. PKG_RELEASE:=2
  11. PKG_SOURCE_URL:=https://github.com/FRRouting/frr/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_HASH:=2a4210565e7b41d366f7b9f5f745917d67a0b159f3b6bd49d75f9e730557db2f
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  15. PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
  16. PKG_CONFIG_DEPENDS:= \
  17. CONFIG_IPV6 \
  18. CONFIG_PACKAGE_frr-babeld \
  19. CONFIG_PACKAGE_frr-bfdd \
  20. CONFIG_PACKAGE_frr-bgpd \
  21. CONFIG_PACKAGE_frr-eigrpd \
  22. CONFIG_PACKAGE_frr-fabricd \
  23. CONFIG_PACKAGE_frr-isisd \
  24. CONFIG_PACKAGE_frr-ldpd \
  25. CONFIG_PACKAGE_frr-libfrr \
  26. CONFIG_PACKAGE_frr-nhrpd \
  27. CONFIG_PACKAGE_frr-ospfd \
  28. CONFIG_PACKAGE_frr-ospf6d \
  29. CONFIG_PACKAGE_frr-pbrd \
  30. CONFIG_PACKAGE_frr-pimd \
  31. CONFIG_PACKAGE_frr-ripd \
  32. CONFIG_PACKAGE_frr-ripngd \
  33. CONFIG_PACKAGE_frr-staticd \
  34. CONFIG_PACKAGE_frr-vtysh \
  35. CONFIG_PACKAGE_frr-watchfrr \
  36. CONFIG_PACKAGE_frr-zebra
  37. PKG_BUILD_PARALLEL:=1
  38. PKG_BUILD_DEPENDS:=python3/host
  39. PKG_FIXUP:=autoreconf
  40. PKG_LICENSE:=GPL-2.0
  41. include $(INCLUDE_DIR)/package.mk
  42. include $(INCLUDE_DIR)/host-build.mk
  43. define Package/frr/Default
  44. SECTION:=net
  45. CATEGORY:=Network
  46. SUBMENU:=Routing and Redirection
  47. DEPENDS:=frr
  48. TITLE:=The FRRouting (FRR) Software Routing Suite
  49. URL:=https://www.frrouting.org/
  50. endef
  51. define Package/frr
  52. $(call Package/frr/Default)
  53. DEPENDS:=+librt
  54. MENU:=1
  55. endef
  56. define Package/frr/description
  57. FRRouting is free software that implements and manages various IPv4 and IPv6
  58. routing protocols.
  59. Currently FRRouting supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, RIPng,
  60. IS-IS, PIM-SM/MSDP, LDP and Babel as well as very early support for EIGRP and
  61. NHRP.
  62. endef
  63. define Package/frr-babeld
  64. $(call Package/frr/Default)
  65. DEPENDS+=+frr-libfrr
  66. TITLE:=BABEL routing engine
  67. endef
  68. define Package/frr-bfdd
  69. $(call Package/frr/Default)
  70. DEPENDS+=+frr-libfrr
  71. TITLE:=BFD routing engine
  72. CONFLICTS:=bfdd
  73. endef
  74. define Package/frr-bgpd
  75. $(call Package/frr/Default)
  76. DEPENDS+=+frr-libfrr
  77. TITLE:=BGPv4, BGPv4+, BGPv4- routing engine
  78. CONFLICTS:=quagga-bgpd
  79. endef
  80. define Package/frr-eigrpd
  81. $(call Package/frr/Default)
  82. DEPENDS+=+frr-libfrr
  83. TITLE:=EIGRPD routing engine
  84. endef
  85. define Package/frr-fabricd
  86. $(call Package/frr/Default)
  87. DEPENDS+=+frr-libfrr
  88. TITLE:=OpenFabric routing engine
  89. endef
  90. define Package/frr-isisd
  91. $(call Package/frr/Default)
  92. DEPENDS+=+frr-libfrr
  93. TITLE:=IS-IS routing engine
  94. CONFLICTS:=quagga-isisd
  95. endef
  96. define Package/frr-ldpd
  97. $(call Package/frr/Default)
  98. DEPENDS+=+frr-libfrr
  99. TITLE:=LDP routing engine
  100. endef
  101. define Package/frr-libfrr
  102. $(call Package/frr/Default)
  103. TITLE:=zebra library
  104. DEPENDS+=+libjson-c +libyang
  105. CONFLICTS:=quagga-libzebra
  106. endef
  107. define Package/frr-nhrpd
  108. $(call Package/frr/Default)
  109. DEPENDS+=+frr-libfrr +libcares
  110. TITLE:=NHRP routing engine
  111. endef
  112. define Package/frr-ospfd
  113. $(call Package/frr/Default)
  114. DEPENDS+=+frr-libfrr
  115. TITLE:=OSPFv2 routing engine
  116. CONFLICTS:=quagga-ospfd
  117. endef
  118. define Package/frr-ospf6d
  119. $(call Package/frr/Default)
  120. DEPENDS+=+frr-libfrr @IPV6
  121. TITLE:=OSPFv3 routing engine
  122. CONFLICTS:=quagga-ospf6d
  123. endef
  124. define Package/frr-pbrd
  125. $(call Package/frr/Default)
  126. DEPENDS+=+frr-libfrr
  127. TITLE:=PBRD routing daemon
  128. endef
  129. define Package/frr-pimd
  130. $(call Package/frr/Default)
  131. DEPENDS+=+frr-libfrr
  132. TITLE:=PIM routing engine
  133. endef
  134. define Package/frr-ripd
  135. $(call Package/frr/Default)
  136. DEPENDS+=+frr-libfrr
  137. TITLE:=RIP routing engine
  138. CONFLICTS:=quagga-ripd
  139. endef
  140. define Package/frr-ripngd
  141. $(call Package/frr/Default)
  142. DEPENDS+=+frr-libfrr @IPV6
  143. TITLE:=RIPNG routing engine
  144. CONFLICTS:=quagga-ripngd
  145. endef
  146. define Package/frr-staticd
  147. $(call Package/frr/Default)
  148. DEPENDS+=+frr-libfrr
  149. TITLE:=STATICD routing engine
  150. endef
  151. define Package/frr-vtysh
  152. $(call Package/frr/Default)
  153. DEPENDS+=+frr-libfrr +libreadline +libncurses
  154. TITLE:=integrated shell for frr routing software
  155. CONFLICTS:=quagga-vtysh
  156. endef
  157. define Package/frr-watchfrr
  158. $(call Package/frr/Default)
  159. TITLE:=frr watchdog
  160. DEPENDS+=+frr-libfrr
  161. DEFAULT:=y if PACKAGE_frr
  162. endef
  163. define Package/frr-zebra
  164. $(call Package/frr/Default)
  165. TITLE:=Zebra daemon
  166. DEPENDS+=+frr-libfrr
  167. DEFAULT:=y if PACKAGE_frr
  168. CONFLICTS:=quagga-zebra
  169. endef
  170. define Package/frr-libfrr/conffiles
  171. /etc/frr/
  172. endef
  173. define Build/Prepare
  174. $(Build/Prepare/Default)
  175. mkdir -p $(PKG_BUILD_DIR)/build/lib
  176. $(CP) $(PKG_BUILD_DIR)/lib/command.h $(PKG_BUILD_DIR)/build/lib/
  177. endef
  178. define Build/Configure
  179. ( cd $(PKG_BUILD_DIR)/build/ ; \
  180. cd build ; \
  181. ../configure \
  182. --host="$(GNU_TARGET_NAME)" \
  183. --build="$(GNU_HOST_NAME)" \
  184. CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
  185. CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
  186. LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
  187. HOST_CFLAGS="$(HOST_CFLAGS)" \
  188. HOST_LDFLAGS="$(HOST_LDFLAGS)" \
  189. BUILD_CPPFLAGS="$(TARGET_CPPLAGS)" \
  190. BUILD_CFLAGS="$(TARGET_CFLAGS)" \
  191. BUILD_LDFLAGS="$(TARGET_LDFLAGS)" \
  192. --prefix=/usr \
  193. --enable-shared \
  194. --disable-static \
  195. --enable-user=network \
  196. --enable-group=network \
  197. --enable-multipath=16 \
  198. --disable-capabilities \
  199. --disable-ospfclient \
  200. --disable-doc \
  201. --disable-backtrace \
  202. --with-vtysh-pager=cat \
  203. --localstatedir=/var/run/frr \
  204. --sysconfdir=/etc/frr/ \
  205. $(call autoconf_bool,CONFIG_PACKAGE_frr-babeld,babeld) \
  206. $(call autoconf_bool,CONFIG_PACKAGE_frr-bfdd,bfdd) \
  207. $(call autoconf_bool,CONFIG_PACKAGE_frr-bgpd,bgpd) \
  208. $(call autoconf_bool,CONFIG_PACKAGE_frr-eigrpd,eigrpd) \
  209. $(call autoconf_bool,CONFIG_PACKAGE_frr-fabricd,fabricd) \
  210. $(call autoconf_bool,CONFIG_PACKAGE_frr-isisd,isisd) \
  211. $(call autoconf_bool,CONFIG_PACKAGE_frr-ldpd,ldpd) \
  212. $(call autoconf_bool,CONFIG_PACKAGE_frr-nhrpd,nhrpd) \
  213. $(call autoconf_bool,CONFIG_PACKAGE_frr-ospfd,ospfd) \
  214. $(call autoconf_bool,CONFIG_PACKAGE_frr-ospf6d,ospf6d) \
  215. $(call autoconf_bool,CONFIG_PACKAGE_frr-pbrd,pbrd) \
  216. $(call autoconf_bool,CONFIG_PACKAGE_frr-pimd,pimd) \
  217. $(call autoconf_bool,CONFIG_PACKAGE_frr-staticd,staticd) \
  218. $(call autoconf_bool,CONFIG_PACKAGE_frr-ripd,ripd) \
  219. $(call autoconf_bool,CONFIG_PACKAGE_frr-ripngd,ripngd) \
  220. $(call autoconf_bool,CONFIG_PACKAGE_frr-vtysh,vtysh) \
  221. $(call autoconf_bool,CONFIG_PACKAGE_frr-libfrr,zebra) \
  222. )
  223. endef
  224. # just speed it up
  225. NUM_CORES ?= $(shell grep -c "vendor_id" /proc/cpuinfo)
  226. define Build/Compile
  227. $(MAKE) -C $(PKG_BUILD_DIR)/build -j$(NUM_CORES)
  228. endef
  229. define Package/frr/install
  230. $(INSTALL_DIR) $(1)/usr/sbin
  231. $(INSTALL_BIN) ./files/frrcommon.sh $(1)/usr/sbin/
  232. $(INSTALL_DIR) $(1)/etc/init.d
  233. $(INSTALL_BIN) ./files/frr $(1)/etc/init.d/
  234. endef
  235. define Package/frr-watchfrr/install
  236. $(INSTALL_DIR) $(1)/usr/sbin
  237. $(INSTALL_BIN) ./files/watchfrr.sh $(1)/usr/sbin/
  238. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/watchfrr/.libs/watchfrr $(1)/usr/sbin/
  239. endef
  240. define Package/frr-zebra/install
  241. $(INSTALL_DIR) $(1)/usr/sbin
  242. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/zebra/.libs/zebra $(1)/usr/sbin/
  243. endef
  244. define Package/frr-babeld/install
  245. $(INSTALL_DIR) $(1)/usr/sbin
  246. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/babeld/.libs/babeld $(1)/usr/sbin/
  247. endef
  248. define Package/frr-bfdd/install
  249. $(INSTALL_DIR) $(1)/usr/sbin
  250. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/bfdd/.libs/bfdd $(1)/usr/sbin/
  251. endef
  252. define Package/frr-bgpd/install
  253. $(INSTALL_DIR) $(1)/usr/sbin
  254. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/bgpd/.libs/bgpd $(1)/usr/sbin/
  255. endef
  256. define Package/frr-eigrpd/install
  257. $(INSTALL_DIR) $(1)/usr/sbin
  258. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/eigrpd/.libs/eigrpd $(1)/usr/sbin/
  259. endef
  260. define Package/frr-fabricd/install
  261. $(INSTALL_DIR) $(1)/usr/sbin
  262. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/isisd/.libs/fabricd $(1)/usr/sbin/
  263. endef
  264. define Package/frr-isisd/install
  265. $(INSTALL_DIR) $(1)/usr/sbin
  266. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/isisd/.libs/isisd $(1)/usr/sbin/
  267. endef
  268. define Package/frr-ldpd/install
  269. $(INSTALL_DIR) $(1)/usr/sbin
  270. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/ldpd/.libs/ldpd $(1)/usr/sbin/
  271. endef
  272. define Package/frr-nhrpd/install
  273. $(INSTALL_DIR) $(1)/usr/sbin
  274. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/nhrpd/.libs/nhrpd $(1)/usr/sbin/
  275. endef
  276. define Package/frr-ospfd/install
  277. $(INSTALL_DIR) $(1)/usr/sbin
  278. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/ospfd/.libs/ospfd $(1)/usr/sbin/
  279. endef
  280. define Package/frr-ospf6d/install
  281. $(INSTALL_DIR) $(1)/usr/sbin
  282. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/ospf6d/.libs/ospf6d $(1)/usr/sbin/
  283. endef
  284. define Package/frr-pbrd/install
  285. $(INSTALL_DIR) $(1)/usr/sbin
  286. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/pbrd/.libs/pbrd $(1)/usr/sbin/
  287. endef
  288. define Package/frr-pimd/install
  289. $(INSTALL_DIR) $(1)/usr/sbin
  290. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/pimd/.libs/pimd $(1)/usr/sbin/
  291. endef
  292. define Package/frr-ripd/install
  293. $(INSTALL_DIR) $(1)/usr/sbin
  294. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/ripd/.libs/ripd $(1)/usr/sbin/
  295. endef
  296. define Package/frr-ripngd/install
  297. $(INSTALL_DIR) $(1)/usr/sbin
  298. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/ripngd/.libs/ripngd $(1)/usr/sbin/
  299. endef
  300. define Package/frr-staticd/install
  301. $(INSTALL_DIR) $(1)/usr/sbin
  302. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/staticd/.libs/staticd $(1)/usr/sbin/
  303. endef
  304. define Package/frr-vrrpd/install
  305. $(INSTALL_DIR) $(1)/usr/sbin
  306. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/vrrpd/.libs/vrrpd $(1)/usr/sbin/
  307. endef
  308. define Package/frr-vtysh/install
  309. $(INSTALL_DIR) $(1)/usr/bin
  310. $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/vtysh/.libs/vtysh $(1)/usr/bin/
  311. endef
  312. define Package/frr-libfrr/install
  313. $(INSTALL_DIR) $(1)/usr/lib
  314. $(CP) $(PKG_BUILD_DIR)/build/lib/.libs/libfrr.so* $(1)/usr/lib/
  315. $(INSTALL_DIR) $(1)/etc/frr
  316. chmod 0750 $(1)/etc/frr
  317. $(INSTALL_CONF) ./files/{frr.conf,daemons} $(1)/etc/frr/
  318. endef
  319. $(eval $(call HostBuild))
  320. $(eval $(call BuildPackage,frr))
  321. $(eval $(call BuildPackage,frr-babeld))
  322. $(eval $(call BuildPackage,frr-bfdd))
  323. $(eval $(call BuildPackage,frr-bgpd))
  324. $(eval $(call BuildPackage,frr-eigrpd))
  325. $(eval $(call BuildPackage,frr-fabricd))
  326. $(eval $(call BuildPackage,frr-isisd))
  327. $(eval $(call BuildPackage,frr-ldpd))
  328. $(eval $(call BuildPackage,frr-libfrr))
  329. $(eval $(call BuildPackage,frr-nhrpd))
  330. $(eval $(call BuildPackage,frr-ospfd))
  331. $(eval $(call BuildPackage,frr-ospf6d))
  332. $(eval $(call BuildPackage,frr-pbrd))
  333. $(eval $(call BuildPackage,frr-pimd))
  334. $(eval $(call BuildPackage,frr-ripd))
  335. $(eval $(call BuildPackage,frr-ripngd))
  336. $(eval $(call BuildPackage,frr-staticd))
  337. $(eval $(call BuildPackage,frr-vtysh))
  338. $(eval $(call BuildPackage,frr-watchfrr))
  339. $(eval $(call BuildPackage,frr-zebra))