121984316701e1c73ff2740710a81ff4d41cef3e
[packages.git] / net / quagga / Makefile
1 #
2 # Copyright (C) 2006-2012 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.21
12 PKG_RELEASE:=3
13 PKG_MD5SUM:=99840adbe57047c90dfba6b6ed9aec7f
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.quagga.net/download/ \
17                 http://www.de.quagga.net/download/ \
18                 http://www.uk.quagga.net/download/
19 PKG_CONFIG_DEPENDS:= \
20         CONFIG_IPV6 \
21         CONFIG_PACKAGE_quagga-watchquagga \
22         CONFIG_PACKAGE_quagga-zebra \
23         CONFIG_PACKAGE_quagga-libzebra \
24         CONFIG_PACKAGE_quagga-libospf \
25         CONFIG_PACKAGE_quagga-bgpd \
26         CONFIG_PACKAGE_quagga-isisd \
27         CONFIG_PACKAGE_quagga-ospf6d \
28         CONFIG_PACKAGE_quagga-ripd \
29         CONFIG_PACKAGE_quagga-ripngd \
30         CONFIG_PACKAGE_quagga-babeld \
31         CONFIG_PACKAGE_quagga-vtysh
32 PKG_BUILD_PARALLEL:=1
33 PKG_FIXUP:=autoreconf
34 PKG_INSTALL:=1
35
36 include $(INCLUDE_DIR)/package.mk
37
38 define Package/quagga/Default
39   SECTION:=net
40   CATEGORY:=Network
41   SUBMENU:=Routing and Redirection
42   DEPENDS:=quagga
43   TITLE:=The Quagga Software Routing Suite
44   URL:=http://www.quagga.net
45   MAINTAINER:=Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr>
46 endef
47
48 define Package/quagga
49   $(call Package/quagga/Default)
50   DEPENDS:=+librt
51   MENU:=1
52 endef
53
54 define Package/quagga/description
55   A routing software package that provides TCP/IP based routing services
56   with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2,
57   OSPFv3, BGP-4, and BGP-4+
58 endef
59
60 define Package/quagga-watchquagga
61   $(call Package/quagga/Default)
62   TITLE:=Quagga watchdog
63   DEPENDS+=+quagga-libzebra
64   DEFAULT:=y if PACKAGE_quagga
65 endef
66
67 define Package/quagga-zebra
68   $(call Package/quagga/Default)
69   TITLE:=Zebra daemon
70   DEPENDS+=+quagga-libzebra
71   DEFAULT:=y if PACKAGE_quagga
72 endef
73
74 define Package/quagga-libzebra
75   $(call Package/quagga/Default)
76   TITLE:=zebra library
77 endef
78
79 define Package/quagga-libospf
80   $(call Package/quagga/Default)
81   TITLE:=OSPF library
82 endef
83
84 define Package/quagga-bgpd
85   $(call Package/quagga/Default)
86   DEPENDS+=+quagga-libzebra
87   TITLE:=BGPv4, BGPv4+, BGPv4- routing engine
88 endef
89
90 define Package/quagga-isisd
91   $(call Package/quagga/Default)
92   DEPENDS+=+quagga-libzebra
93   TITLE:=IS-IS routing engine
94 endef
95
96 define Package/quagga-ospfd
97   $(call Package/quagga/Default)
98   DEPENDS+=+quagga-libospf +quagga-libzebra
99   TITLE:=OSPFv2 routing engine
100 endef
101
102 define Package/quagga-ospf6d
103   $(call Package/quagga/Default)
104   DEPENDS+=+quagga-libospf +quagga-libzebra @IPV6
105   TITLE:=OSPFv3 routing engine
106 endef
107
108 define Package/quagga-ripd
109   $(call Package/quagga/Default)
110   DEPENDS+=+quagga-libzebra
111   TITLE:=RIP routing engine
112 endef
113
114 define Package/quagga-ripngd
115   $(call Package/quagga/Default)
116   DEPENDS+=+quagga-libzebra @IPV6
117   TITLE:=RIPNG routing engine
118 endef
119
120 define Package/quagga-babeld
121   $(call Package/quagga/Default)
122   DEPENDS+=+quagga-libzebra
123   TITLE:=Babel routing engine
124 endef
125
126 define Package/quagga-vtysh
127   $(call Package/quagga/Default)
128   DEPENDS+=+quagga-libzebra +libreadline +libncurses
129   TITLE:=integrated shell for Quagga routing software
130 endef
131
132 define Package/quagga-zebra/conffiles
133 /etc/quagga/zebra.conf
134 endef
135
136 define Package/quagga-bgpd/conffiles
137 /etc/quagga/bgpd.conf
138 endef
139
140 define Package/quagga-isisd/conffiles
141 /etc/quagga/isisd.conf
142 endef
143
144 define Package/quagga-ospfd/conffiles
145 /etc/quagga/ospfd.conf
146 endef
147
148 define Package/quagga-ospf6d/conffiles
149 /etc/quagga/ospf6d.conf
150 endef
151
152 define Package/quagga-ripd/conffiles
153 /etc/quagga/ripd.conf
154 endef
155
156 define Package/quagga-ripngd/conffiles
157 /etc/quagga/ripngd.conf
158 endef
159
160 define Package/quagga-babeld/conffiles
161 /etc/quagga/babeld.conf
162 endef
163
164 ifneq ($(SDK),)
165 CONFIG_PACKAGE_quagga-libzebra:=m
166 CONFIG_PACKAGE_quagga-libospf:=m
167 CONFIG_PACKAGE_quagga-watchquagga:=m
168 CONFIG_PACKAGE_quagga-zebra:=m
169 CONFIG_PACKAGE_quagga-bgpd:=m
170 CONFIG_PACKAGE_quagga-isisd:=m
171 CONFIG_PACKAGE_quagga-ospf6d:=m
172 CONFIG_PACKAGE_quagga-ripd:=m
173 CONFIG_PACKAGE_quagga-ripngd:=m
174 CONFIG_PACKAGE_quagga-babeld:=m
175 CONFIG_PACKAGE_quagga-vtysh:=m
176 endif
177
178 CONFIGURE_ARGS+= \
179         --localstatedir=/var/run/quagga \
180         --sysconfdir=/etc/quagga/ \
181         --enable-shared \
182         --disable-static \
183         --enable-user=network \
184         --enable-group=network \
185         --enable-pie=no \
186         --enable-multipath=8 \
187         --disable-ospfclient \
188         --disable-capabilities \
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))