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.

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