@@ -14,38 +14,85 @@ PKG_MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>, Nick Hainke <vincent@sy
1414PKG_LICENSE: =GPL-2.0-or-later
1515
1616PKG_BUILD_DEPENDS: =ncurses readline
17- PKG_BUILD_DIR: =$(BUILD_DIR ) /bird-$(PKG_VERSION )
17+ PKG_BUILD_DIR: =$(BUILD_DIR ) /$(PKG_NAME ) -$(BUILD_VARIANT ) /bird-$(PKG_VERSION )
18+
19+ PKG_CONFIG_DEPENDS := \
20+ CONFIG_BIRD3_PROTO_AGGREGATOR \
21+ CONFIG_BIRD3_PROTO_BABEL \
22+ CONFIG_BIRD3_PROTO_BFD \
23+ CONFIG_BIRD3_PROTO_BGP \
24+ CONFIG_BIRD3_PROTO_BMP \
25+ CONFIG_BIRD3_PROTO_L3VPN \
26+ CONFIG_BIRD3_PROTO_OSPF \
27+ CONFIG_BIRD3_PROTO_PERF \
28+ CONFIG_BIRD3_PROTO_RADV \
29+ CONFIG_BIRD3_PROTO_RIP \
30+ CONFIG_BIRD3_PROTO_RPKI
1831
1932include $(INCLUDE_DIR ) /package.mk
2033
21- define Package/bird3
22- TITLE:=The BIRD Internet Routing Daemon (v3)
23- URL:=https://bird.nic.cz/
24- SECTION:=net
25- CATEGORY:=Network
26- SUBMENU:=Routing and Redirection
27- DEPENDS:=+libpthread +libatomic
28- CONFLICTS:=bird2
29- endef
30-
31- define Package/bird3c
32- TITLE:=The BIRD command-line client (v3)
33- URL:=https://bird.nic.cz/
34- SECTION:=net
35- CATEGORY:=Network
36- SUBMENU:=Routing and Redirection
37- DEPENDS:=+bird3 +libreadline +libncurses
38- CONFLICTS:=bird2
39- endef
34+ BUILD_VARIANT? =full
35+
36+ # Infrastructure protocols included in every variant unconditionally.
37+ BIRD3_INFRA := mrt,pipe,static
38+
39+ # Predefined protocol sets for prebuilt package variants
40+ BIRD3_PROTOCOLS_bgp := bgp,rpki,bfd,$(BIRD3_INFRA )
41+ BIRD3_PROTOCOLS_ospf := ospf,bfd,$(BIRD3_INFRA )
42+ BIRD3_PROTOCOLS_babel := babel,$(BIRD3_INFRA )
43+ BIRD3_PROTOCOLS_mesh := babel,bgp,$(BIRD3_INFRA )
44+
45+ # For the full variant, assemble the protocol list from Config.in selections.
46+ ifeq ($(BUILD_VARIANT ) ,full)
47+ BIRD3_PROTOCOLS := $(BIRD3_INFRA )
48+ ifdef CONFIG_BIRD3_PROTO_AGGREGATOR
49+ BIRD3_PROTOCOLS := $(BIRD3_PROTOCOLS ) ,aggregator
50+ endif
51+ ifdef CONFIG_BIRD3_PROTO_BABEL
52+ BIRD3_PROTOCOLS := $(BIRD3_PROTOCOLS ) ,babel
53+ endif
54+ ifdef CONFIG_BIRD3_PROTO_BFD
55+ BIRD3_PROTOCOLS := $(BIRD3_PROTOCOLS ) ,bfd
56+ endif
57+ ifdef CONFIG_BIRD3_PROTO_BGP
58+ BIRD3_PROTOCOLS := $(BIRD3_PROTOCOLS ) ,bgp
59+ endif
60+ ifdef CONFIG_BIRD3_PROTO_BMP
61+ BIRD3_PROTOCOLS := $(BIRD3_PROTOCOLS ) ,bmp
62+ endif
63+ ifdef CONFIG_BIRD3_PROTO_L3VPN
64+ BIRD3_PROTOCOLS := $(BIRD3_PROTOCOLS ) ,l3vpn
65+ endif
66+ ifdef CONFIG_BIRD3_PROTO_OSPF
67+ BIRD3_PROTOCOLS := $(BIRD3_PROTOCOLS ) ,ospf
68+ endif
69+ ifdef CONFIG_BIRD3_PROTO_PERF
70+ BIRD3_PROTOCOLS := $(BIRD3_PROTOCOLS ) ,perf
71+ endif
72+ ifdef CONFIG_BIRD3_PROTO_RADV
73+ BIRD3_PROTOCOLS := $(BIRD3_PROTOCOLS ) ,radv
74+ endif
75+ ifdef CONFIG_BIRD3_PROTO_RIP
76+ BIRD3_PROTOCOLS := $(BIRD3_PROTOCOLS ) ,rip
77+ endif
78+ ifdef CONFIG_BIRD3_PROTO_RPKI
79+ BIRD3_PROTOCOLS := $(BIRD3_PROTOCOLS ) ,rpki
80+ endif
81+ else
82+ BIRD3_PROTOCOLS := $(BIRD3_PROTOCOLS_$(BUILD_VARIANT ) )
83+ endif
84+
85+ CONFIGURE_ARGS += --disable-libssh --with-protocols=$(BIRD3_PROTOCOLS )
86+ TARGET_LDFLAGS += -latomic
4087
41- define Package/bird3cl
42- TITLE:=The BIRD lightweight command-line client (v2)
88+ define Package/bird3/Default
4389 URL:=https://bird.nic.cz/
4490 SECTION:=net
4591 CATEGORY:=Network
4692 SUBMENU:=Routing and Redirection
47- DEPENDS:=+bird3
93+ DEPENDS:=+libpthread +libatomic
4894 CONFLICTS:=bird2
95+ PROVIDES:=bird3
4996endef
5097
5198define Package/bird3/Default/description
@@ -55,6 +102,17 @@ interface and powerful route filtering language. It is lightweight and
55102efficient and therefore appropriate for small embedded routers.
56103endef
57104
105+ define Package/bird3
106+ $(call Package/bird3/Default)
107+ TITLE:=The BIRD Internet Routing Daemon (v3)
108+ VARIANT:=full
109+ CONFLICTS:=bird2 bird3-bgp bird3-ospf bird3-babel bird3-mesh
110+ endef
111+
112+ define Package/bird3/config
113+ source "$(SOURCE ) /Config.in"
114+ endef
115+
58116define Package/bird3/description
59117$(call Package/bird3/Default/description)
60118
@@ -70,9 +128,59 @@ configuration syntax.
70128This is the 3.0 branch of Bird which is a multithreaded rewrite.
71129endef
72130
73- define Package/bird3c/description
131+ define Package/bird3-bgp
132+ $(call Package/bird3/Default)
133+ TITLE:=The BIRD Internet Routing Daemon (v3) - BGP/RPKI/BFD
134+ VARIANT:=bgp
135+ CONFLICTS:=bird2 bird3 bird3-ospf bird3-babel bird3-mesh
136+ endef
137+
138+ Package/bird3-bgp/description = $(Package/bird3/Default/description )
139+
140+ define Package/bird3-ospf
141+ $(call Package/bird3/Default)
142+ TITLE:=The BIRD Internet Routing Daemon (v3) - OSPF/BFD
143+ VARIANT:=ospf
144+ CONFLICTS:=bird2 bird3 bird3-bgp bird3-babel bird3-mesh
145+ endef
146+
147+ Package/bird3-ospf/description = $(Package/bird3/Default/description )
148+
149+ define Package/bird3-babel
150+ $(call Package/bird3/Default)
151+ TITLE:=The BIRD Internet Routing Daemon (v3) - Babel
152+ VARIANT:=babel
153+ CONFLICTS:=bird2 bird3 bird3-bgp bird3-ospf bird3-mesh
154+ endef
155+
156+ Package/bird3-babel/description = $(Package/bird3/Default/description )
157+
158+ define Package/bird3-mesh
159+ $(call Package/bird3/Default)
160+ TITLE:=The BIRD Internet Routing Daemon (v3) - Babel+BGP mesh
161+ VARIANT:=mesh
162+ CONFLICTS:=bird2 bird3 bird3-bgp bird3-ospf bird3-babel
163+ endef
164+
165+ define Package/bird3-mesh/description
74166$(call Package/bird3/Default/description)
75167
168+ Size-optimized variant for mesh networks running Babel for routing and
169+ BGP for overlay services such as hostname distribution.
170+ endef
171+
172+ define Package/bird3c
173+ TITLE:=The BIRD command-line client (v3)
174+ URL:=https://bird.nic.cz/
175+ SECTION:=net
176+ CATEGORY:=Network
177+ SUBMENU:=Routing and Redirection
178+ DEPENDS:=+bird3 +libreadline +libncurses
179+ CONFLICTS:=bird2
180+ VARIANT:=full
181+ endef
182+
183+ define Package/bird3c/description
76184This is a BIRD command-line client. It is used to send commands to BIRD,
77185commands can perform simple actions such as enabling/disabling of
78186protocols, telling BIRD to show various information, telling it to show
@@ -82,24 +190,35 @@ Unless you can't afford dependency on ncurses and readline, you
82190should install BIRD command-line client together with BIRD.
83191endef
84192
85- define Package/bird3cl/description
86- $(call Package/bird3/Default/description)
193+ define Package/bird3cl
194+ TITLE:=The BIRD lightweight command-line client (v3)
195+ URL:=https://bird.nic.cz/
196+ SECTION:=net
197+ CATEGORY:=Network
198+ SUBMENU:=Routing and Redirection
199+ DEPENDS:=+bird3
200+ CONFLICTS:=bird2
201+ VARIANT:=full
202+ endef
87203
204+ define Package/bird3cl/description
88205This is a BIRD lightweight command-line client. It is used to send commands
89206to BIRD, commands can perform simple actions such as enabling/disabling of
90207protocols, telling BIRD to show various information, telling it to show
91208a routing table filtered by a filter, or asking BIRD to reconfigure.
92209endef
93210
94- CONFIGURE_ARGS += --disable-libssh
95- TARGET_LDFLAGS += -latomic
96-
97211define Package/bird3/conffiles
98212/etc/bird.conf
99213/etc/bird4.conf
100214/etc/bird6.conf
101215endef
102216
217+ Package/bird3-bgp/conffiles = $(Package/bird3/conffiles )
218+ Package/bird3-ospf/conffiles = $(Package/bird3/conffiles )
219+ Package/bird3-babel/conffiles = $(Package/bird3/conffiles )
220+ Package/bird3-mesh/conffiles = $(Package/bird3/conffiles )
221+
103222define Package/bird3/install
104223 $(INSTALL_DIR ) $(1 ) /usr/sbin
105224 $(INSTALL_BIN ) $(PKG_BUILD_DIR ) /bird $(1 ) /usr/sbin/
@@ -109,6 +228,11 @@ define Package/bird3/install
109228 $(INSTALL_BIN ) ./files/bird.init $(1 ) /etc/init.d/bird
110229endef
111230
231+ Package/bird3-bgp/install = $(Package/bird3/install )
232+ Package/bird3-ospf/install = $(Package/bird3/install )
233+ Package/bird3-babel/install = $(Package/bird3/install )
234+ Package/bird3-mesh/install = $(Package/bird3/install )
235+
112236define Package/bird3c/install
113237 $(INSTALL_DIR ) $(1 ) /usr/sbin
114238 $(INSTALL_BIN ) $(PKG_BUILD_DIR ) /birdc $(1 ) /usr/sbin/
@@ -120,5 +244,9 @@ define Package/bird3cl/install
120244endef
121245
122246$(eval $(call BuildPackage,bird3))
247+ $(eval $(call BuildPackage,bird3-bgp))
248+ $(eval $(call BuildPackage,bird3-ospf))
249+ $(eval $(call BuildPackage,bird3-babel))
250+ $(eval $(call BuildPackage,bird3-mesh))
123251$(eval $(call BuildPackage,bird3c))
124252$(eval $(call BuildPackage,bird3cl))
0 commit comments