2 # Copyright (C) 2019 Lucian Cristian <lucian.cristian@gmail.com>
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
12 PKG_SOURCE_DATE
:=2023-08-12
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_SOURCE_DATE
).
tar.gz
15 PKG_SOURCE_VERSION
:=9852228d1e87bdbad13e0fed8313203f00bf26af
16 PKG_SOURCE_URL
:=https
://codeload.github.com
/FRRouting
/frr
/tar.gz
/$(PKG_SOURCE_VERSION
)?
18 PKG_HASH
:=6e611cd86ae9787a4b8d71411fdc38ad1fe843a839756c9c386848ffde81f6cf
19 PKG_MAINTAINER
:=Lucian Cristian
<lucian.cristian@gmail.com
>
21 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_SOURCE_VERSION
)
22 HOST_BUILD_DIR
:=$(BUILD_DIR_HOST
)/$(PKG_NAME
)-$(PKG_SOURCE_VERSION
)
24 PKG_LICENSE
:=GPL-2.0
-only LGPL-2.1
-only
26 PKG_DAEMON_AVAILABLE
:= \
45 PKG_CONFIG_DEPENDS
:= \
51 CONFIG_PACKAGE_frr-libfrr \
52 CONFIG_PACKAGE_frr-vtysh \
53 CONFIG_PACKAGE_frr-watchfrr \
54 CONFIG_PACKAGE_frr-zebra \
55 $(patsubst %,CONFIG_PACKAGE_frr-
%,$(PKG_DAEMON_AVAILABLE
)) \
62 PKG_BUILD_DEPENDS
:=frr
/host protobuf-c
/host
63 HOST_BUILD_DEPENDS
:=python3
/host
65 include $(INCLUDE_DIR
)/package.mk
66 include $(INCLUDE_DIR
)/host-build.mk
68 define Package
/frr-libfrr
/config
69 source
"$(SOURCE)/Config.in"
72 define Package
/frr
/Default
75 SUBMENU
:=Routing and Redirection
76 URL
:=https
://www.frrouting.org
/
81 $(call Package
/frr
/Default
)
83 TITLE
:=The FRRouting
(FRR
) Software Routing Suite
87 define Package
/frr
/description
88 FRRouting is free software that implements and manages various IPv4 and IPv6
91 Currently FRRouting supports BGP4
, BGP4
+, OSPFv2
, OSPFv3
, RIPv1
, RIPv2
, RIPng
,
92 IS-IS
, PIM-SM
/MSDP
, LDP
, VRRP and Babel
as well
as very early support for EIGRP and
96 define Package
/frr-libfrr
97 $(call Package
/frr
/Default
)
99 DEPENDS
+=+librt
+libatomic
+libcap
+libjson-c
+libyang
+libprotobuf-c
+FRR_OPENSSL
:libopenssl
+FRR_SNMP
:libnetsnmp
100 CONFLICTS
:=quagga-libzebra
103 define Package
/frr-vtysh
104 $(call Package
/frr
/Default
)
105 DEPENDS
+=+frr-libfrr
+libreadline
+libncurses
+more
106 TITLE
:=integrated
shell for frr routing software
107 CONFLICTS
:=quagga-vtysh
110 define Package
/frr-watchfrr
111 $(call Package
/frr
/Default
)
114 DEFAULT
:=y if PACKAGE_frr
117 define Package
/frr-zebra
118 $(call Package
/frr
/Default
)
121 DEFAULT
:=y if PACKAGE_frr
122 CONFLICTS
:=quagga-zebra
125 define Package
/frr-pythontools
126 $(call Package
/frr
/Default
)
127 TITLE
:=Python reload tool
128 DEPENDS
+=+frr-libfrr
+python3-base
+python3-light
+python3-logging
131 ##Migrate from quagga
132 ##should test file exists and link in frr folder
133 #define Package/frr/postinst
135 #if [ -f /etc/quagga/ospfd.conf ]; then
137 # sed enable ospfd daemon
143 define Package
/frr-
$(1)
144 $$(call Package
/frr
/Default
)
145 TITLE
:= $(1) routing engine
146 DEPENDS
+=frr-libfrr
$(2)
148 # if [ "$(1)" == "bfdd" ]; then \
149 # export HAVE_BFDD == 1 ; fi
151 define Package
/frr-
$(1)/install
152 $(INSTALL_DIR
) $$(1)/usr
/sbin
153 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/$(1) $$(1)/usr
/sbin
/; \
154 if
[ "$(1)" == "nhrpd" ]; then \
155 $(INSTALL_DIR
) $$(1)/usr
/lib
; \
156 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libfrrcares.so
* $$(1)/usr
/lib
/; fi
159 $$(eval
$$(call BuildPackage
,frr-
$(1)))
162 define Package
/frr-libfrr
/conffiles
168 TARGET_LDFLAGS
+= -Wl
,--gc-sections
,--as-needed
-latomic
170 define Host
/Configure
171 $(Host
/Configure
/Default
)
172 $(SED
) 's/$$$$(MAKE) $$$$(AM_MAKEFLAGS) install-am/# $$$$(MAKE) $$$$(AM_MAKEFLAGS) install-am/' $(HOST_BUILD_DIR
)/Makefile.in
175 HOST_CPPFLAGS
+= -I
$(STAGING_DIR_HOST
)/include/libelf
176 HOST_CONFIGURE_ARGS
+= \
180 $(INSTALL_DIR
) $(STAGING_DIR_HOSTPKG
)/bin
181 $(INSTALL_BIN
) $(HOST_BUILD_DIR
)/lib
/clippy
$(STAGING_DIR_HOSTPKG
)/bin
/
185 --with-clippy
=$(STAGING_DIR_HOSTPKG
)/bin
/clippy \
189 --enable-user
=network \
190 --enable-group
=network \
191 --disable-ospfclient \
193 --disable-backtrace \
194 --localstatedir
=/var
/run
/frr \
195 --sysconfdir
=/etc
/frr
/ \
196 $(if
$(CONFIG_FRR_OPENSSL
),--with-crypto
=openssl
,) \
197 $(if
$(CONFIG_FRR_SNMP
),--enable-snmp
,) \
198 $(foreach m
,$(PKG_DAEMON_AVAILABLE
), \
199 $(call autoconf_bool
,CONFIG_PACKAGE_frr-
$(m
),$(m
)) ) \
200 $(call autoconf_bool
,CONFIG_PACKAGE_frr-vtysh
,vtysh
) \
201 $(call autoconf_bool
,CONFIG_PACKAGE_frr-libfrr
,zebra
)
204 define Package
/frr
/install
205 $(INSTALL_DIR
) $(1)/usr
/sbin
$(1)/etc
/init.d
206 $(INSTALL_BIN
) .
/files
/frrcommon.sh
$(1)/usr
/sbin
/
207 $(INSTALL_BIN
) .
/files
/frr
$(1)/etc
/init.d
/
210 define Package
/frr-watchfrr
/install
211 $(INSTALL_DIR
) $(1)/usr
/sbin
212 $(INSTALL_BIN
) .
/files
/watchfrr.sh
$(1)/usr
/sbin
/
213 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/watchfrr
$(1)/usr
/sbin
/
216 define Package
/frr-zebra
/install
217 $(INSTALL_DIR
) $(1)/usr
/sbin
218 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/zebra
$(1)/usr
/sbin
/
221 define Package
/frr-libfrr
/install
222 $(INSTALL_DIR
) $(1)/usr
/lib
$(1)/etc
/frr
223 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libfrr.so
* $(1)/usr
/lib
/
224 $(if
$(CONFIG_FRR_SNMP
),$(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libfrrsnmp.so
* $(1)/usr
/lib
/,)
225 $(INSTALL_CONF
) .
/files
/{frr.conf
,daemons
} $(1)/etc
/frr
/
229 define Package
/frr-pythontools
/install
230 $(INSTALL_DIR
) $(1)/usr
/lib
/frr
$(1)/usr
/sbin
$(1)/etc
/frr
231 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/*.py
$(1)/usr
/lib
/frr
/
232 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/frr-reload
$(1)/usr
/sbin
/
233 $(INSTALL_CONF
) $(PKG_BUILD_DIR
)/tools
/etc
/frr
/support_bundle_commands.conf
$(1)/etc
/frr
/
236 define Package
/frr-vtysh
/install
237 $(INSTALL_DIR
) $(1)/usr
/bin
$(1)/etc
/frr
238 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/vtysh
$(1)/usr
/bin
/
239 $(INSTALL_CONF
) .
/files
/vtysh.conf
$(1)/etc
/frr
/
242 $(eval
$(call HostBuild
))
243 $(eval
$(call BuildPackage
,frr
))
244 $(eval
$(call BuildPackage
,frr-libfrr
))
245 $(eval
$(call BuildPackage
,frr-pythontools
))
246 $(eval
$(call BuildPackage
,frr-watchfrr
))
247 $(eval
$(call BuildPackage
,frr-zebra
))
248 $(eval
$(call BuildPackage
,frr-vtysh
))
249 $(eval
$(call BuildDaemon
,babeld
,))
250 $(eval
$(call BuildDaemon
,bfdd
,))
251 $(eval
$(call BuildDaemon
,bgpd
,))
252 $(eval
$(call BuildDaemon
,eigrpd
,))
253 $(eval
$(call BuildDaemon
,fabricd
,))
254 $(eval
$(call BuildDaemon
,isisd
,))
255 $(eval
$(call BuildDaemon
,ldpd
,))
256 $(eval
$(call BuildDaemon
,nhrpd
,+libcares
))
257 $(eval
$(call BuildDaemon
,ospfd
,))
258 $(eval
$(call BuildDaemon
,ospf6d
,@IPV6
))
259 $(eval
$(call BuildDaemon
,pathd
,))
260 $(eval
$(call BuildDaemon
,pbrd
,))
261 $(eval
$(call BuildDaemon
,pimd
,))
262 $(eval
$(call BuildDaemon
,ripd
,))
263 $(eval
$(call BuildDaemon
,ripngd
,@IPV6
))
264 $(eval
$(call BuildDaemon
,staticd
,))
265 $(eval
$(call BuildDaemon
,vrrpd
,))