Merge pull request #624 from ecsv/batadv-for-18.06
[feed/routing.git] / quagga / Makefile
1 #
2 # Copyright (C) 2006-2016 OpenWrt.org
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
10 PKG_NAME:=quagga
11 PKG_VERSION:=1.1.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://download.savannah.gnu.org/releases/quagga/
16 PKG_HASH:=b5a94e5bdad3062e04595a5692b8cc435f0a85102f75dfdca0a06d093b4ef63f
17
18 PKG_MAINTAINER:=Vasilis Tsiligiannis <acinonyx@openwrt.gr>
19 PKG_LICENSE:=GPL-2.0-or-later
20 PKG_LICENSE_FILES:=COPYING
21
22 PKG_BUILD_PARALLEL:=1
23 PKG_FIXUP:=autoreconf
24 PKG_INSTALL:=1
25
26 PKG_CONFIG_DEPENDS:= \
27 CONFIG_IPV6 \
28 CONFIG_PACKAGE_quagga-watchquagga \
29 CONFIG_PACKAGE_quagga-zebra \
30 CONFIG_PACKAGE_quagga-libzebra \
31 CONFIG_PACKAGE_quagga-libospf \
32 CONFIG_PACKAGE_quagga-bgpd \
33 CONFIG_PACKAGE_quagga-isisd \
34 CONFIG_PACKAGE_quagga-ospf6d \
35 CONFIG_PACKAGE_quagga-ripd \
36 CONFIG_PACKAGE_quagga-ripngd \
37 CONFIG_PACKAGE_quagga-vtysh
38
39 include $(INCLUDE_DIR)/package.mk
40
41 define Package/quagga/Default
42 SECTION:=net
43 CATEGORY:=Network
44 SUBMENU:=Routing and Redirection
45 TITLE:=The Quagga Software Routing Suite
46 URL:=https://www.quagga.net
47 DEPENDS:=quagga
48 endef
49
50 define Package/quagga
51 $(call Package/quagga/Default)
52 DEPENDS:=+librt
53 MENU:=1
54 endef
55
56 define Package/quagga/description
57 A routing software package that provides TCP/IP based routing services
58 with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2,
59 OSPFv3, BGP-4, and BGP-4+
60 endef
61
62 define Package/quagga-watchquagga
63 $(call Package/quagga/Default)
64 TITLE:=Quagga watchdog
65 DEPENDS+=+quagga-libzebra
66 DEFAULT:=y if PACKAGE_quagga
67 endef
68
69 define Package/quagga-zebra
70 $(call Package/quagga/Default)
71 TITLE:=Zebra daemon
72 DEPENDS+=+quagga-libzebra
73 DEFAULT:=y if PACKAGE_quagga
74 endef
75
76 define Package/quagga-libzebra
77 $(call Package/quagga/Default)
78 TITLE:=zebra library
79 endef
80
81 define Package/quagga-libospf
82 $(call Package/quagga/Default)
83 DEPENDS+=+quagga-libzebra
84 TITLE:=OSPF library
85 endef
86
87 define Package/quagga-bgpd
88 $(call Package/quagga/Default)
89 DEPENDS+=+quagga-libzebra
90 TITLE:=BGPv4, BGPv4+, BGPv4- routing engine
91 endef
92
93 define Package/quagga-isisd
94 $(call Package/quagga/Default)
95 DEPENDS+=+quagga-libzebra
96 TITLE:=IS-IS routing engine
97 endef
98
99 define Package/quagga-ospfd
100 $(call Package/quagga/Default)
101 DEPENDS+=+quagga-libospf
102 TITLE:=OSPFv2 routing engine
103 endef
104
105 define Package/quagga-ospf6d
106 $(call Package/quagga/Default)
107 DEPENDS+=+quagga-libospf @IPV6
108 TITLE:=OSPFv3 routing engine
109 endef
110
111 define Package/quagga-ripd
112 $(call Package/quagga/Default)
113 DEPENDS+=+quagga-libzebra
114 TITLE:=RIP routing engine
115 endef
116
117 define Package/quagga-ripngd
118 $(call Package/quagga/Default)
119 DEPENDS+=+quagga-libzebra @IPV6
120 TITLE:=RIPNG routing engine
121 endef
122
123 define Package/quagga-vtysh
124 $(call Package/quagga/Default)
125 DEPENDS+=+quagga-libzebra +libreadline +libncurses
126 TITLE:=integrated shell for Quagga routing software
127 endef
128
129 define Package/quagga-zebra/conffiles
130 /etc/quagga/zebra.conf
131 endef
132
133 define Package/quagga-bgpd/conffiles
134 /etc/quagga/bgpd.conf
135 endef
136
137 define Package/quagga-isisd/conffiles
138 /etc/quagga/isisd.conf
139 endef
140
141 define Package/quagga-ospfd/conffiles
142 /etc/quagga/ospfd.conf
143 endef
144
145 define Package/quagga-ospf6d/conffiles
146 /etc/quagga/ospf6d.conf
147 endef
148
149 define Package/quagga-ripd/conffiles
150 /etc/quagga/ripd.conf
151 endef
152
153 define Package/quagga-ripngd/conffiles
154 /etc/quagga/ripngd.conf
155 endef
156
157 ifneq ($(SDK),)
158 CONFIG_PACKAGE_quagga-libzebra:=m
159 CONFIG_PACKAGE_quagga-libospf:=m
160 CONFIG_PACKAGE_quagga-watchquagga:=m
161 CONFIG_PACKAGE_quagga-zebra:=m
162 CONFIG_PACKAGE_quagga-bgpd:=m
163 CONFIG_PACKAGE_quagga-isisd:=m
164 CONFIG_PACKAGE_quagga-ospf6d:=m
165 CONFIG_PACKAGE_quagga-ripd:=m
166 CONFIG_PACKAGE_quagga-ripngd:=m
167 CONFIG_PACKAGE_quagga-vtysh:=m
168 endif
169
170 CONFIGURE_ARGS+= \
171 --localstatedir=/var/run/quagga \
172 --sysconfdir=/etc/quagga/ \
173 --enable-shared \
174 --disable-static \
175 --enable-user=network \
176 --enable-group=network \
177 --enable-multipath=8 \
178 --disable-ospfclient \
179 --disable-capabilities \
180 --disable-doc \
181 $(call autoconf_bool,CONFIG_PACKAGE_quagga-libzebra,zebra) \
182 $(call autoconf_bool,CONFIG_PACKAGE_quagga-libospf,ospfd) \
183 $(call autoconf_bool,CONFIG_PACKAGE_quagga-bgpd,bgpd) \
184 $(call autoconf_bool,CONFIG_PACKAGE_quagga-isisd,isisd) \
185 $(call autoconf_bool,CONFIG_PACKAGE_quagga-ospf6d,ospf6d) \
186 $(call autoconf_bool,CONFIG_PACKAGE_quagga-ripd,ripd) \
187 $(call autoconf_bool,CONFIG_PACKAGE_quagga-ripngd,ripngd) \
188 $(call autoconf_bool,CONFIG_PACKAGE_quagga-vtysh,vtysh) \
189
190 MAKE_FLAGS += \
191 CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
192
193 define Package/quagga/install
194 $(INSTALL_DIR) $(1)/usr/sbin
195 $(INSTALL_BIN) ./files/quagga $(1)/usr/sbin/quagga.init
196 $(INSTALL_DIR) $(1)/etc/init.d
197 $(INSTALL_BIN) ./files/quagga.init $(1)/etc/init.d/quagga
198 endef
199
200 define Package/quagga-watchquagga/install
201 $(INSTALL_DIR) $(1)/usr/sbin
202 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/watchquagga $(1)/usr/sbin/
203 endef
204
205 define Package/quagga-zebra/install
206 $(INSTALL_DIR) $(1)/usr/sbin
207 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zebra $(1)/usr/sbin/
208 $(INSTALL_DIR) $(1)/etc/quagga
209 chmod 0750 $(1)/etc/quagga
210 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/zebra.conf
211 endef
212
213 define Package/quagga-bgpd/install
214 $(INSTALL_DIR) $(1)/usr/sbin
215 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bgpd $(1)/usr/sbin/
216 $(INSTALL_DIR) $(1)/etc/quagga
217 chmod 0750 $(1)/etc/quagga
218 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/bgpd.conf
219 endef
220
221 define Package/quagga-isisd/install
222 $(INSTALL_DIR) $(1)/usr/sbin
223 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/isisd $(1)/usr/sbin/
224 $(INSTALL_DIR) $(1)/etc/quagga
225 chmod 0750 $(1)/etc/quagga
226 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/isisd.conf
227 endef
228
229 define Package/quagga-ospfd/install
230 $(INSTALL_DIR) $(1)/usr/sbin
231 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospfd $(1)/usr/sbin/
232 $(INSTALL_DIR) $(1)/etc/quagga
233 chmod 0750 $(1)/etc/quagga
234 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospfd.conf
235 endef
236
237 define Package/quagga-ospf6d/install
238 $(INSTALL_DIR) $(1)/usr/sbin
239 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospf6d $(1)/usr/sbin/
240 $(INSTALL_DIR) $(1)/etc/quagga
241 chmod 0750 $(1)/etc/quagga
242 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospf6d.conf
243 endef
244
245 define Package/quagga-ripd/install
246 $(INSTALL_DIR) $(1)/usr/sbin
247 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripd $(1)/usr/sbin/
248 $(INSTALL_DIR) $(1)/etc/quagga
249 chmod 0750 $(1)/etc/quagga
250 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripd.conf
251 endef
252
253 define Package/quagga-ripngd/install
254 $(INSTALL_DIR) $(1)/usr/sbin
255 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripngd $(1)/usr/sbin/
256 $(INSTALL_DIR) $(1)/etc/quagga
257 chmod 0750 $(1)/etc/quagga
258 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripngd.conf
259 endef
260
261 define Package/quagga-vtysh/install
262 $(INSTALL_DIR) $(1)/usr/bin
263 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/
264 endef
265
266 define Package/quagga-libospf/install
267 $(INSTALL_DIR) $(1)/usr/lib
268 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(1)/usr/lib/
269 endef
270
271 define Package/quagga-libzebra/install
272 $(INSTALL_DIR) $(1)/usr/lib
273 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(1)/usr/lib/
274 endef
275
276 $(eval $(call BuildPackage,quagga))
277 $(eval $(call BuildPackage,quagga-libzebra))
278 $(eval $(call BuildPackage,quagga-libospf))
279 $(eval $(call BuildPackage,quagga-watchquagga))
280 $(eval $(call BuildPackage,quagga-zebra))
281 $(eval $(call BuildPackage,quagga-bgpd))
282 $(eval $(call BuildPackage,quagga-isisd))
283 $(eval $(call BuildPackage,quagga-ospfd))
284 $(eval $(call BuildPackage,quagga-ospf6d))
285 $(eval $(call BuildPackage,quagga-ripd))
286 $(eval $(call BuildPackage,quagga-ripngd))
287 $(eval $(call BuildPackage,quagga-vtysh))