[packages] quagga: Package babeld daemon
[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:=2
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-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
34 include $(INCLUDE_DIR)/package.mk
35
36 define Package/quagga/Default
37   SECTION:=net
38   CATEGORY:=Network
39   SUBMENU:=Routing and Redirection
40   DEPENDS:=quagga
41   TITLE:=The Quagga Software Routing Suite
42   URL:=http://www.quagga.net
43   MAINTAINER:=Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr>
44 endef
45
46 define Package/quagga
47   $(call Package/quagga/Default)
48   DEPENDS:=+librt
49   MENU:=1
50 endef
51
52 define Package/quagga/description
53   A routing software package that provides TCP/IP based routing services
54   with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2,
55   OSPFv3, BGP-4, and BGP-4+
56 endef
57
58 define Package/quagga-libzebra
59   $(call Package/quagga/Default)
60   TITLE:=zebra library
61 endef
62
63 define Package/quagga-libospf
64   $(call Package/quagga/Default)
65   TITLE:=OSPF library
66 endef
67
68 define Package/quagga-bgpd
69   $(call Package/quagga/Default)
70   DEPENDS+=+quagga-libzebra
71   TITLE:=BGPv4, BGPv4+, BGPv4- routing engine
72 endef
73
74 define Package/quagga-isisd
75   $(call Package/quagga/Default)
76   TITLE:=IS-IS routing engine
77 endef
78
79 define Package/quagga-ospfd
80   $(call Package/quagga/Default)
81   DEPENDS+=+quagga-libospf +quagga-libzebra
82   TITLE:=OSPFv2 routing engine
83 endef
84
85 define Package/quagga-ospf6d
86   $(call Package/quagga/Default)
87   DEPENDS+=+quagga-libospf +quagga-libzebra @IPV6
88   TITLE:=OSPFv3 routing engine
89 endef
90
91 define Package/quagga-ripd
92   $(call Package/quagga/Default)
93   DEPENDS+=+quagga-libzebra
94   TITLE:=RIP routing engine
95 endef
96
97 define Package/quagga-ripngd
98   $(call Package/quagga/Default)
99   DEPENDS+=+quagga-libzebra @IPV6
100   TITLE:=RIPNG routing engine
101 endef
102
103 define Package/quagga-babeld
104   $(call Package/quagga/Default)
105   DEPENDS+=+quagga-libzebra
106   TITLE:=Babel routing engine
107 endef
108
109 define Package/quagga-vtysh
110   $(call Package/quagga/Default)
111   DEPENDS+=quagga-libzebra +libreadline +libncurses
112   TITLE:=integrated shell for Quagga routing software
113 endef
114
115 define Package/quagga/conffiles
116 /etc/quagga/zebra.conf
117 endef
118
119 define Package/quagga-bgpd/conffiles
120 /etc/quagga/bgpd.conf
121 endef
122
123 define Package/quagga-isisd/conffiles
124 /etc/quagga/isisd.conf
125 endef
126
127 define Package/quagga-ospfd/conffiles
128 /etc/quagga/ospfd.conf
129 endef
130
131 define Package/quagga-ospf6d/conffiles
132 /etc/quagga/ospf6d.conf
133 endef
134
135 define Package/quagga-ripd/conffiles
136 /etc/quagga/ripd.conf
137 endef
138
139 define Package/quagga-ripngd/conffiles
140 /etc/quagga/ripngd.conf
141 endef
142
143 define Package/quagga-babeld/conffiles
144 /etc/quagga/babeld.conf
145 endef
146
147 ifneq ($(SDK),)
148 CONFIG_PACKAGE_quagga-libzebra:=m
149 CONFIG_PACKAGE_quagga-libospf:=m
150 CONFIG_PACKAGE_quagga-bgpd:=m
151 CONFIG_PACKAGE_quagga-isisd:=m
152 CONFIG_PACKAGE_quagga-ospf6d:=m
153 CONFIG_PACKAGE_quagga-ripd:=m
154 CONFIG_PACKAGE_quagga-ripngd:=m
155 CONFIG_PACKAGE_quagga-babeld:=m
156 CONFIG_PACKAGE_quagga-vtysh:=m
157 endif
158
159 CONFIGURE_ARGS+= \
160         --localstatedir=/var/run/quagga \
161         --sysconfdir=/etc/quagga/ \
162         --enable-shared \
163         --disable-static \
164         --enable-user=network \
165         --enable-group=network \
166         --enable-pie=no \
167         --enable-multipath=8 \
168         --disable-ospfclient \
169         --disable-capabilities \
170         $(call autoconf_bool,CONFIG_PACKAGE_quagga-libzebra,zebra) \
171         $(call autoconf_bool,CONFIG_PACKAGE_quagga-libospf,ospfd) \
172         $(call autoconf_bool,CONFIG_PACKAGE_quagga-bgpd,bgpd) \
173         $(call autoconf_bool,CONFIG_PACKAGE_quagga-isisd,isisd) \
174         $(call autoconf_bool,CONFIG_PACKAGE_quagga-ospf6d,ospf6d) \
175         $(call autoconf_bool,CONFIG_PACKAGE_quagga-ripd,ripd) \
176         $(call autoconf_bool,CONFIG_PACKAGE_quagga-ripngd,ripngd) \
177         $(call autoconf_bool,CONFIG_PACKAGE_quagga-babeld,babeld) \
178         $(call autoconf_bool,CONFIG_PACKAGE_quagga-vtysh,vtysh) \
179
180 MAKE_FLAGS += \
181         CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
182
183 define Build/Configure
184         (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
185                 autoconf \
186         );
187         $(call Build/Configure/Default)
188 endef
189
190 define Package/quagga/install
191         $(INSTALL_DIR) $(1)/usr/sbin
192         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zebra $(1)/usr/sbin/
193         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/watchquagga $(1)/usr/sbin/
194         # avoid /etc being set to 0750
195         $(INSTALL_DIR) $(1)/etc/quagga
196         chmod 0750 $(1)/etc/quagga
197         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/zebra.conf
198         $(INSTALL_DIR) $(1)/etc/init.d
199         $(INSTALL_BIN) ./files/quagga $(1)/usr/sbin/quagga.init
200         $(INSTALL_BIN) ./files/quagga.init $(1)/etc/init.d/quagga
201 endef
202
203 define Package/quagga-bgpd/install
204         $(INSTALL_DIR) $(1)/usr/sbin
205         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bgpd $(1)/usr/sbin/
206         $(INSTALL_DIR) $(1)/etc/quagga
207         chmod 0750 $(1)/etc/quagga
208         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/bgpd.conf
209 endef
210
211 define Package/quagga-isisd/install
212         $(INSTALL_DIR) $(1)/usr/sbin
213         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/isisd $(1)/usr/sbin/
214         $(INSTALL_DIR) $(1)/etc/quagga
215         chmod 0750 $(1)/etc/quagga
216         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/isisd.conf
217 endef
218
219 define Package/quagga-ospfd/install
220         $(INSTALL_DIR) $(1)/usr/sbin
221         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospfd $(1)/usr/sbin/
222         $(INSTALL_DIR) $(1)/etc/quagga
223         chmod 0750 $(1)/etc/quagga
224         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospfd.conf
225 endef
226
227 define Package/quagga-ospf6d/install
228         $(INSTALL_DIR) $(1)/usr/sbin
229         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospf6d $(1)/usr/sbin/
230         $(INSTALL_DIR) $(1)/etc/quagga
231         chmod 0750 $(1)/etc/quagga
232         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospf6d.conf
233 endef
234
235 define Package/quagga-ripd/install
236         $(INSTALL_DIR) $(1)/usr/sbin
237         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripd $(1)/usr/sbin/
238         $(INSTALL_DIR) $(1)/etc/quagga
239         chmod 0750 $(1)/etc/quagga
240         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripd.conf
241 endef
242
243 define Package/quagga-ripngd/install
244         $(INSTALL_DIR) $(1)/usr/sbin
245         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripngd $(1)/usr/sbin/
246         $(INSTALL_DIR) $(1)/etc/quagga
247         chmod 0750 $(1)/etc/quagga
248         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripngd.conf
249 endef
250
251 define Package/quagga-babeld/install
252         $(INSTALL_DIR) $(1)/usr/sbin
253         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/babeld $(1)/usr/sbin/
254         $(INSTALL_DIR) $(1)/etc/quagga
255         chmod 0750 $(1)/etc/quagga
256         $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/babeld.conf
257 endef
258
259 define Package/quagga-vtysh/install
260         $(INSTALL_DIR) $(1)/usr/bin
261         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/
262 endef
263
264 define Package/quagga-libospf/install
265         $(INSTALL_DIR) $(1)/usr/lib
266         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(1)/usr/lib/
267 endef
268
269 define Package/quagga-libzebra/install
270         $(INSTALL_DIR) $(1)/usr/lib
271         $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(1)/usr/lib/
272 endef
273
274 $(eval $(call BuildPackage,quagga))
275 $(eval $(call BuildPackage,quagga-libzebra))
276 $(eval $(call BuildPackage,quagga-libospf))
277 $(eval $(call BuildPackage,quagga-bgpd))
278 $(eval $(call BuildPackage,quagga-isisd))
279 $(eval $(call BuildPackage,quagga-ospfd))
280 $(eval $(call BuildPackage,quagga-ospf6d))
281 $(eval $(call BuildPackage,quagga-ripd))
282 $(eval $(call BuildPackage,quagga-ripngd))
283 $(eval $(call BuildPackage,quagga-babeld))
284 $(eval $(call BuildPackage,quagga-vtysh))