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-isisd \
30 CONFIG_PACKAGE_quagga-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
60 depends on (PACKAGE_quagga && BROKEN)
62 bool "Use the old release version 0.98.6"
64 This option allows you to select the old version of Quagga to be built.
67 define Package/quagga-libzebra
68 $(call Package/quagga/Default)
72 define Package/quagga-libospf
73 $(call Package/quagga/Default)
77 define Package/quagga-bgpd
78 $(call Package/quagga/Default)
79 DEPENDS+=+quagga-libzebra
80 TITLE:=BGPv4, BGPv4+, BGPv4- routing engine
83 define Package/quagga-isisd
84 $(call Package/quagga/Default)
85 TITLE:=IS-IS routing engine
88 define Package/quagga-ospfd
89 $(call Package/quagga/Default)
90 DEPENDS+=+quagga-libospf +quagga-libzebra
91 TITLE:=OSPFv2 routing engine
94 define Package/quagga-ospf6d
95 $(call Package/quagga/Default)
96 DEPENDS+=+quagga-libospf +quagga-libzebra @IPV6
97 TITLE:=OSPFv3 routing engine
100 define Package/quagga-ripd
101 $(call Package/quagga/Default)
102 DEPENDS+=+quagga-libzebra
103 TITLE:=RIP routing engine
106 define Package/quagga-ripngd
107 $(call Package/quagga/Default)
108 DEPENDS+=+quagga-libzebra @BROKEN
109 TITLE:=RIPNG routing engine
112 define Package/quagga-vtysh
113 $(call Package/quagga/Default)
114 DEPENDS+=quagga-libzebra +libreadline +libncurses
115 TITLE:=integrated shell for Quagga routing software
118 define Package/quagga/conffiles
119 /etc/quagga/zebra.conf
122 define Package/quagga-bgpd/conffiles
123 /etc/quagga/bgpd.conf
126 define Package/quagga-isisd/conffiles
127 /etc/quagga/isisd.conf
130 define Package/quagga-ospfd/conffiles
131 /etc/quagga/ospfd.conf
134 define Package/quagga-ospf6d/conffiles
135 /etc/quagga/ospf6d.conf
138 define Package/quagga-ripd/conffiles
139 /etc/quagga/ripd.conf
142 define Package/quagga-ripngd/conffiles
143 /etc/quagga/ripngd.conf
147 --localstatedir=/var/run/quagga \
148 --sysconfdir=/etc/quagga/ \
152 --enable-user=quagga \
153 --enable-group=quagga \
155 --enable-multipath=8 \
157 ifneq ($(CONFIG_PACKAGE_quagga-isisd),)
158 CONFIGURE_ARGS+= --enable-isisd
161 ifneq ($(CONFIG_PACKAGE_quagga-ripngd),)
162 CONFIGURE_ARGS+= --enable-ripngd
165 define Build/Configure
166 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
168 $(call Build/Configure/Default)
171 define Package/quagga/install
172 $(INSTALL_DIR) $(1)/usr/sbin
173 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zebra $(1)/usr/sbin/
174 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/watchquagga $(1)/usr/sbin/
175 # avoid /etc being set to 0750
176 $(INSTALL_DIR) $(1)/etc/quagga
177 chmod 0750 $(1)/etc/quagga
178 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/zebra.conf
179 $(INSTALL_DIR) $(1)/etc/init.d
180 $(INSTALL_BIN) ./files/quagga $(1)/usr/sbin/quagga.init
181 $(INSTALL_BIN) ./files/quagga.init $(1)/etc/init.d/quagga
184 define Package/quagga/postinst
190 # do not change below
191 # check if we are on real system
192 if [ -z "$${IPKG_INSTROOT}" ]; then
193 # create copies of passwd and group, if we use squashfs
194 rootfs=`mount |awk '/root/ { print $$5 }'`
195 if [ "$$rootfs" = "squashfs" ]; then
196 if [ -h /etc/group ]; then
198 cp /rom/etc/group /etc/group
200 if [ -h /etc/passwd ]; then
202 cp /rom/etc/passwd /etc/passwd
208 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
209 echo "adding group $$name to /etc/group"
210 echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
213 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
214 echo "adding user $$name to /etc/passwd"
215 echo "$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc/passwd
218 grep -q '^zebra[[:space:]]*2601/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
219 if [ $$? -ne 0 ]; then
220 echo "zebrasrv 2600/tcp" >>$${IPKG_INSTROOT}/etc/services
221 echo "zebra 2601/tcp" >>$${IPKG_INSTROOT}/etc/services
222 echo "ripd 2602/tcp" >>$${IPKG_INSTROOT}/etc/services
223 echo "ripngd 2603/tcp" >>$${IPKG_INSTROOT}/etc/services
224 echo "ospfd 2604/tcp" >>$${IPKG_INSTROOT}/etc/services
225 echo "bgpd 2605/tcp" >>$${IPKG_INSTROOT}/etc/services
226 echo "ospf6d 2606/tcp" >>$${IPKG_INSTROOT}/etc/services
227 echo "ospfapi 2607/tcp" >>$${IPKG_INSTROOT}/etc/services
228 echo "isisd 2608/tcp" >>$${IPKG_INSTROOT}/etc/services
232 define Package/quagga-bgpd/install
233 $(INSTALL_DIR) $(1)/usr/sbin
234 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bgpd $(1)/usr/sbin/
235 $(INSTALL_DIR) $(1)/etc/quagga
236 chmod 0750 $(1)/etc/quagga
237 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/bgpd.conf
240 define Package/quagga-isisd/install
241 $(INSTALL_DIR) $(1)/usr/sbin
242 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/isisd $(1)/usr/sbin/
243 $(INSTALL_DIR) $(1)/etc/quagga
244 chmod 0750 $(1)/etc/quagga
245 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/isisd.conf
248 define Package/quagga-ospfd/install
249 $(INSTALL_DIR) $(1)/usr/sbin
250 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospfd $(1)/usr/sbin/
251 $(INSTALL_DIR) $(1)/etc/quagga
252 chmod 0750 $(1)/etc/quagga
253 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospfd.conf
256 define Package/quagga-ospf6d/install
257 $(INSTALL_DIR) $(1)/usr/sbin
258 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospf6d $(1)/usr/sbin/
259 $(INSTALL_DIR) $(1)/etc/quagga
260 chmod 0750 $(1)/etc/quagga
261 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospf6d.conf
264 define Package/quagga-ripd/install
265 $(INSTALL_DIR) $(1)/usr/sbin
266 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripd $(1)/usr/sbin/
267 $(INSTALL_DIR) $(1)/etc/quagga
268 chmod 0750 $(1)/etc/quagga
269 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripd.conf
272 define Package/quagga-ripngd/install
273 $(INSTALL_DIR) $(1)/usr/sbin
274 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripngd $(1)/usr/sbin/
275 $(INSTALL_DIR) $(1)/etc/quagga
276 chmod 0750 $(1)/etc/quagga
277 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripngd.conf
280 define Package/quagga-vtysh/install
281 $(INSTALL_DIR) $(1)/usr/bin
282 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/
285 define Package/quagga-libospf/install
286 $(INSTALL_DIR) $(1)/usr/lib
287 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(1)/usr/lib/
290 define Package/quagga-libzebra/install
291 $(INSTALL_DIR) $(1)/usr/lib
292 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(1)/usr/lib/
295 $(eval $(call BuildPackage,quagga))
296 $(eval $(call BuildPackage,quagga-libzebra))
297 $(eval $(call BuildPackage,quagga-libospf))
298 $(eval $(call BuildPackage,quagga-bgpd))
299 $(eval $(call BuildPackage,quagga-isisd))
300 $(eval $(call BuildPackage,quagga-ospfd))
301 $(eval $(call BuildPackage,quagga-ospf6d))
302 $(eval $(call BuildPackage,quagga-ripd))
303 $(eval $(call BuildPackage,quagga-ripngd))
304 $(eval $(call BuildPackage,quagga-vtysh))