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:= \
27 CONFIG_QUAGGA_STABLE \
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
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}; \
163 $(call Build/Configure/Default)
166 define Package/quagga/install
167 $(INSTALL_DIR) $(1)/usr/sbin
168 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zebra $(1)/usr/sbin/
169 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/watchquagga $(1)/usr/sbin/
170 # avoid /etc being set to 0750
171 $(INSTALL_DIR) $(1)/etc/quagga
172 chmod 0750 $(1)/etc/quagga
173 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/zebra.conf
174 $(INSTALL_DIR) $(1)/etc/init.d
175 $(INSTALL_BIN) ./files/quagga $(1)/usr/sbin/quagga.init
176 $(INSTALL_BIN) ./files/quagga.init $(1)/etc/init.d/quagga
179 define Package/quagga/postinst
185 # do not change below
186 # check if we are on real system
187 if [ -z "$${IPKG_INSTROOT}" ]; then
188 # create copies of passwd and group, if we use squashfs
189 rootfs=`mount |awk '/root/ { print $$5 }'`
190 if [ "$$rootfs" = "squashfs" ]; then
191 if [ -h /etc/group ]; then
193 cp /rom/etc/group /etc/group
195 if [ -h /etc/passwd ]; then
197 cp /rom/etc/passwd /etc/passwd
203 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
204 echo "adding group $$name to /etc/group"
205 echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
208 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
209 echo "adding user $$name to /etc/passwd"
210 echo "$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc/passwd
213 grep -q '^zebra[[:space:]]*2601/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
214 if [ $$? -ne 0 ]; then
215 echo "zebrasrv 2600/tcp" >>$${IPKG_INSTROOT}/etc/services
216 echo "zebra 2601/tcp" >>$${IPKG_INSTROOT}/etc/services
217 echo "ripd 2602/tcp" >>$${IPKG_INSTROOT}/etc/services
218 echo "ripngd 2603/tcp" >>$${IPKG_INSTROOT}/etc/services
219 echo "ospfd 2604/tcp" >>$${IPKG_INSTROOT}/etc/services
220 echo "bgpd 2605/tcp" >>$${IPKG_INSTROOT}/etc/services
221 echo "ospf6d 2606/tcp" >>$${IPKG_INSTROOT}/etc/services
222 echo "ospfapi 2607/tcp" >>$${IPKG_INSTROOT}/etc/services
223 echo "isisd 2608/tcp" >>$${IPKG_INSTROOT}/etc/services
227 define Package/quagga-bgpd/install
228 $(INSTALL_DIR) $(1)/usr/sbin
229 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bgpd $(1)/usr/sbin/
230 $(INSTALL_DIR) $(1)/etc/quagga
231 chmod 0750 $(1)/etc/quagga
232 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/bgpd.conf
235 define Package/quagga-isisd/install
236 $(INSTALL_DIR) $(1)/usr/sbin
237 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/isisd $(1)/usr/sbin/
238 $(INSTALL_DIR) $(1)/etc/quagga
239 chmod 0750 $(1)/etc/quagga
240 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/isisd.conf
243 define Package/quagga-ospfd/install
244 $(INSTALL_DIR) $(1)/usr/sbin
245 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospfd $(1)/usr/sbin/
246 $(INSTALL_DIR) $(1)/etc/quagga
247 chmod 0750 $(1)/etc/quagga
248 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospfd.conf
251 define Package/quagga-ospf6d/install
252 $(INSTALL_DIR) $(1)/usr/sbin
253 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospf6d $(1)/usr/sbin/
254 $(INSTALL_DIR) $(1)/etc/quagga
255 chmod 0750 $(1)/etc/quagga
256 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospf6d.conf
259 define Package/quagga-ripd/install
260 $(INSTALL_DIR) $(1)/usr/sbin
261 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripd $(1)/usr/sbin/
262 $(INSTALL_DIR) $(1)/etc/quagga
263 chmod 0750 $(1)/etc/quagga
264 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripd.conf
267 define Package/quagga-ripngd/install
268 $(INSTALL_DIR) $(1)/usr/sbin
269 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripngd $(1)/usr/sbin/
270 $(INSTALL_DIR) $(1)/etc/quagga
271 chmod 0750 $(1)/etc/quagga
272 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripngd.conf
275 define Package/quagga-vtysh/install
276 $(INSTALL_DIR) $(1)/usr/bin
277 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/
280 define Package/quagga-libospf/install
281 $(INSTALL_DIR) $(1)/usr/lib
282 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(1)/usr/lib/
285 define Package/quagga-libzebra/install
286 $(INSTALL_DIR) $(1)/usr/lib
287 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(1)/usr/lib/
290 $(eval $(call BuildPackage,quagga))
291 $(eval $(call BuildPackage,quagga-libzebra))
292 $(eval $(call BuildPackage,quagga-libospf))
293 $(eval $(call BuildPackage,quagga-bgpd))
294 $(eval $(call BuildPackage,quagga-isisd))
295 $(eval $(call BuildPackage,quagga-ospfd))
296 $(eval $(call BuildPackage,quagga-ospf6d))
297 $(eval $(call BuildPackage,quagga-ripd))
298 $(eval $(call BuildPackage,quagga-ripngd))
299 $(eval $(call BuildPackage,quagga-vtysh))