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
13 PKG_SOURCE_URL
:=https
://github.com
/FRRouting
/frr
/releases
/download
/$(PKG_NAME
)-$(PKG_VERSION
)/
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.xz
15 PKG_HASH
:=529e1bbc3a20d55e94c38a95513bcf971d4b403ecb00afdaf0c229e3f560b2b6
16 PKG_MAINTAINER
:=Lucian Cristian
<lucian.cristian@gmail.com
>
18 PKG_DAEMON_AVAILABLE
:= \
37 PKG_CONFIG_DEPENDS
:= \
41 CONFIG_PACKAGE_frr-libfrr \
42 CONFIG_PACKAGE_frr-vtysh \
43 CONFIG_PACKAGE_frr-watchfrr \
44 CONFIG_PACKAGE_frr-zebra \
45 $(patsubst %,CONFIG_PACKAGE_frr-
%,$(PKG_DAEMON_AVAILABLE
)) \
48 PKG_BUILD_DEPENDS
:=python3
/host
51 include $(INCLUDE_DIR
)/package.mk
52 include $(INCLUDE_DIR
)/host-build.mk
54 define Package
/frr-libfrr
/config
55 source
"$(SOURCE)/Config.in"
58 define Package
/frr
/Default
61 SUBMENU
:=Routing and Redirection
62 URL
:=https
://www.frrouting.org
/
67 $(call Package
/frr
/Default
)
69 TITLE
:=The FRRouting
(FRR
) Software Routing Suite
73 define Package
/frr
/description
74 FRRouting is free software that implements and manages various IPv4 and IPv6
77 Currently FRRouting supports BGP4
, BGP4
+, OSPFv2
, OSPFv3
, RIPv1
, RIPv2
, RIPng
,
78 IS-IS
, PIM-SM
/MSDP
, LDP
, VRRP and Babel
as well
as very early support for EIGRP and
82 define Package
/frr-libfrr
83 $(call Package
/frr
/Default
)
85 DEPENDS
+=+librt
+libatomic
+libjson-c
+libyang
+FRR_OPENSSL
:libopenssl
86 CONFLICTS
:=quagga-libzebra
89 define Package
/frr-vtysh
90 $(call Package
/frr
/Default
)
91 DEPENDS
+=+frr-libfrr
+libreadline
+libncurses
+more
92 TITLE
:=integrated
shell for frr routing software
93 CONFLICTS
:=quagga-vtysh
96 define Package
/frr-watchfrr
97 $(call Package
/frr
/Default
)
100 DEFAULT
:=y if PACKAGE_frr
103 define Package
/frr-zebra
104 $(call Package
/frr
/Default
)
107 DEFAULT
:=y if PACKAGE_frr
108 CONFLICTS
:=quagga-zebra
111 ##Migrate from quagga
112 ##should test file exists and link in frr folder
113 #define Package/frr/postinst
115 #if [ -f /etc/quagga/ospfd.conf ]; then
117 # sed enable ospfd daemon
123 define Package
/frr-
$(1)
124 $$(call Package
/frr
/Default
)
125 TITLE
:= $(1) routing engine
126 DEPENDS
+=frr-libfrr
$(2)
129 define Package
/frr-
$(1)/install
130 $(INSTALL_DIR
) $$(1)/usr
/sbin
131 if
[ "$(1)" != "fabricd" ]; then \
132 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/build
/$(1)/.libs
/$(1) $$(1)/usr
/sbin
/; \
134 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/build
/isisd
/.libs
/$(1) $$(1)/usr
/sbin
/; fi
135 if
[ "$(1)" == "nhrpd" ]; then \
136 $(INSTALL_DIR
) $$(1)/usr
/lib
; \
137 $(CP
) $(PKG_BUILD_DIR
)/build
/lib
/.libs
/libfrrcares.so
* $$(1)/usr
/lib
/; fi
140 $$(eval
$$(call BuildPackage
,frr-
$(1)))
143 define Package
/frr-libfrr
/conffiles
147 TARGET_LDFLAGS
+= -latomic
150 $(Build
/Prepare
/Default
)
151 mkdir
-p
$(PKG_BUILD_DIR
)/build
154 define Build
/Configure
155 ( cd
$(PKG_BUILD_DIR
)/build
/ ; \
157 --host
="$(GNU_TARGET_NAME)" \
158 --build
="$(GNU_HOST_NAME)" \
159 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
160 CXXFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
161 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
162 HOST_CFLAGS
="$(HOST_CFLAGS)" \
163 HOST_LDFLAGS
="$(HOST_LDFLAGS)" \
164 BUILD_CPPFLAGS
="$(TARGET_CPPLAGS)" \
165 BUILD_CFLAGS
="$(TARGET_CFLAGS)" \
166 BUILD_LDFLAGS
="$(TARGET_LDFLAGS)" \
170 --enable-user
=network \
171 --enable-group
=network \
172 --enable-multipath
=16 \
173 --disable-capabilities \
174 --disable-ospfclient \
176 --disable-backtrace \
177 --localstatedir
=/var
/run
/frr \
178 --sysconfdir
=/etc
/frr
/ \
179 $(if
$(CONFIG_FRR_OPENSSL
),--with-crypto
=openssl
,) \
180 $(foreach m
,$(PKG_DAEMON_AVAILABLE
), \
181 $(call autoconf_bool
,CONFIG_PACKAGE_frr-
$(m
),$(m
)) ) \
182 $(call autoconf_bool
,CONFIG_PACKAGE_frr-vtysh
,vtysh
) \
183 $(call autoconf_bool
,CONFIG_PACKAGE_frr-libfrr
,zebra
) \
188 NUM_CORES ?
= $(shell grep
-c
"vendor_id" /proc
/cpuinfo
)
191 $(MAKE
) -C
$(PKG_BUILD_DIR
)/build
-j
$(NUM_CORES
)
194 define Package
/frr
/install
195 $(INSTALL_DIR
) $(1)/usr
/sbin
196 $(INSTALL_BIN
) .
/files
/frrcommon.sh
$(1)/usr
/sbin
/
197 $(INSTALL_DIR
) $(1)/etc
/init.d
198 $(INSTALL_BIN
) .
/files
/frr
$(1)/etc
/init.d
/
201 define Package
/frr-watchfrr
/install
202 $(INSTALL_DIR
) $(1)/usr
/sbin
203 $(INSTALL_BIN
) .
/files
/watchfrr.sh
$(1)/usr
/sbin
/
204 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/build
/watchfrr
/.libs
/watchfrr
$(1)/usr
/sbin
/
207 define Package
/frr-zebra
/install
208 $(INSTALL_DIR
) $(1)/usr
/sbin
209 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/build
/zebra
/.libs
/zebra
$(1)/usr
/sbin
/
212 define Package
/frr-libfrr
/install
213 $(INSTALL_DIR
) $(1)/usr
/lib
214 $(CP
) $(PKG_BUILD_DIR
)/build
/lib
/.libs
/libfrr.so
* $(1)/usr
/lib
/
215 $(INSTALL_DIR
) $(1)/etc
/frr
216 chmod
0750 $(1)/etc
/frr
217 $(INSTALL_CONF
) .
/files
/{frr.conf
,daemons
} $(1)/etc
/frr
/
220 define Package
/frr-vtysh
/install
221 $(INSTALL_DIR
) $(1)/usr
/bin
222 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/build
/vtysh
/.libs
/vtysh
$(1)/usr
/bin
/
225 $(eval
$(call HostBuild
))
226 $(eval
$(call BuildPackage
,frr
))
227 $(eval
$(call BuildPackage
,frr-libfrr
))
228 $(eval
$(call BuildPackage
,frr-watchfrr
))
229 $(eval
$(call BuildPackage
,frr-zebra
))
230 $(eval
$(call BuildPackage
,frr-vtysh
))
231 $(eval
$(call BuildDaemon
,babeld
,))
232 $(eval
$(call BuildDaemon
,bfdd
,))
233 $(eval
$(call BuildDaemon
,bgpd
,))
234 $(eval
$(call BuildDaemon
,eigrpd
,))
235 $(eval
$(call BuildDaemon
,fabricd
,))
236 $(eval
$(call BuildDaemon
,isisd
,))
237 $(eval
$(call BuildDaemon
,ldpd
,))
238 $(eval
$(call BuildDaemon
,nhrpd
,+libcares
))
239 $(eval
$(call BuildDaemon
,ospfd
,))
240 $(eval
$(call BuildDaemon
,ospf6d
,@IPV6
))
241 $(eval
$(call BuildDaemon
,pbrd
,))
242 $(eval
$(call BuildDaemon
,pimd
,))
243 $(eval
$(call BuildDaemon
,ripd
,))
244 $(eval
$(call BuildDaemon
,ripngd
,@IPV6
))
245 $(eval
$(call BuildDaemon
,staticd
,))
246 $(eval
$(call BuildDaemon
,vrrpd
,))