bb93f0113c206e9141f8501787fd4e115e6efeb9
[openwrt/svn-archive/archive.git] / net / quagga-unstable / Makefile
1 #
2 # Copyright (C) 2009-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=quagga-unstable
11 PKG_VERSION:=0.99.17
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=quagga-$(PKG_VERSION).tar.gz
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_MD5SUM:=37b9022adca04b03863d2d79787e643f
19
20 PKG_BUILD_PARALLEL:=1
21
22 PKG_BUILD_DIR:=$(BUILD_DIR)/quagga-$(PKG_VERSION)
23
24 PKG_CONFIG_DEPENDS:= \
25 CONFIG_PACKAGE_quagga-unstable-isisd \
26 CONFIG_PACKAGE_quagga-unstable-ripngd
27
28 PKG_INSTALL:=1
29
30 include $(INCLUDE_DIR)/package.mk
31
32 define Package/quagga-unstable/Default
33 SECTION:=net
34 CATEGORY:=Network
35 DEPENDS:=quagga-unstable
36 TITLE:=The Quagga Software Routing Suite
37 URL:=http://www.quagga.net
38 MAINTAINER:=Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr>
39 endef
40
41 define Package/quagga-unstable
42 $(call Package/quagga-unstable/Default)
43 DEPENDS:= +librt
44 MENU:=1
45 endef
46
47 define Package/quagga-unstable/description
48 A routing software package that provides TCP/IP based routing services
49 with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2,
50 OSPFv3, BGP-4, and BGP-4+
51 endef
52
53 define Package/quagga-unstable-libzebra
54 $(call Package/quagga-unstable/Default)
55 TITLE:=zebra library
56 endef
57
58 define Package/quagga-unstable-libospf
59 $(call Package/quagga-unstable/Default)
60 TITLE:=OSPF library
61 endef
62
63 define Package/quagga-unstable-bgpd
64 $(call Package/quagga-unstable/Default)
65 DEPENDS+= +quagga-unstable-libzebra
66 TITLE:=BGPv4, BGPv4+, BGPv4- routing engine
67 endef
68
69 define Package/quagga-unstable-isisd
70 $(call Package/quagga-unstable/Default)
71 TITLE:=IS-IS routing engine
72 endef
73
74 define Package/quagga-unstable-ospfd
75 $(call Package/quagga-unstable/Default)
76 DEPENDS+= +quagga-unstable-libospf +quagga-unstable-libzebra
77 TITLE:=OSPFv2 routing engine
78 endef
79
80 define Package/quagga-unstable-ospf6d
81 $(call Package/quagga-unstable/Default)
82 DEPENDS+= +quagga-unstable-libospf +quagga-unstable-libzebra @IPV6
83 TITLE:=OSPFv3 routing engine
84 endef
85
86 define Package/quagga-unstable-ripd
87 $(call Package/quagga-unstable/Default)
88 DEPENDS+= +quagga-unstable-libzebra
89 TITLE:=RIP routing engine
90 endef
91
92 define Package/quagga-unstable-ripngd
93 $(call Package/quagga-unstable/Default)
94 DEPENDS+= +quagga-unstable-libzebra @BROKEN
95 TITLE:=RIPNG routing engine
96 endef
97
98 define Package/quagga-unstable-vtysh
99 $(call Package/quagga-unstable/Default)
100 DEPENDS+= quagga-unstable-libzebra +libreadline +libncurses
101 TITLE:=integrated shell for Quagga routing software
102 endef
103
104 define Package/quagga-unstable/conffiles
105 /etc/quagga/zebra.conf
106 endef
107
108 define Package/quagga-unstable-bgpd/conffiles
109 /etc/quagga/bgpd.conf
110 endef
111
112 define Package/quagga-unstable-isisd/conffiles
113 /etc/quagga/isisd.conf
114 endef
115
116 define Package/quagga-unstable-ospfd/conffiles
117 /etc/quagga/ospfd.conf
118 endef
119
120 define Package/quagga-unstable-ospf6d/conffiles
121 /etc/quagga/ospf6d.conf
122 endef
123
124 define Package/quagga-unstable-ripd/conffiles
125 /etc/quagga/ripd.conf
126 endef
127
128 define Package/quagga-unstable-ripngd/conffiles
129 /etc/quagga/ripngd.conf
130 endef
131
132 CONFIGURE_ARGS+= \
133 --localstatedir=/var/run/quagga \
134 --sysconfdir=/etc/quagga/ \
135 --enable-shared \
136 --disable-static \
137 --enable-vtysh \
138 --enable-user=quagga \
139 --enable-group=quagga \
140 --enable-pie=no \
141 --enable-multipath=8 \
142
143 ifneq ($(CONFIG_PACKAGE_quagga-unstable-isisd),)
144 CONFIGURE_ARGS+= --enable-isisd
145 endif
146
147 ifneq ($(CONFIG_PACKAGE_quagga-unstable-ripngd),)
148 CONFIGURE_ARGS+= --enable-ripngd
149 endif
150
151 define Package/quagga-unstable/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
162 endef
163
164 define Package/quagga-unstable/postinst
165 #!/bin/sh
166
167 name=quagga
168 id=51
169
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
177 rm /etc/group
178 cp /rom/etc/group /etc/group
179 fi
180 if [ -h /etc/passwd ]; then
181 rm /etc/passwd
182 cp /rom/etc/passwd /etc/passwd
183 fi
184 fi
185 fi
186
187 echo ""
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
191 fi
192
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
196 fi
197
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
209 fi
210 endef
211
212 define Package/quagga-unstable-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
218 endef
219
220 define Package/quagga-unstable-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
226 endef
227
228 define Package/quagga-unstable-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
234 endef
235
236 define Package/quagga-unstable-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
242 endef
243
244 define Package/quagga-unstable-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
250 endef
251
252 define Package/quagga-unstable-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
258 endef
259
260 define Package/quagga-unstable-vtysh/install
261 $(INSTALL_DIR) $(1)/usr/bin
262 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/
263 endef
264
265 define Package/quagga-unstable-libospf/install
266 $(INSTALL_DIR) $(1)/usr/lib
267 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(1)/usr/lib/
268 endef
269
270 define Package/quagga-unstable-libzebra/install
271 $(INSTALL_DIR) $(1)/usr/lib
272 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(1)/usr/lib/
273 endef
274
275 $(eval $(call BuildPackage,quagga-unstable))
276 $(eval $(call BuildPackage,quagga-unstable-libzebra))
277 $(eval $(call BuildPackage,quagga-unstable-libospf))
278 $(eval $(call BuildPackage,quagga-unstable-bgpd))
279 #$(eval $(call BuildPackage,quagga-unstable-isisd))
280 $(eval $(call BuildPackage,quagga-unstable-ospfd))
281 #$(eval $(call BuildPackage,quagga-unstable-ospf6d))
282 $(eval $(call BuildPackage,quagga-unstable-ripd))
283 #$(eval $(call BuildPackage,quagga-unstable-ripngd))
284 $(eval $(call BuildPackage,quagga-unstable-vtysh))