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.

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