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