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.

266 lines
7.0 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:=8.2.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_DATE:=2022-03-05
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz
  13. PKG_SOURCE_VERSION:=47a5de9c038c17038cef61786fd1216d33ee0f66
  14. PKG_SOURCE_URL:=https://codeload.github.com/FRRouting/frr/tar.gz/$(PKG_SOURCE_VERSION)?
  15. PKG_HASH:=6007ae2fdb2e068696f92dd000f247ef2a27d846863b0b1552752e41ed5f4017
  16. PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
  18. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
  19. PKG_LICENSE:=GPL-2.0-only LGPL-2.1-only
  20. PKG_DAEMON_AVAILABLE:= \
  21. babeld \
  22. bfdd \
  23. bgpd \
  24. eigrpd \
  25. fabricd \
  26. isisd \
  27. ldpd \
  28. nhrpd \
  29. ospfd \
  30. ospf6d \
  31. pathd \
  32. pbrd \
  33. pimd \
  34. ripd \
  35. ripngd \
  36. staticd \
  37. vrrpd
  38. PKG_CONFIG_DEPENDS:= \
  39. CONFIG_IPV6 \
  40. CONFIG_FRR_OPENSSL \
  41. CONFIG_FRR_INTERNAL \
  42. CONFIG_FRR_SNMP \
  43. CONFIG_FRR_NO_SNMP \
  44. CONFIG_PACKAGE_frr-libfrr \
  45. CONFIG_PACKAGE_frr-vtysh \
  46. CONFIG_PACKAGE_frr-watchfrr \
  47. CONFIG_PACKAGE_frr-zebra \
  48. $(patsubst %,CONFIG_PACKAGE_frr-%,$(PKG_DAEMON_AVAILABLE)) \
  49. PKG_FIXUP:=autoreconf
  50. PKG_BUILD_PARALLEL:=1
  51. PKG_INSTALL:=1
  52. PKG_BUILD_DEPENDS:=frr/host
  53. HOST_BUILD_DEPENDS:=python3/host elfutils/host
  54. include $(INCLUDE_DIR)/package.mk
  55. include $(INCLUDE_DIR)/host-build.mk
  56. define Package/frr-libfrr/config
  57. source "$(SOURCE)/Config.in"
  58. endef
  59. define Package/frr/Default
  60. SECTION:=net
  61. CATEGORY:=Network
  62. SUBMENU:=Routing and Redirection
  63. URL:=https://www.frrouting.org/
  64. DEPENDS:=frr
  65. endef
  66. define Package/frr
  67. $(call Package/frr/Default)
  68. DEPENDS:=+librt
  69. TITLE:=The FRRouting (FRR) Software Routing Suite
  70. MENU:=1
  71. endef
  72. define Package/frr/description
  73. FRRouting is free software that implements and manages various IPv4 and IPv6
  74. routing protocols.
  75. Currently FRRouting supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, RIPng,
  76. IS-IS, PIM-SM/MSDP, LDP, VRRP and Babel as well as very early support for EIGRP and
  77. NHRP.
  78. endef
  79. define Package/frr-libfrr
  80. $(call Package/frr/Default)
  81. TITLE:=zebra library
  82. DEPENDS+=+librt +libatomic +libcap +libjson-c +libyang +FRR_OPENSSL:libopenssl +FRR_SNMP:libnetsnmp
  83. CONFLICTS:=quagga-libzebra
  84. endef
  85. define Package/frr-vtysh
  86. $(call Package/frr/Default)
  87. DEPENDS+=+frr-libfrr +libreadline +libncurses +more
  88. TITLE:=integrated shell for frr routing software
  89. CONFLICTS:=quagga-vtysh
  90. endef
  91. define Package/frr-watchfrr
  92. $(call Package/frr/Default)
  93. TITLE:=frr watchdog
  94. DEPENDS+=+frr-libfrr
  95. DEFAULT:=y if PACKAGE_frr
  96. endef
  97. define Package/frr-zebra
  98. $(call Package/frr/Default)
  99. TITLE:=Zebra daemon
  100. DEPENDS+=+frr-libfrr
  101. DEFAULT:=y if PACKAGE_frr
  102. CONFLICTS:=quagga-zebra
  103. endef
  104. define Package/frr-pythontools
  105. $(call Package/frr/Default)
  106. TITLE:=Python reload tool
  107. DEPENDS+=+frr-libfrr +python3-base +python3-light +python3-logging
  108. endef
  109. ##Migrate from quagga
  110. ##should test file exists and link in frr folder
  111. #define Package/frr/postinst
  112. ##!/bin/sh
  113. #if [ -f /etc/quagga/ospfd.conf ]; then
  114. # ls to /etc/frr
  115. # sed enable ospfd daemon
  116. #fi
  117. #exit 0
  118. #endef
  119. define BuildDaemon
  120. define Package/frr-$(1)
  121. $$(call Package/frr/Default)
  122. TITLE:= $(1) routing engine
  123. DEPENDS+=frr-libfrr $(2)
  124. endef
  125. # if [ "$(1)" == "bfdd" ]; then \
  126. # export HAVE_BFDD == 1 ; fi
  127. define Package/frr-$(1)/install
  128. $(INSTALL_DIR) $$(1)/usr/sbin
  129. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/$(1) $$(1)/usr/sbin/; \
  130. if [ "$(1)" == "nhrpd" ]; then \
  131. $(INSTALL_DIR) $$(1)/usr/lib; \
  132. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfrrcares.so* $$(1)/usr/lib/; fi
  133. endef
  134. $$(eval $$(call BuildPackage,frr-$(1)))
  135. endef
  136. define Package/frr-libfrr/conffiles
  137. /etc/frr/daemons
  138. /etc/frr/frr.conf
  139. /etc/frr/vtysh.conf
  140. endef
  141. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed -latomic
  142. TARGET_CFLAGS += -flto
  143. define Host/Configure
  144. $(Host/Configure/Default)
  145. $(SED) 's/$$$$(MAKE) $$$$(AM_MAKEFLAGS) install-am/# $$$$(MAKE) $$$$(AM_MAKEFLAGS) install-am/' $(HOST_BUILD_DIR)/Makefile.in
  146. endef
  147. HOST_CPPFLAGS += -I$(STAGING_DIR_HOST)/include/libelf
  148. HOST_CONFIGURE_ARGS+= \
  149. --enable-clippy-only
  150. define Host/Install
  151. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
  152. $(INSTALL_BIN) $(HOST_BUILD_DIR)/lib/clippy $(STAGING_DIR_HOSTPKG)/bin/
  153. endef
  154. CONFIGURE_ARGS+= \
  155. --with-clippy=$(STAGING_DIR_HOSTPKG)/bin/clippy \
  156. --prefix=/usr \
  157. --enable-shared \
  158. --disable-static \
  159. --enable-user=network \
  160. --enable-group=network \
  161. --disable-ospfclient \
  162. --disable-doc \
  163. --disable-backtrace \
  164. --localstatedir=/var/run/frr \
  165. --sysconfdir=/etc/frr/ \
  166. $(if $(CONFIG_FRR_OPENSSL),--with-crypto=openssl,) \
  167. $(if $(CONFIG_FRR_SNMP),--enable-snmp,) \
  168. $(foreach m,$(PKG_DAEMON_AVAILABLE), \
  169. $(call autoconf_bool,CONFIG_PACKAGE_frr-$(m),$(m)) ) \
  170. $(call autoconf_bool,CONFIG_PACKAGE_frr-vtysh,vtysh) \
  171. $(call autoconf_bool,CONFIG_PACKAGE_frr-libfrr,zebra)
  172. define Package/frr/install
  173. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d
  174. $(INSTALL_BIN) ./files/frrcommon.sh $(1)/usr/sbin/
  175. $(INSTALL_BIN) ./files/frr $(1)/etc/init.d/
  176. endef
  177. define Package/frr-watchfrr/install
  178. $(INSTALL_DIR) $(1)/usr/sbin
  179. $(INSTALL_BIN) ./files/watchfrr.sh $(1)/usr/sbin/
  180. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/watchfrr $(1)/usr/sbin/
  181. endef
  182. define Package/frr-zebra/install
  183. $(INSTALL_DIR) $(1)/usr/sbin
  184. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zebra $(1)/usr/sbin/
  185. endef
  186. define Package/frr-libfrr/install
  187. $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/frr
  188. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfrr.so* $(1)/usr/lib/
  189. $(if $(CONFIG_FRR_SNMP),$(CP) $(PKG_INSTALL_DIR)/usr/lib/libfrrsnmp.so* $(1)/usr/lib/,)
  190. $(INSTALL_CONF) ./files/{frr.conf,daemons} $(1)/etc/frr/
  191. endef
  192. define Package/frr-pythontools/install
  193. $(INSTALL_DIR) $(1)/usr/lib/frr $(1)/usr/sbin $(1)/etc/frr
  194. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/*.py $(1)/usr/lib/frr/
  195. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/frr-reload $(1)/usr/sbin/
  196. $(INSTALL_CONF) $(PKG_BUILD_DIR)/tools/etc/frr/support_bundle_commands.conf $(1)/etc/frr/
  197. endef
  198. define Package/frr-vtysh/install
  199. $(INSTALL_DIR) $(1)/usr/bin $(1)/etc/frr
  200. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/
  201. $(INSTALL_CONF) ./files/vtysh.conf $(1)/etc/frr/
  202. endef
  203. $(eval $(call HostBuild))
  204. $(eval $(call BuildPackage,frr))
  205. $(eval $(call BuildPackage,frr-libfrr))
  206. $(eval $(call BuildPackage,frr-pythontools))
  207. $(eval $(call BuildPackage,frr-watchfrr))
  208. $(eval $(call BuildPackage,frr-zebra))
  209. $(eval $(call BuildPackage,frr-vtysh))
  210. $(eval $(call BuildDaemon,babeld,))
  211. $(eval $(call BuildDaemon,bfdd,))
  212. $(eval $(call BuildDaemon,bgpd,))
  213. $(eval $(call BuildDaemon,eigrpd,))
  214. $(eval $(call BuildDaemon,fabricd,))
  215. $(eval $(call BuildDaemon,isisd,))
  216. $(eval $(call BuildDaemon,ldpd,))
  217. $(eval $(call BuildDaemon,nhrpd,+libcares))
  218. $(eval $(call BuildDaemon,ospfd,))
  219. $(eval $(call BuildDaemon,ospf6d,@IPV6))
  220. $(eval $(call BuildDaemon,pathd,))
  221. $(eval $(call BuildDaemon,pbrd,))
  222. $(eval $(call BuildDaemon,pimd,))
  223. $(eval $(call BuildDaemon,ripd,))
  224. $(eval $(call BuildDaemon,ripngd,@IPV6))
  225. $(eval $(call BuildDaemon,staticd,))
  226. $(eval $(call BuildDaemon,vrrpd,))