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
:=quagga-
$(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
:= \
27 CONFIG_QUAGGA_STABLE \
29 CONFIG_PACKAGE_quagga-unstable-isisd \
30 CONFIG_PACKAGE_quagga-unstable-ripngd
35 include $(INCLUDE_DIR
)/package.mk
37 define Package
/quagga
/Default
41 TITLE
:=The Quagga Software Routing Suite
42 URL
:=http
://www.quagga.net
43 MAINTAINER
:=Vasilis Tsiligiannis
<b_tsiligiannis@silverton.gr
>
47 $(call Package
/quagga
/Default
)
48 DEPENDS
:=+!QUAGGA_OLD
:librt
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
+
58 define Package
/quagga
/config
59 source
"$(SOURCE)/Config.in"
62 define Package
/quagga-libzebra
63 $(call Package
/quagga
/Default
)
67 define Package
/quagga-libospf
68 $(call Package
/quagga
/Default
)
72 define Package
/quagga-bgpd
73 $(call Package
/quagga
/Default
)
74 DEPENDS
+=+quagga-libzebra
75 TITLE
:=BGPv4
, BGPv4
+, BGPv4- routing engine
78 define Package
/quagga-isisd
79 $(call Package
/quagga
/Default
)
80 TITLE
:=IS-IS routing engine
83 define Package
/quagga-ospfd
84 $(call Package
/quagga
/Default
)
85 DEPENDS
+=+quagga-libospf
+quagga-libzebra
86 TITLE
:=OSPFv2 routing engine
89 define Package
/quagga-ospf6d
90 $(call Package
/quagga
/Default
)
91 DEPENDS
+=+quagga-libospf
+quagga-libzebra @IPV6
92 TITLE
:=OSPFv3 routing engine
95 define Package
/quagga-ripd
96 $(call Package
/quagga
/Default
)
97 DEPENDS
+=+quagga-libzebra
98 TITLE
:=RIP routing engine
101 define Package
/quagga-ripngd
102 $(call Package
/quagga
/Default
)
103 DEPENDS
+=+quagga-libzebra @BROKEN
104 TITLE
:=RIPNG routing engine
107 define Package
/quagga-vtysh
108 $(call Package
/quagga
/Default
)
109 DEPENDS
+=quagga-libzebra
+libreadline
+libncurses
110 TITLE
:=integrated
shell for Quagga routing software
113 define Package
/quagga
/conffiles
114 /etc
/quagga
/zebra.conf
117 define Package
/quagga-bgpd
/conffiles
118 /etc
/quagga
/bgpd.conf
121 define Package
/quagga-isisd
/conffiles
122 /etc
/quagga
/isisd.conf
125 define Package
/quagga-ospfd
/conffiles
126 /etc
/quagga
/ospfd.conf
129 define Package
/quagga-ospf6d
/conffiles
130 /etc
/quagga
/ospf6d.conf
133 define Package
/quagga-ripd
/conffiles
134 /etc
/quagga
/ripd.conf
137 define Package
/quagga-ripngd
/conffiles
138 /etc
/quagga
/ripngd.conf
142 --localstatedir
=/var
/run
/quagga \
143 --sysconfdir
=/etc
/quagga
/ \
147 --enable-user
=quagga \
148 --enable-group
=quagga \
150 --enable-multipath
=8 \
152 ifneq ($(CONFIG_PACKAGE_quagga-isisd
),)
153 CONFIGURE_ARGS
+= --enable-isisd
156 ifneq ($(CONFIG_PACKAGE_quagga-ripngd
),)
157 CONFIGURE_ARGS
+= --enable-ripngd
160 define Build
/Configure
161 (cd
$(PKG_BUILD_DIR
); rm -rf config.
{cache
,status
}; \
164 $(call Build
/Configure
/Default
)
167 define Package
/quagga
/install
168 $(INSTALL_DIR
) $(1)/usr
/sbin
169 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/zebra
$(1)/usr
/sbin
/
170 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/watchquagga
$(1)/usr
/sbin
/
171 # avoid /etc being set to 0750
172 $(INSTALL_DIR
) $(1)/etc
/quagga
173 chmod
0750 $(1)/etc
/quagga
174 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/zebra.conf
175 $(INSTALL_DIR
) $(1)/etc
/init.d
176 $(INSTALL_BIN
) .
/files
/quagga
$(1)/usr
/sbin
/quagga.init
177 $(INSTALL_BIN
) .
/files
/quagga.init
$(1)/etc
/init.d
/quagga
180 define Package
/quagga
/postinst
186 # do not change below
187 # check if we are on real system
188 if
[ -z
"$${IPKG_INSTROOT}" ]; then
189 # create copies of passwd and group, if we use squashfs
190 rootfs
=`mount |awk '/root/ { print $$5 }'`
191 if
[ "$$rootfs" = "squashfs" ]; then
192 if
[ -h
/etc
/group
]; then
194 cp
/rom
/etc
/group
/etc
/group
196 if
[ -h
/etc
/passwd
]; then
198 cp
/rom
/etc
/passwd
/etc
/passwd
204 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
205 echo
"adding group $$name to /etc/group"
206 echo
"$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc
/group
209 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
210 echo
"adding user $$name to /etc/passwd"
211 echo
"$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc
/passwd
214 grep
-q
'^zebra[[:space:]]*2601/tcp' $${IPKG_INSTROOT}/etc
/services
2>/dev
/null
215 if
[ $$?
-ne
0 ]; then
216 echo
"zebrasrv 2600/tcp" >>$${IPKG_INSTROOT}/etc
/services
217 echo
"zebra 2601/tcp" >>$${IPKG_INSTROOT}/etc
/services
218 echo
"ripd 2602/tcp" >>$${IPKG_INSTROOT}/etc
/services
219 echo
"ripngd 2603/tcp" >>$${IPKG_INSTROOT}/etc
/services
220 echo
"ospfd 2604/tcp" >>$${IPKG_INSTROOT}/etc
/services
221 echo
"bgpd 2605/tcp" >>$${IPKG_INSTROOT}/etc
/services
222 echo
"ospf6d 2606/tcp" >>$${IPKG_INSTROOT}/etc
/services
223 echo
"ospfapi 2607/tcp" >>$${IPKG_INSTROOT}/etc
/services
224 echo
"isisd 2608/tcp" >>$${IPKG_INSTROOT}/etc
/services
228 define Package
/quagga-bgpd
/install
229 $(INSTALL_DIR
) $(1)/usr
/sbin
230 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/bgpd
$(1)/usr
/sbin
/
231 $(INSTALL_DIR
) $(1)/etc
/quagga
232 chmod
0750 $(1)/etc
/quagga
233 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/bgpd.conf
236 define Package
/quagga-isisd
/install
237 $(INSTALL_DIR
) $(1)/usr
/sbin
238 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/isisd
$(1)/usr
/sbin
/
239 $(INSTALL_DIR
) $(1)/etc
/quagga
240 chmod
0750 $(1)/etc
/quagga
241 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/isisd.conf
244 define Package
/quagga-ospfd
/install
245 $(INSTALL_DIR
) $(1)/usr
/sbin
246 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ospfd
$(1)/usr
/sbin
/
247 $(INSTALL_DIR
) $(1)/etc
/quagga
248 chmod
0750 $(1)/etc
/quagga
249 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/ospfd.conf
252 define Package
/quagga-ospf6d
/install
253 $(INSTALL_DIR
) $(1)/usr
/sbin
254 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ospf6d
$(1)/usr
/sbin
/
255 $(INSTALL_DIR
) $(1)/etc
/quagga
256 chmod
0750 $(1)/etc
/quagga
257 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/ospf6d.conf
260 define Package
/quagga-ripd
/install
261 $(INSTALL_DIR
) $(1)/usr
/sbin
262 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ripd
$(1)/usr
/sbin
/
263 $(INSTALL_DIR
) $(1)/etc
/quagga
264 chmod
0750 $(1)/etc
/quagga
265 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/ripd.conf
268 define Package
/quagga-ripngd
/install
269 $(INSTALL_DIR
) $(1)/usr
/sbin
270 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ripngd
$(1)/usr
/sbin
/
271 $(INSTALL_DIR
) $(1)/etc
/quagga
272 chmod
0750 $(1)/etc
/quagga
273 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/ripngd.conf
276 define Package
/quagga-vtysh
/install
277 $(INSTALL_DIR
) $(1)/usr
/bin
278 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/vtysh
$(1)/usr
/bin
/
281 define Package
/quagga-libospf
/install
282 $(INSTALL_DIR
) $(1)/usr
/lib
283 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libospf.so.
* $(1)/usr
/lib
/
286 define Package
/quagga-libzebra
/install
287 $(INSTALL_DIR
) $(1)/usr
/lib
288 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libzebra.so.
* $(1)/usr
/lib
/
291 $(eval
$(call BuildPackage
,quagga
))
292 $(eval
$(call BuildPackage
,quagga-libzebra
))
293 $(eval
$(call BuildPackage
,quagga-libospf
))
294 $(eval
$(call BuildPackage
,quagga-bgpd
))
295 $(eval
$(call BuildPackage
,quagga-isisd
))
296 $(eval
$(call BuildPackage
,quagga-ospfd
))
297 $(eval
$(call BuildPackage
,quagga-ospf6d
))
298 $(eval
$(call BuildPackage
,quagga-ripd
))
299 $(eval
$(call BuildPackage
,quagga-ripngd
))
300 $(eval
$(call BuildPackage
,quagga-vtysh
))