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
13 PKG_MD5SUM
:=b0d4132039953a0214256873b7d23d68
15 PKG_SOURCE_URL
:=http
://www.quagga.net
/download
/ \
16 http
://www.de.quagga.net
/download
/ \
17 http
://www.uk.quagga.net
/download
/
18 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
20 PKG_CONFIG_DEPENDS
:= \
21 CONFIG_PACKAGE_quagga-unstable-isisd \
22 CONFIG_PACKAGE_quagga-unstable-ripngd
26 include $(INCLUDE_DIR
)/package.mk
28 define Package
/quagga
/Default
32 TITLE
:=The Quagga Software Routing Suite
33 URL
:=http
://www.quagga.net
34 MAINTAINER
:=Vasilis Tsiligiannis
<b_tsiligiannis@silverton.gr
>
38 $(call Package
/quagga
/Default
)
43 define Package
/quagga
/description
44 A routing software package that provides TCP
/IP based routing services
45 with routing protocols support such
as RIPv1
, RIPv2
, RIPng
, OSPFv2
,
46 OSPFv3
, BGP-4
, and BGP-4
+
49 define Package
/quagga-libzebra
50 $(call Package
/quagga
/Default
)
54 define Package
/quagga-libospf
55 $(call Package
/quagga
/Default
)
59 define Package
/quagga-bgpd
60 $(call Package
/quagga
/Default
)
61 DEPENDS
+= quagga-libzebra
62 TITLE
:=BGPv4
, BGPv4
+, BGPv4- routing engine
65 define Package
/quagga-isisd
66 $(call Package
/quagga
/Default
)
67 TITLE
:=IS-IS routing engine
70 define Package
/quagga-ospfd
71 $(call Package
/quagga
/Default
)
72 DEPENDS
+= quagga-libospf quagga-libzebra
73 TITLE
:=OSPFv2 routing engine
76 define Package
/quagga-ospf6d
77 $(call Package
/quagga
/Default
)
78 DEPENDS
+= quagga-libospf quagga-libzebra @IPV6
79 TITLE
:=OSPFv3 routing engine
82 define Package
/quagga-ripd
83 $(call Package
/quagga
/Default
)
84 DEPENDS
+= quagga-libzebra
85 TITLE
:=RIP routing engine
88 define Package
/quagga-ripngd
89 $(call Package
/quagga
/Default
)
90 DEPENDS
+= quagga-libzebra @BROKEN
91 TITLE
:=RIPNG routing engine
94 define Package
/quagga-vtysh
95 $(call Package
/quagga
/Default
)
96 DEPENDS
+= quagga-libzebra
+libreadline
+libncurses
97 TITLE
:=integrated
shell for Quagga routing software
100 define Package
/quagga
/conffiles
101 /etc
/quagga
/zebra.conf
104 define Package
/quagga-bgpd
/conffiles
105 /etc
/quagga
/bgpd.conf
108 define Package
/quagga-isisd
/conffiles
109 /etc
/quagga
/isisd.conf
112 define Package
/quagga-ospfd
/conffiles
113 /etc
/quagga
/ospfd.conf
116 define Package
/quagga-ospf6d
/conffiles
117 /etc
/quagga
/ospf6d.conf
120 define Package
/quagga-ripd
/conffiles
121 /etc
/quagga
/ripd.conf
124 define Package
/quagga-ripngd
/conffiles
125 /etc
/quagga
/ripngd.conf
129 --localstatedir
=/var
/run
/quagga \
130 --sysconfdir
=/etc
/quagga
/ \
134 --enable-user
=quagga \
135 --enable-group
=quagga \
136 --enable-multipath
=8 \
138 ifneq ($(CONFIG_PACKAGE_quagga-isisd
),)
139 CONFIGURE_ARGS
+= --enable-isisd
142 ifneq ($(CONFIG_PACKAGE_quagga-ripngd
),)
143 CONFIGURE_ARGS
+= --enable-ripngd
147 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
148 DESTDIR
=$(PKG_INSTALL_DIR
) \
152 define Package
/quagga
/install
153 $(INSTALL_DIR
) $(1)/usr
/sbin
154 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/zebra
$(1)/usr
/sbin
/
155 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/watchquagga
$(1)/usr
/sbin
/
156 # avoid /etc being set to 0750
157 $(INSTALL_DIR
) $(1)/etc
/quagga
158 chmod
0750 $(1)/etc
/quagga
159 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/zebra.conf
160 $(INSTALL_DIR
) $(1)/etc
/init.d
161 $(INSTALL_BIN
) .
/files
/quagga
$(1)/usr
/sbin
/quagga.init
162 $(INSTALL_BIN
) .
/files
/quagga.init
$(1)/etc
/init.d
/quagga
165 define Package
/quagga
/postinst
171 # do not change below
172 # check if we are on real system
173 if
[ -z
"$${IPKG_INSTROOT}" ]; then
174 # create copies of passwd and group, if we use squashfs
175 rootfs
=`mount |awk '/root/ { print $$5 }'`
176 if
[ "$$rootfs" = "squashfs" ]; then
177 if
[ -h
/etc
/group
]; then
179 cp
/rom
/etc
/group
/etc
/group
181 if
[ -h
/etc
/passwd
]; then
183 cp
/rom
/etc
/passwd
/etc
/passwd
189 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
190 echo
"adding group $$name to /etc/group"
191 echo
"$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc
/group
194 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
195 echo
"adding user $$name to /etc/passwd"
196 echo
"$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc
/passwd
199 grep
-q
'^zebra[[:space:]]*2601/tcp' $${IPKG_INSTROOT}/etc
/services
2>/dev
/null
200 if
[ $$?
-ne
0 ]; then
201 echo
"zebrasrv 2600/tcp" >>$${IPKG_INSTROOT}/etc
/services
202 echo
"zebra 2601/tcp" >>$${IPKG_INSTROOT}/etc
/services
203 echo
"ripd 2602/tcp" >>$${IPKG_INSTROOT}/etc
/services
204 echo
"ripngd 2603/tcp" >>$${IPKG_INSTROOT}/etc
/services
205 echo
"ospfd 2604/tcp" >>$${IPKG_INSTROOT}/etc
/services
206 echo
"bgpd 2605/tcp" >>$${IPKG_INSTROOT}/etc
/services
207 echo
"ospf6d 2606/tcp" >>$${IPKG_INSTROOT}/etc
/services
208 echo
"ospfapi 2607/tcp" >>$${IPKG_INSTROOT}/etc
/services
209 echo
"isisd 2608/tcp" >>$${IPKG_INSTROOT}/etc
/services
213 define Package
/quagga-bgpd
/install
214 $(INSTALL_DIR
) $(1)/usr
/sbin
215 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/bgpd
$(1)/usr
/sbin
/
216 $(INSTALL_DIR
) $(1)/etc
/quagga
217 chmod
0750 $(1)/etc
/quagga
218 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/bgpd.conf
221 define Package
/quagga-isisd
/install
222 $(INSTALL_DIR
) $(1)/usr
/sbin
223 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/isisd
$(1)/usr
/sbin
/
224 $(INSTALL_DIR
) $(1)/etc
/quagga
225 chmod
0750 $(1)/etc
/quagga
226 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/isisd.conf
229 define Package
/quagga-ospfd
/install
230 $(INSTALL_DIR
) $(1)/usr
/sbin
231 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ospfd
$(1)/usr
/sbin
/
232 $(INSTALL_DIR
) $(1)/etc
/quagga
233 chmod
0750 $(1)/etc
/quagga
234 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/ospfd.conf
237 define Package
/quagga-ospf6d
/install
238 $(INSTALL_DIR
) $(1)/usr
/sbin
239 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ospf6d
$(1)/usr
/sbin
/
240 $(INSTALL_DIR
) $(1)/etc
/quagga
241 chmod
0750 $(1)/etc
/quagga
242 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/ospf6d.conf
245 define Package
/quagga-ripd
/install
246 $(INSTALL_DIR
) $(1)/usr
/sbin
247 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ripd
$(1)/usr
/sbin
/
248 $(INSTALL_DIR
) $(1)/etc
/quagga
249 chmod
0750 $(1)/etc
/quagga
250 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/ripd.conf
253 define Package
/quagga-ripngd
/install
254 $(INSTALL_DIR
) $(1)/usr
/sbin
255 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ripngd
$(1)/usr
/sbin
/
256 $(INSTALL_DIR
) $(1)/etc
/quagga
257 chmod
0750 $(1)/etc
/quagga
258 $(INSTALL_CONF
) .
/files
/quagga.conf
$(1)/etc
/quagga
/ripngd.conf
261 define Package
/quagga-vtysh
/install
262 $(INSTALL_DIR
) $(1)/usr
/bin
263 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/vtysh
$(1)/usr
/bin
/
266 define Package
/quagga-libospf
/install
267 $(INSTALL_DIR
) $(1)/usr
/lib
268 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libospf.so.
* $(1)/usr
/lib
/
271 define Package
/quagga-libzebra
/install
272 $(INSTALL_DIR
) $(1)/usr
/lib
273 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libzebra.so.
* $(1)/usr
/lib
/
276 $(eval
$(call BuildPackage
,quagga
))
277 $(eval
$(call BuildPackage
,quagga-libzebra
))
278 $(eval
$(call BuildPackage
,quagga-libospf
))
279 $(eval
$(call BuildPackage
,quagga-bgpd
))
280 $(eval
$(call BuildPackage
,quagga-isisd
))
281 $(eval
$(call BuildPackage
,quagga-ospfd
))
282 $(eval
$(call BuildPackage
,quagga-ospf6d
))
283 $(eval
$(call BuildPackage
,quagga-ripd
))
284 $(eval
$(call BuildPackage
,quagga-ripngd
))
285 $(eval
$(call BuildPackage
,quagga-vtysh
))