libnpupnp: update to 5.1.1
[feed/packages.git] / net / frr / Makefile
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
8 include $(TOPDIR)/rules.mk
9 PKG_NAME:=frr
10 PKG_VERSION:=9.0.0
11 PKG_RELEASE:=1
12 PKG_SOURCE_DATE:=2023-08-12
13
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)?
17
18 PKG_HASH:=6e611cd86ae9787a4b8d71411fdc38ad1fe843a839756c9c386848ffde81f6cf
19 PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
22 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
23
24 PKG_LICENSE:=GPL-2.0-only LGPL-2.1-only
25
26 PKG_DAEMON_AVAILABLE:= \
27 babeld \
28 bfdd \
29 bgpd \
30 eigrpd \
31 fabricd \
32 isisd \
33 ldpd \
34 nhrpd \
35 ospfd \
36 ospf6d \
37 pathd \
38 pbrd \
39 pimd \
40 ripd \
41 ripngd \
42 staticd \
43 vrrpd
44
45 PKG_CONFIG_DEPENDS:= \
46 CONFIG_IPV6 \
47 CONFIG_FRR_OPENSSL \
48 CONFIG_FRR_INTERNAL \
49 CONFIG_FRR_SNMP \
50 CONFIG_FRR_NO_SNMP \
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)) \
56
57 PKG_FIXUP:=autoreconf
58 PKG_BUILD_PARALLEL:=1
59 PKG_INSTALL:=1
60 PKG_BUILD_FLAGS:=lto
61
62 PKG_BUILD_DEPENDS:=frr/host protobuf-c/host
63 HOST_BUILD_DEPENDS:=python3/host
64
65 include $(INCLUDE_DIR)/package.mk
66 include $(INCLUDE_DIR)/host-build.mk
67
68 define Package/frr-libfrr/config
69 source "$(SOURCE)/Config.in"
70 endef
71
72 define Package/frr/Default
73 SECTION:=net
74 CATEGORY:=Network
75 SUBMENU:=Routing and Redirection
76 URL:=https://www.frrouting.org/
77 DEPENDS:=frr
78 endef
79
80 define Package/frr
81 $(call Package/frr/Default)
82 DEPENDS:=+librt
83 TITLE:=The FRRouting (FRR) Software Routing Suite
84 MENU:=1
85 endef
86
87 define Package/frr/description
88 FRRouting is free software that implements and manages various IPv4 and IPv6
89 routing protocols.
90
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
93 NHRP.
94 endef
95
96 define Package/frr-libfrr
97 $(call Package/frr/Default)
98 TITLE:=zebra library
99 DEPENDS+=+librt +libatomic +libcap +libjson-c +libyang +libprotobuf-c +FRR_OPENSSL:libopenssl +FRR_SNMP:libnetsnmp
100 CONFLICTS:=quagga-libzebra
101 endef
102
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
108 endef
109
110 define Package/frr-watchfrr
111 $(call Package/frr/Default)
112 TITLE:=frr watchdog
113 DEPENDS+=+frr-libfrr
114 DEFAULT:=y if PACKAGE_frr
115 endef
116
117 define Package/frr-zebra
118 $(call Package/frr/Default)
119 TITLE:=Zebra daemon
120 DEPENDS+=+frr-libfrr
121 DEFAULT:=y if PACKAGE_frr
122 CONFLICTS:=quagga-zebra
123 endef
124
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
129 endef
130
131 ##Migrate from quagga
132 ##should test file exists and link in frr folder
133 #define Package/frr/postinst
134 ##!/bin/sh
135 #if [ -f /etc/quagga/ospfd.conf ]; then
136 # ls to /etc/frr
137 # sed enable ospfd daemon
138 #fi
139 #exit 0
140 #endef
141
142 define BuildDaemon
143 define Package/frr-$(1)
144 $$(call Package/frr/Default)
145 TITLE:= $(1) routing engine
146 DEPENDS+=frr-libfrr $(2)
147 endef
148 # if [ "$(1)" == "bfdd" ]; then \
149 # export HAVE_BFDD == 1 ; fi
150
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
157 endef
158
159 $$(eval $$(call BuildPackage,frr-$(1)))
160 endef
161
162 define Package/frr-libfrr/conffiles
163 /etc/frr/daemons
164 /etc/frr/frr.conf
165 /etc/frr/vtysh.conf
166 endef
167
168 TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed -latomic
169
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
173 endef
174
175 HOST_CPPFLAGS += -I$(STAGING_DIR_HOST)/include/libelf
176 HOST_CONFIGURE_ARGS+= \
177 --enable-clippy-only
178
179 define Host/Install
180 $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
181 $(INSTALL_BIN) $(HOST_BUILD_DIR)/lib/clippy $(STAGING_DIR_HOSTPKG)/bin/
182 endef
183
184 CONFIGURE_ARGS+= \
185 --with-clippy=$(STAGING_DIR_HOSTPKG)/bin/clippy \
186 --prefix=/usr \
187 --enable-shared \
188 --disable-static \
189 --enable-user=network \
190 --enable-group=network \
191 --disable-ospfclient \
192 --disable-doc \
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)
202
203
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/
208 endef
209
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/
214 endef
215
216 define Package/frr-zebra/install
217 $(INSTALL_DIR) $(1)/usr/sbin
218 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zebra $(1)/usr/sbin/
219 endef
220
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/
226 endef
227
228
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/
234 endef
235
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/
240 endef
241
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,))