2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
14 PKG_MD5SUM
:=b0d4132039953a0214256873b7d23d68
16 PKG_SOURCE_URL
:=http
://www.quagga.net
/download
/ \
17 http
://www.de.quagga.net
/download
/ \
18 http
://www.uk.quagga.net
/download
/
19 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
20 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
22 include $(INCLUDE_DIR
)/package.mk
24 define Package
/quagga
/Default
28 TITLE
:=The Quagga Software Routing Suite
29 URL
:=http
://www.quagga.net
33 $(call Package
/quagga
/Default
)
38 define Package
/quagga
/description
39 A routing software package that provides TCP
/IP based routing services
40 with routing protocols support such
as RIPv1
, RIPv2
, RIPng
, OSPFv2
,
41 OSPFv3
, BGP-4
, and BGP-4
+
45 define Package
/quagga-libzebra
46 $(call Package
/quagga
/Default
)
50 define Package
/quagga-libospf
51 $(call Package
/quagga
/Default
)
55 define Package
/quagga-bgpd
56 $(call Package
/quagga
/Default
)
57 DEPENDS
+= quagga-libzebra
58 TITLE
:=BGPv4
, BGPv4
+, BGPv4- routing engine
61 define Package
/quagga-isisd
62 $(call Package
/quagga
/Default
)
63 TITLE
:=IS-IS routing engine
66 define Package
/quagga-ospfd
67 $(call Package
/quagga
/Default
)
68 DEPENDS
+= quagga-libospf quagga-libzebra
69 TITLE
:=OSPFv2 routing engine
72 define Package
/quagga-ospf6d
73 $(call Package
/quagga
/Default
)
74 DEPENDS
+= quagga-libospf quagga-libzebra
75 TITLE
:=OSPFv3 routing engine
78 define Package
/quagga-ripd
79 $(call Package
/quagga
/Default
)
80 DEPENDS
+= quagga-libzebra
81 TITLE
:=RIP routing engine
84 define Package
/quagga-ripngd
85 $(call Package
/quagga
/Default
)
86 DEPENDS
+= quagga-libzebra
87 TITLE
:=RIPNG routing engine
90 define Package
/quagga-vtysh
91 $(call Package
/quagga
/Default
)
92 DEPENDS
+= quagga-libzebra
+libreadline
+libncurses
93 TITLE
:=integrated
shell for Quagga routing software
96 define Build
/Configure
97 $(call Build
/Configure
/Default
, \
98 --localstatedir
=/var
/run
/quagga \
99 --sysconfdir
=/etc
/quagga
/ \
104 --enable-user
=quagga \
105 --enable-group
=quagga \
106 --enable-multipath
=8 \
112 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
113 DESTDIR
=$(PKG_INSTALL_DIR
) \
117 define Package
/quagga
/install
118 $(INSTALL_DIR
) $(1)/usr
/sbin
119 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/zebra
$(1)/usr
/sbin
/
120 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/watchquagga
$(1)/usr
/sbin
/
121 # avoid /etc being set to 0750
122 $(INSTALL_DIR
) $(1)/etc
/quagga
/
123 chmod
0750 $(1)/etc
/quagga
/
124 $(INSTALL_DIR
) $(1)/etc
/init.d
/
125 $(INSTALL_BIN
) .
/files
/quagga
$(1)/usr
/sbin
/quagga.init
126 $(INSTALL_BIN
) .
/files
/quagga.init
$(1)/etc
/init.d
/quagga
127 $(INSTALL_DIR
) $(1)/var
/run
/quagga
130 define Package
/quagga
/postinst
136 # do not change below
137 # check if we are on real system
138 if
[ -z
"$${IPKG_INSTROOT}" ]; then
139 # create copies of passwd and group, if we use squashfs
140 rootfs
=`mount |awk '/root/ { print $$5 }'`
141 if
[ "$$rootfs" = "squashfs" ]; then
142 if
[ -h
/etc
/group
]; then
144 cp
/rom
/etc
/group
/etc
/group
146 if
[ -h
/etc
/passwd
]; then
148 cp
/rom
/etc
/passwd
/etc
/passwd
154 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
155 echo
"adding group $$name to /etc/group"
156 echo
"$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc
/group
159 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
160 echo
"adding user $$name to /etc/passwd"
161 echo
"$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc
/passwd
164 grep
-q
'^zebra[[:space:]]*2601/tcp' $${IPKG_INSTROOT}/etc
/services
2>/dev
/null
165 if
[ $$?
-ne
0 ]; then
166 echo
"zebrasrv 2600/tcp" >>$${IPKG_INSTROOT}/etc
/services
167 echo
"zebra 2601/tcp" >>$${IPKG_INSTROOT}/etc
/services
168 echo
"ripd 2602/tcp" >>$${IPKG_INSTROOT}/etc
/services
169 echo
"ripngd 2603/tcp" >>$${IPKG_INSTROOT}/etc
/services
170 echo
"ospfd 2604/tcp" >>$${IPKG_INSTROOT}/etc
/services
171 echo
"bgpd 2605/tcp" >>$${IPKG_INSTROOT}/etc
/services
172 echo
"ospf6d 2606/tcp" >>$${IPKG_INSTROOT}/etc
/services
173 echo
"ospfapi 2607/tcp" >>$${IPKG_INSTROOT}/etc
/services
174 echo
"isisd 2608/tcp" >>$${IPKG_INSTROOT}/etc
/services
178 define Package
/quagga-bgpd
/install
179 $(INSTALL_DIR
) $(1)/usr
/sbin
180 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/bgpd
$(1)/usr
/sbin
/
183 define Package
/quagga-isisd
/install
184 $(INSTALL_DIR
) $(1)/usr
/sbin
185 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/isisd
$(1)/usr
/sbin
188 define Package
/quagga-ospfd
/install
189 $(INSTALL_DIR
) $(1)/usr
/sbin
190 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ospfd
$(1)/usr
/sbin
/
193 define Package
/quagga-ospf6d
/install
194 $(INSTALL_DIR
) $(1)/usr
/sbin
195 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ospf6d
$(1)/usr
/sbin
/
198 define Package
/quagga-ripd
/install
199 $(INSTALL_DIR
) $(1)/usr
/sbin
200 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ripd
$(1)/usr
/sbin
/
203 define Package
/quagga-ripngd
/install
204 $(INSTALL_DIR
) $(1)/usr
/sbin
205 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/ripngd
$(1)/usr
/sbin
/
208 define Package
/quagga-vtysh
/install
209 $(INSTALL_DIR
) $(1)/usr
/bin
210 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/vtysh
$(1)/usr
/bin
/
213 define Package
/quagga-libospf
/install
214 $(INSTALL_DIR
) $(1)/usr
/lib
215 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libospf.so.
* $(1)/usr
/lib
/
218 define Package
/quagga-libzebra
/install
219 $(INSTALL_DIR
) $(1)/usr
/lib
220 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libzebra.so.
* $(1)/usr
/lib
223 $(eval
$(call BuildPackage
,quagga
))
224 $(eval
$(call BuildPackage
,quagga-libzebra
))
225 $(eval
$(call BuildPackage
,quagga-libospf
))
226 $(eval
$(call BuildPackage
,quagga-bgpd
))
227 $(eval
$(call BuildPackage
,quagga-isisd
))
228 $(eval
$(call BuildPackage
,quagga-ospfd
))
229 $(eval
$(call BuildPackage
,quagga-ospf6d
))
230 $(eval
$(call BuildPackage
,quagga-ripd
))
231 $(eval
$(call BuildPackage
,quagga-ripngd
))
232 $(eval
$(call BuildPackage
,quagga-vtysh
))