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
24 include $(INCLUDE_DIR)/package.mk
26 define Package/quagga/Default
30 TITLE:=The Quagga Software Routing Suite
31 URL:=http://www.quagga.net
35 $(call Package/quagga/Default)
40 define Package/quagga/description
41 A routing software package that provides TCP/IP based routing services
42 with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2,
43 OSPFv3, BGP-4, and BGP-4+
46 define Package/quagga-libzebra
47 $(call Package/quagga/Default)
51 define Package/quagga-libospf
52 $(call Package/quagga/Default)
56 define Package/quagga-bgpd
57 $(call Package/quagga/Default)
58 DEPENDS += quagga-libzebra
59 TITLE:=BGPv4, BGPv4+, BGPv4- routing engine
62 define Package/quagga-isisd
63 $(call Package/quagga/Default)
64 TITLE:=IS-IS routing engine
67 define Package/quagga-ospfd
68 $(call Package/quagga/Default)
69 DEPENDS += quagga-libospf quagga-libzebra
70 TITLE:=OSPFv2 routing engine
73 define Package/quagga-ospf6d
74 $(call Package/quagga/Default)
75 DEPENDS += quagga-libospf quagga-libzebra @IPV6
76 TITLE:=OSPFv3 routing engine
79 define Package/quagga-ripd
80 $(call Package/quagga/Default)
81 DEPENDS += quagga-libzebra
82 TITLE:=RIP routing engine
85 define Package/quagga-ripngd
86 $(call Package/quagga/Default)
87 DEPENDS += quagga-libzebra @BROKEN
88 TITLE:=RIPNG routing engine
91 define Package/quagga-vtysh
92 $(call Package/quagga/Default)
93 DEPENDS += quagga-libzebra +libreadline +libncurses
94 TITLE:=integrated shell for Quagga routing software
98 --localstatedir=/var/run/quagga \
99 --sysconfdir=/etc/quagga/ \
103 --enable-user=quagga \
104 --enable-group=quagga \
105 --enable-multipath=8 \
107 ifneq ($(CONFIG_PACKAGE_quagga-isisd),)
108 CONFIGURE_ARGS+= --enable-isisd
111 ifneq ($(CONFIG_PACKAGE_quagga-ripngd),)
112 CONFIGURE_ARGS+= --enable-ripngd
116 $(MAKE) -C $(PKG_BUILD_DIR) \
117 DESTDIR=$(PKG_INSTALL_DIR) \
121 define Package/quagga/install
122 $(INSTALL_DIR) $(1)/usr/sbin
123 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zebra $(1)/usr/sbin/
124 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/watchquagga $(1)/usr/sbin/
125 # avoid /etc being set to 0750
126 $(INSTALL_DIR) $(1)/etc/quagga
127 chmod 0750 $(1)/etc/quagga
128 $(INSTALL_DATA) ./files/quagga.conf $(1)/etc/quagga/zebra.conf
129 $(INSTALL_DIR) $(1)/etc/init.d
130 $(INSTALL_BIN) ./files/quagga $(1)/usr/sbin/quagga.init
131 $(INSTALL_BIN) ./files/quagga.init $(1)/etc/init.d/quagga
134 define Package/quagga/postinst
140 # do not change below
141 # check if we are on real system
142 if [ -z "$${IPKG_INSTROOT}" ]; then
143 # create copies of passwd and group, if we use squashfs
144 rootfs=`mount |awk '/root/ { print $$5 }'`
145 if [ "$$rootfs" = "squashfs" ]; then
146 if [ -h /etc/group ]; then
148 cp /rom/etc/group /etc/group
150 if [ -h /etc/passwd ]; then
152 cp /rom/etc/passwd /etc/passwd
158 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
159 echo "adding group $$name to /etc/group"
160 echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
163 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
164 echo "adding user $$name to /etc/passwd"
165 echo "$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc/passwd
168 grep -q '^zebra[[:space:]]*2601/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
169 if [ $$? -ne 0 ]; then
170 echo "zebrasrv 2600/tcp" >>$${IPKG_INSTROOT}/etc/services
171 echo "zebra 2601/tcp" >>$${IPKG_INSTROOT}/etc/services
172 echo "ripd 2602/tcp" >>$${IPKG_INSTROOT}/etc/services
173 echo "ripngd 2603/tcp" >>$${IPKG_INSTROOT}/etc/services
174 echo "ospfd 2604/tcp" >>$${IPKG_INSTROOT}/etc/services
175 echo "bgpd 2605/tcp" >>$${IPKG_INSTROOT}/etc/services
176 echo "ospf6d 2606/tcp" >>$${IPKG_INSTROOT}/etc/services
177 echo "ospfapi 2607/tcp" >>$${IPKG_INSTROOT}/etc/services
178 echo "isisd 2608/tcp" >>$${IPKG_INSTROOT}/etc/services
182 define Package/quagga-bgpd/install
183 $(INSTALL_DIR) $(1)/usr/sbin
184 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bgpd $(1)/usr/sbin/
185 $(INSTALL_DIR) $(1)/etc/quagga
186 chmod 0750 $(1)/etc/quagga
187 $(INSTALL_DATA) ./files/quagga.conf $(1)/etc/quagga/bgpd.conf
190 define Package/quagga-isisd/install
191 $(INSTALL_DIR) $(1)/usr/sbin
192 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/isisd $(1)/usr/sbin/
193 $(INSTALL_DIR) $(1)/etc/quagga
194 chmod 0750 $(1)/etc/quagga
195 $(INSTALL_DATA) ./files/quagga.conf $(1)/etc/quagga/isisd.conf
198 define Package/quagga-ospfd/install
199 $(INSTALL_DIR) $(1)/usr/sbin
200 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospfd $(1)/usr/sbin/
201 $(INSTALL_DIR) $(1)/etc/quagga
202 chmod 0750 $(1)/etc/quagga
203 $(INSTALL_DATA) ./files/quagga.conf $(1)/etc/quagga/ospfd.conf
206 define Package/quagga-ospf6d/install
207 $(INSTALL_DIR) $(1)/usr/sbin
208 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospf6d $(1)/usr/sbin/
209 $(INSTALL_DIR) $(1)/etc/quagga
210 chmod 0750 $(1)/etc/quagga
211 $(INSTALL_DATA) ./files/quagga.conf $(1)/etc/quagga/ospf6d.conf
214 define Package/quagga-ripd/install
215 $(INSTALL_DIR) $(1)/usr/sbin
216 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripd $(1)/usr/sbin/
217 $(INSTALL_DIR) $(1)/etc/quagga
218 chmod 0750 $(1)/etc/quagga
219 $(INSTALL_DATA) ./files/quagga.conf $(1)/etc/quagga/ripd.conf
222 define Package/quagga-ripngd/install
223 $(INSTALL_DIR) $(1)/usr/sbin
224 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripngd $(1)/usr/sbin/
225 $(INSTALL_DIR) $(1)/etc/quagga
226 chmod 0750 $(1)/etc/quagga
227 $(INSTALL_DATA) ./files/quagga.conf $(1)/etc/quagga/ripngd.conf
230 define Package/quagga-vtysh/install
231 $(INSTALL_DIR) $(1)/usr/bin
232 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/
235 define Package/quagga-libospf/install
236 $(INSTALL_DIR) $(1)/usr/lib
237 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(1)/usr/lib/
240 define Package/quagga-libzebra/install
241 $(INSTALL_DIR) $(1)/usr/lib
242 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(1)/usr/lib/
245 $(eval $(call BuildPackage,quagga))
246 $(eval $(call BuildPackage,quagga-libzebra))
247 $(eval $(call BuildPackage,quagga-libospf))
248 $(eval $(call BuildPackage,quagga-bgpd))
249 $(eval $(call BuildPackage,quagga-isisd))
250 $(eval $(call BuildPackage,quagga-ospfd))
251 $(eval $(call BuildPackage,quagga-ospf6d))
252 $(eval $(call BuildPackage,quagga-ripd))
253 $(eval $(call BuildPackage,quagga-ripngd))
254 $(eval $(call BuildPackage,quagga-vtysh))