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