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
37 $(call Package/quagga/Default)
42 define Package/quagga/description
43 A routing software package that provides TCP/IP based routing services
44 with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2,
45 OSPFv3, BGP-4, and BGP-4+
48 define Package/quagga-libzebra
49 $(call Package/quagga/Default)
53 define Package/quagga-libospf
54 $(call Package/quagga/Default)
58 define Package/quagga-bgpd
59 $(call Package/quagga/Default)
60 DEPENDS += quagga-libzebra
61 TITLE:=BGPv4, BGPv4+, BGPv4- routing engine
64 define Package/quagga-isisd
65 $(call Package/quagga/Default)
66 TITLE:=IS-IS routing engine
69 define Package/quagga-ospfd
70 $(call Package/quagga/Default)
71 DEPENDS += quagga-libospf quagga-libzebra
72 TITLE:=OSPFv2 routing engine
75 define Package/quagga-ospf6d
76 $(call Package/quagga/Default)
77 DEPENDS += quagga-libospf quagga-libzebra @IPV6
78 TITLE:=OSPFv3 routing engine
81 define Package/quagga-ripd
82 $(call Package/quagga/Default)
83 DEPENDS += quagga-libzebra
84 TITLE:=RIP routing engine
87 define Package/quagga-ripngd
88 $(call Package/quagga/Default)
89 DEPENDS += quagga-libzebra @BROKEN
90 TITLE:=RIPNG routing engine
93 define Package/quagga-vtysh
94 $(call Package/quagga/Default)
95 DEPENDS += quagga-libzebra +libreadline +libncurses
96 TITLE:=integrated shell for Quagga routing software
99 define Package/quagga/conffiles
100 /etc/quagga/zebra.conf
103 define Package/quagga-bgpd/conffiles
104 /etc/quagga/bgpd.conf
107 define Package/quagga-isisd/conffiles
108 /etc/quagga/isisd.conf
111 define Package/quagga-ospfd/conffiles
112 /etc/quagga/ospfd.conf
115 define Package/quagga-ospf6d/conffiles
116 /etc/quagga/ospf6d.conf
119 define Package/quagga-ripd/conffiles
120 /etc/quagga/ripd.conf
123 define Package/quagga-ripngd/conffiles
124 /etc/quagga/ripngd.conf
128 --localstatedir=/var/run/quagga \
129 --sysconfdir=/etc/quagga/ \
133 --enable-user=quagga \
134 --enable-group=quagga \
135 --enable-multipath=8 \
137 ifneq ($(CONFIG_PACKAGE_quagga-isisd),)
138 CONFIGURE_ARGS+= --enable-isisd
141 ifneq ($(CONFIG_PACKAGE_quagga-ripngd),)
142 CONFIGURE_ARGS+= --enable-ripngd
146 $(MAKE) -C $(PKG_BUILD_DIR) \
147 DESTDIR=$(PKG_INSTALL_DIR) \
151 define Package/quagga/install
152 $(INSTALL_DIR) $(1)/usr/sbin
153 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zebra $(1)/usr/sbin/
154 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/watchquagga $(1)/usr/sbin/
155 # avoid /etc being set to 0750
156 $(INSTALL_DIR) $(1)/etc/quagga
157 chmod 0750 $(1)/etc/quagga
158 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/zebra.conf
159 $(INSTALL_DIR) $(1)/etc/init.d
160 $(INSTALL_BIN) ./files/quagga $(1)/usr/sbin/quagga.init
161 $(INSTALL_BIN) ./files/quagga.init $(1)/etc/init.d/quagga
164 define Package/quagga/postinst
170 # do not change below
171 # check if we are on real system
172 if [ -z "$${IPKG_INSTROOT}" ]; then
173 # create copies of passwd and group, if we use squashfs
174 rootfs=`mount |awk '/root/ { print $$5 }'`
175 if [ "$$rootfs" = "squashfs" ]; then
176 if [ -h /etc/group ]; then
178 cp /rom/etc/group /etc/group
180 if [ -h /etc/passwd ]; then
182 cp /rom/etc/passwd /etc/passwd
188 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
189 echo "adding group $$name to /etc/group"
190 echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
193 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
194 echo "adding user $$name to /etc/passwd"
195 echo "$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc/passwd
198 grep -q '^zebra[[:space:]]*2601/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
199 if [ $$? -ne 0 ]; then
200 echo "zebrasrv 2600/tcp" >>$${IPKG_INSTROOT}/etc/services
201 echo "zebra 2601/tcp" >>$${IPKG_INSTROOT}/etc/services
202 echo "ripd 2602/tcp" >>$${IPKG_INSTROOT}/etc/services
203 echo "ripngd 2603/tcp" >>$${IPKG_INSTROOT}/etc/services
204 echo "ospfd 2604/tcp" >>$${IPKG_INSTROOT}/etc/services
205 echo "bgpd 2605/tcp" >>$${IPKG_INSTROOT}/etc/services
206 echo "ospf6d 2606/tcp" >>$${IPKG_INSTROOT}/etc/services
207 echo "ospfapi 2607/tcp" >>$${IPKG_INSTROOT}/etc/services
208 echo "isisd 2608/tcp" >>$${IPKG_INSTROOT}/etc/services
212 define Package/quagga-bgpd/install
213 $(INSTALL_DIR) $(1)/usr/sbin
214 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bgpd $(1)/usr/sbin/
215 $(INSTALL_DIR) $(1)/etc/quagga
216 chmod 0750 $(1)/etc/quagga
217 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/bgpd.conf
220 define Package/quagga-isisd/install
221 $(INSTALL_DIR) $(1)/usr/sbin
222 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/isisd $(1)/usr/sbin/
223 $(INSTALL_DIR) $(1)/etc/quagga
224 chmod 0750 $(1)/etc/quagga
225 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/isisd.conf
228 define Package/quagga-ospfd/install
229 $(INSTALL_DIR) $(1)/usr/sbin
230 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospfd $(1)/usr/sbin/
231 $(INSTALL_DIR) $(1)/etc/quagga
232 chmod 0750 $(1)/etc/quagga
233 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospfd.conf
236 define Package/quagga-ospf6d/install
237 $(INSTALL_DIR) $(1)/usr/sbin
238 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospf6d $(1)/usr/sbin/
239 $(INSTALL_DIR) $(1)/etc/quagga
240 chmod 0750 $(1)/etc/quagga
241 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospf6d.conf
244 define Package/quagga-ripd/install
245 $(INSTALL_DIR) $(1)/usr/sbin
246 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripd $(1)/usr/sbin/
247 $(INSTALL_DIR) $(1)/etc/quagga
248 chmod 0750 $(1)/etc/quagga
249 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripd.conf
252 define Package/quagga-ripngd/install
253 $(INSTALL_DIR) $(1)/usr/sbin
254 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripngd $(1)/usr/sbin/
255 $(INSTALL_DIR) $(1)/etc/quagga
256 chmod 0750 $(1)/etc/quagga
257 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripngd.conf
260 define Package/quagga-vtysh/install
261 $(INSTALL_DIR) $(1)/usr/bin
262 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/
265 define Package/quagga-libospf/install
266 $(INSTALL_DIR) $(1)/usr/lib
267 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(1)/usr/lib/
270 define Package/quagga-libzebra/install
271 $(INSTALL_DIR) $(1)/usr/lib
272 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(1)/usr/lib/
275 $(eval $(call BuildPackage,quagga))
276 $(eval $(call BuildPackage,quagga-libzebra))
277 $(eval $(call BuildPackage,quagga-libospf))
278 $(eval $(call BuildPackage,quagga-bgpd))
279 $(eval $(call BuildPackage,quagga-isisd))
280 $(eval $(call BuildPackage,quagga-ospfd))
281 $(eval $(call BuildPackage,quagga-ospf6d))
282 $(eval $(call BuildPackage,quagga-ripd))
283 $(eval $(call BuildPackage,quagga-ripngd))
284 $(eval $(call BuildPackage,quagga-vtysh))