9474a9e5afd983ed1f48cf4c51e97ae2a8b68b7d
[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:=5
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 @IPV6
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         --disable-doc \
190         $(call autoconf_bool,CONFIG_PACKAGE_quagga-libzebra,zebra) \
191         $(call autoconf_bool,CONFIG_PACKAGE_quagga-libospf,ospfd) \
192         $(call autoconf_bool,CONFIG_PACKAGE_quagga-bgpd,bgpd) \
193         $(call autoconf_bool,CONFIG_PACKAGE_quagga-isisd,isisd) \
194         $(call autoconf_bool,CONFIG_PACKAGE_quagga-ospf6d,ospf6d) \
195         $(call autoconf_bool,CONFIG_PACKAGE_quagga-ripd,ripd) \
196         $(call autoconf_bool,CONFIG_PACKAGE_quagga-ripngd,ripngd) \
197         $(call autoconf_bool,CONFIG_PACKAGE_quagga-babeld,babeld) \
198         $(call autoconf_bool,CONFIG_PACKAGE_quagga-vtysh,vtysh) \
199
200 MAKE_FLAGS += \
201         CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
202
203 define Package/quagga/install
204         $(INSTALL_DIR) $(1)/usr/sbin
205         $(INSTALL_BIN) ./files/quagga $(1)/usr/sbin/quagga.init
206         $(INSTALL_DIR) $(1)/etc/init.d
207         $(INSTALL_BIN) ./files/quagga.init $(1)/etc/init.d/quagga
208 endef
209
210 define Package/quagga-watchquagga/install
211         $(INSTALL_DIR) $(1)/usr/sbin
212         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/watchquagga $(1)/usr/sbin/
213 endef
214
215 define Package/quagga-zebra/install
216         $(INSTALL_DIR) $(1)/usr/sbin
217         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zebra $(1)/usr/sbin/
218         $(INSTALL_DIR) $(1)/etc/quagga
219         chmod 0750 $(1)/etc/quagga
220         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/zebra.conf
221 endef
222
223 define Package/quagga-bgpd/install
224         $(INSTALL_DIR) $(1)/usr/sbin
225         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bgpd $(1)/usr/sbin/
226         $(INSTALL_DIR) $(1)/etc/quagga
227         chmod 0750 $(1)/etc/quagga
228         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/bgpd.conf
229 endef
230
231 define Package/quagga-isisd/install
232         $(INSTALL_DIR) $(1)/usr/sbin
233         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/isisd $(1)/usr/sbin/
234         $(INSTALL_DIR) $(1)/etc/quagga
235         chmod 0750 $(1)/etc/quagga
236         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/isisd.conf
237 endef
238
239 define Package/quagga-ospfd/install
240         $(INSTALL_DIR) $(1)/usr/sbin
241         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospfd $(1)/usr/sbin/
242         $(INSTALL_DIR) $(1)/etc/quagga
243         chmod 0750 $(1)/etc/quagga
244         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospfd.conf
245 endef
246
247 define Package/quagga-ospf6d/install
248         $(INSTALL_DIR) $(1)/usr/sbin
249         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospf6d $(1)/usr/sbin/
250         $(INSTALL_DIR) $(1)/etc/quagga
251         chmod 0750 $(1)/etc/quagga
252         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospf6d.conf
253 endef
254
255 define Package/quagga-ripd/install
256         $(INSTALL_DIR) $(1)/usr/sbin
257         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripd $(1)/usr/sbin/
258         $(INSTALL_DIR) $(1)/etc/quagga
259         chmod 0750 $(1)/etc/quagga
260         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripd.conf
261 endef
262
263 define Package/quagga-ripngd/install
264         $(INSTALL_DIR) $(1)/usr/sbin
265         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripngd $(1)/usr/sbin/
266         $(INSTALL_DIR) $(1)/etc/quagga
267         chmod 0750 $(1)/etc/quagga
268         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripngd.conf
269 endef
270
271 define Package/quagga-babeld/install
272         $(INSTALL_DIR) $(1)/usr/sbin
273         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/babeld $(1)/usr/sbin/
274         $(INSTALL_DIR) $(1)/etc/quagga
275         chmod 0750 $(1)/etc/quagga
276         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/babeld.conf
277 endef
278
279 define Package/quagga-vtysh/install
280         $(INSTALL_DIR) $(1)/usr/bin
281         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/
282 endef
283
284 define Package/quagga-libospf/install
285         $(INSTALL_DIR) $(1)/usr/lib
286         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(1)/usr/lib/
287 endef
288
289 define Package/quagga-libzebra/install
290         $(INSTALL_DIR) $(1)/usr/lib
291         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(1)/usr/lib/
292 endef
293
294 $(eval $(call BuildPackage,quagga))
295 $(eval $(call BuildPackage,quagga-libzebra))
296 $(eval $(call BuildPackage,quagga-libospf))
297 $(eval $(call BuildPackage,quagga-watchquagga))
298 $(eval $(call BuildPackage,quagga-zebra))
299 $(eval $(call BuildPackage,quagga-bgpd))
300 $(eval $(call BuildPackage,quagga-isisd))
301 $(eval $(call BuildPackage,quagga-ospfd))
302 $(eval $(call BuildPackage,quagga-ospf6d))
303 $(eval $(call BuildPackage,quagga-ripd))
304 $(eval $(call BuildPackage,quagga-ripngd))
305 $(eval $(call BuildPackage,quagga-babeld))
306 $(eval $(call BuildPackage,quagga-vtysh))