2 # Copyright (C) 2006-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
11 ifneq ($(CONFIG_QUAGGA_OLD
),)
14 PKG_MD5SUM
:=b0d4132039953a0214256873b7d23d68
15 PATCH_DIR
:=.
/patches-old
19 PKG_MD5SUM
:=37b9022adca04b03863d2d79787e643f
22 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
23 PKG_SOURCE_URL
:=http
://www.quagga.net
/download
/ \
24 http
://www.de.quagga.net
/download
/ \
25 http
://www.uk.quagga.net
/download
/
26 PKG_CONFIG_DEPENDS
:= \
29 CONFIG_PACKAGE_quagga-libzebra \
30 CONFIG_PACKAGE_quagga-libospf \
31 CONFIG_PACKAGE_quagga-bgpd \
32 CONFIG_PACKAGE_quagga-isisd \
33 CONFIG_PACKAGE_quagga-ospf6d \
34 CONFIG_PACKAGE_quagga-ripd \
35 CONFIG_PACKAGE_quagga-ripngd \
36 CONFIG_PACKAGE_quagga-vtysh
41 include $(INCLUDE_DIR
)/package.mk
43 define Package
/quagga
/Default
47 TITLE
:=The Quagga Software Routing Suite
48 URL
:=http
://www.quagga.net
49 MAINTAINER
:=Vasilis Tsiligiannis
<b_tsiligiannis@silverton.gr
>
53 $(call Package
/quagga
/Default
)
54 DEPENDS
:=+!QUAGGA_OLD
:librt
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
+
64 define Package
/quagga
/config
66 depends on
(PACKAGE_quagga
&& BROKEN
)
68 bool
"Use the old release version 0.98.6"
70 This option allows you to select the old version of Quagga to be built.
73 define Package
/quagga-libzebra
74 $(call Package
/quagga
/Default
)
78 define Package
/quagga-libospf
79 $(call Package
/quagga
/Default
)
83 define Package
/quagga-bgpd
84 $(call Package
/quagga
/Default
)
85 DEPENDS
+=+quagga-libzebra
86 TITLE
:=BGPv4
, BGPv4
+, BGPv4- routing engine
89 define Package
/quagga-isisd
90 $(call Package
/quagga
/Default
)
91 TITLE
:=IS-IS routing engine
94 define Package
/quagga-ospfd
95 $(call Package
/quagga
/Default
)
96 DEPENDS
+=+quagga-libospf
+quagga-libzebra
97 TITLE
:=OSPFv2 routing engine
100 define Package
/quagga-ospf6d
101 $(call Package
/quagga
/Default
)
102 DEPENDS
+=+quagga-libospf
+quagga-libzebra @IPV6
103 TITLE
:=OSPFv3 routing engine
106 define Package
/quagga-ripd
107 $(call Package
/quagga
/Default
)
108 DEPENDS
+=+quagga-libzebra
109 TITLE
:=RIP routing engine
112 define Package
/quagga-ripngd
113 $(call Package
/quagga
/Default
)
114 DEPENDS
+=+quagga-libzebra @IPV6
115 TITLE
:=RIPNG routing engine
118 define Package
/quagga-vtysh
119 $(call Package
/quagga
/Default
)
120 DEPENDS
+=quagga-libzebra
+libreadline
+libncurses
121 TITLE
:=integrated
shell for Quagga routing software
124 define Package
/quagga
/conffiles
125 /etc
/quagga
/zebra.conf
128 define Package
/quagga-bgpd
/conffiles
129 /etc
/quagga
/bgpd.conf
132 define Package
/quagga-isisd
/conffiles
133 /etc
/quagga
/isisd.conf
136 define Package
/quagga-ospfd
/conffiles
137 /etc
/quagga
/ospfd.conf
140 define Package
/quagga-ospf6d
/conffiles
141 /etc
/quagga
/ospf6d.conf
144 define Package
/quagga-ripd
/conffiles
145 /etc
/quagga
/ripd.conf
148 define Package
/quagga-ripngd
/conffiles
149 /etc
/quagga
/ripngd.conf
153 CONFIG_PACKAGE_quagga-libzebra
:=m
154 CONFIG_PACKAGE_quagga-libospf
:=m
155 CONFIG_PACKAGE_quagga-bgpd
:=m
156 CONFIG_PACKAGE_quagga-isisd
:=m
157 CONFIG_PACKAGE_quagga-ospf6d
:=m
158 CONFIG_PACKAGE_quagga-ripd
:=m
159 CONFIG_PACKAGE_quagga-ripngd
:=m
160 CONFIG_PACKAGE_quagga-vtysh
:=m
163 TARGET_LDFLAGS
+= -lpthread
166 --localstatedir
=/var
/run
/quagga \
167 --sysconfdir
=/etc
/quagga
/ \
170 --enable-user
=quagga \
171 --enable-group
=quagga \
173 --enable-multipath
=8 \
174 $(call autoconf_bool
,CONFIG_PACKAGE_quagga-libzebra
,zebra
) \
175 $(call autoconf_bool
,CONFIG_PACKAGE_quagga-libospf
,ospfd
) \
176 $(call autoconf_bool
,CONFIG_PACKAGE_quagga-bgpd
,bgpd
) \
177 $(call autoconf_bool
,CONFIG_PACKAGE_quagga-isisd
,isisd
) \
178 $(call autoconf_bool
,CONFIG_PACKAGE_quagga-ospf6d
,ospf6d
) \
179 $(call autoconf_bool
,CONFIG_PACKAGE_quagga-ripd
,ripd
) \
180 $(call autoconf_bool
,CONFIG_PACKAGE_quagga-ripngd
,ripngd
) \
181 $(call autoconf_bool
,CONFIG_PACKAGE_quagga-vtysh
,vtysh
) \
184 CFLAGS
="$(TARGET_CFLAGS) -D_GNU_SOURCE"
186 define Build
/Configure
187 (cd
$(PKG_BUILD_DIR
); rm -rf config.
{cache
,status
}; \
190 $(call Build
/Configure
/Default
)
193 define Package
/quagga
/install
194 $(INSTALL_DIR
) $(1)/usr
/sbin
195 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/zebra
$(1)/usr
/sbin
/
196 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/watchquagga
$(1)/usr
/sbin
/
197 # avoid /etc being set to 0750
198 $(INSTALL_DIR
) $(1)/etc
/quagga
199 chmod
0750 $(1)/etc
/quagga
200 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/zebra.conf
201 $(INSTALL_DIR
) $(1)/etc
/init.d
202 $(INSTALL_BIN
) .
/files
/quagga
$(1)/usr
/sbin
/quagga.init
203 $(INSTALL_BIN
) .
/files
/quagga.init
$(1)/etc
/init.d
/quagga
206 define Package
/quagga
/postinst
212 # do not change below
213 # check if we are on real system
214 if
[ -z
"$${IPKG_INSTROOT}" ]; then
215 # create copies of passwd and group, if we use squashfs
216 rootfs
=`mount |awk '/root/ { print $$5 }'`
217 if
[ "$$rootfs" = "squashfs" ]; then
218 if
[ -h
/etc
/group
]; then
220 cp
/rom
/etc
/group
/etc
/group
222 if
[ -h
/etc
/passwd
]; then
224 cp
/rom
/etc
/passwd
/etc
/passwd
230 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
231 echo
"adding group $$name to /etc/group"
232 echo
"$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc
/group
235 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
236 echo
"adding user $$name to /etc/passwd"
237 echo
"$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc
/passwd
240 grep
-q
'^zebra[[:space:]]*2601/tcp' $${IPKG_INSTROOT}/etc
/services
2>/dev
/null
241 if
[ $$?
-ne
0 ]; then
242 echo
"zebrasrv 2600/tcp" >>$${IPKG_INSTROOT}/etc
/services
243 echo
"zebra 2601/tcp" >>$${IPKG_INSTROOT}/etc
/services
244 echo
"ripd 2602/tcp" >>$${IPKG_INSTROOT}/etc
/services
245 echo
"ripngd 2603/tcp" >>$${IPKG_INSTROOT}/etc
/services
246 echo
"ospfd 2604/tcp" >>$${IPKG_INSTROOT}/etc
/services
247 echo
"bgpd 2605/tcp" >>$${IPKG_INSTROOT}/etc
/services
248 echo
"ospf6d 2606/tcp" >>$${IPKG_INSTROOT}/etc
/services
249 echo
"ospfapi 2607/tcp" >>$${IPKG_INSTROOT}/etc
/services
250 echo
"isisd 2608/tcp" >>$${IPKG_INSTROOT}/etc
/services
254 define Package
/quagga-bgpd
/install
255 $(INSTALL_DIR
) $(1)/usr
/sbin
256 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/bgpd
$(1)/usr
/sbin
/
257 $(INSTALL_DIR
) $(1)/etc
/quagga
258 chmod
0750 $(1)/etc
/quagga
259 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/bgpd.conf
262 define Package
/quagga-isisd
/install
263 $(INSTALL_DIR
) $(1)/usr
/sbin
264 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/isisd
$(1)/usr
/sbin
/
265 $(INSTALL_DIR
) $(1)/etc
/quagga
266 chmod
0750 $(1)/etc
/quagga
267 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/isisd.conf
270 define Package
/quagga-ospfd
/install
271 $(INSTALL_DIR
) $(1)/usr
/sbin
272 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ospfd
$(1)/usr
/sbin
/
273 $(INSTALL_DIR
) $(1)/etc
/quagga
274 chmod
0750 $(1)/etc
/quagga
275 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/ospfd.conf
278 define Package
/quagga-ospf6d
/install
279 $(INSTALL_DIR
) $(1)/usr
/sbin
280 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ospf6d
$(1)/usr
/sbin
/
281 $(INSTALL_DIR
) $(1)/etc
/quagga
282 chmod
0750 $(1)/etc
/quagga
283 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/ospf6d.conf
286 define Package
/quagga-ripd
/install
287 $(INSTALL_DIR
) $(1)/usr
/sbin
288 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ripd
$(1)/usr
/sbin
/
289 $(INSTALL_DIR
) $(1)/etc
/quagga
290 chmod
0750 $(1)/etc
/quagga
291 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/ripd.conf
294 define Package
/quagga-ripngd
/install
295 $(INSTALL_DIR
) $(1)/usr
/sbin
296 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ripngd
$(1)/usr
/sbin
/
297 $(INSTALL_DIR
) $(1)/etc
/quagga
298 chmod
0750 $(1)/etc
/quagga
299 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/ripngd.conf
302 define Package
/quagga-vtysh
/install
303 $(INSTALL_DIR
) $(1)/usr
/bin
304 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/vtysh
$(1)/usr
/bin
/
307 define Package
/quagga-libospf
/install
308 $(INSTALL_DIR
) $(1)/usr
/lib
309 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libospf.so.
* $(1)/usr
/lib
/
312 define Package
/quagga-libzebra
/install
313 $(INSTALL_DIR
) $(1)/usr
/lib
314 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libzebra.so.
* $(1)/usr
/lib
/
317 $(eval
$(call BuildPackage
,quagga
))
318 $(eval
$(call BuildPackage
,quagga-libzebra
))
319 $(eval
$(call BuildPackage
,quagga-libospf
))
320 $(eval
$(call BuildPackage
,quagga-bgpd
))
321 $(eval
$(call BuildPackage
,quagga-isisd
))
322 $(eval
$(call BuildPackage
,quagga-ospfd
))
323 $(eval
$(call BuildPackage
,quagga-ospf6d
))
324 $(eval
$(call BuildPackage
,quagga-ripd
))
325 $(eval
$(call BuildPackage
,quagga-ripngd
))
326 $(eval
$(call BuildPackage
,quagga-vtysh
))