[package] haproxy: fix blocking reload of service
[openwrt/svn-archive/archive.git] / net / quagga / Makefile
1 #
2 # Copyright (C) 2006-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
11 PKG_VERSION:=0.98.6
12 PKG_RELEASE:=5
13 PKG_MD5SUM:=b0d4132039953a0214256873b7d23d68
14
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
19
20 PKG_CONFIG_DEPENDS:= \
21 CONFIG_IPV6 \
22 CONFIG_PACKAGE_quagga-unstable-isisd \
23 CONFIG_PACKAGE_quagga-unstable-ripngd
24
25 PKG_FIXUP:=libtool
26 PKG_INSTALL:=1
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/quagga/Default
31 SECTION:=net
32 CATEGORY:=Network
33 DEPENDS:=quagga
34 TITLE:=The Quagga Software Routing Suite
35 URL:=http://www.quagga.net
36 MAINTAINER:=Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr>
37 endef
38
39 define Package/quagga
40 $(call Package/quagga/Default)
41 DEPENDS:=
42 MENU:=1
43 endef
44
45 define Package/quagga/description
46 A routing software package that provides TCP/IP based routing services
47 with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2,
48 OSPFv3, BGP-4, and BGP-4+
49 endef
50
51 define Package/quagga-libzebra
52 $(call Package/quagga/Default)
53 TITLE:=zebra library
54 endef
55
56 define Package/quagga-libospf
57 $(call Package/quagga/Default)
58 TITLE:=OSPF library
59 endef
60
61 define Package/quagga-bgpd
62 $(call Package/quagga/Default)
63 DEPENDS += quagga-libzebra
64 TITLE:=BGPv4, BGPv4+, BGPv4- routing engine
65 endef
66
67 define Package/quagga-isisd
68 $(call Package/quagga/Default)
69 TITLE:=IS-IS routing engine
70 endef
71
72 define Package/quagga-ospfd
73 $(call Package/quagga/Default)
74 DEPENDS += quagga-libospf quagga-libzebra
75 TITLE:=OSPFv2 routing engine
76 endef
77
78 define Package/quagga-ospf6d
79 $(call Package/quagga/Default)
80 DEPENDS += quagga-libospf quagga-libzebra @IPV6
81 TITLE:=OSPFv3 routing engine
82 endef
83
84 define Package/quagga-ripd
85 $(call Package/quagga/Default)
86 DEPENDS += quagga-libzebra
87 TITLE:=RIP routing engine
88 endef
89
90 define Package/quagga-ripngd
91 $(call Package/quagga/Default)
92 DEPENDS += quagga-libzebra @BROKEN
93 TITLE:=RIPNG routing engine
94 endef
95
96 define Package/quagga-vtysh
97 $(call Package/quagga/Default)
98 DEPENDS += quagga-libzebra +libreadline +libncurses
99 TITLE:=integrated shell for Quagga routing software
100 endef
101
102 define Package/quagga/conffiles
103 /etc/quagga/zebra.conf
104 endef
105
106 define Package/quagga-bgpd/conffiles
107 /etc/quagga/bgpd.conf
108 endef
109
110 define Package/quagga-isisd/conffiles
111 /etc/quagga/isisd.conf
112 endef
113
114 define Package/quagga-ospfd/conffiles
115 /etc/quagga/ospfd.conf
116 endef
117
118 define Package/quagga-ospf6d/conffiles
119 /etc/quagga/ospf6d.conf
120 endef
121
122 define Package/quagga-ripd/conffiles
123 /etc/quagga/ripd.conf
124 endef
125
126 define Package/quagga-ripngd/conffiles
127 /etc/quagga/ripngd.conf
128 endef
129
130 CONFIGURE_ARGS+= \
131 --localstatedir=/var/run/quagga \
132 --sysconfdir=/etc/quagga/ \
133 --enable-shared \
134 --disable-static \
135 --enable-vtysh \
136 --enable-user=quagga \
137 --enable-group=quagga \
138 --enable-multipath=8 \
139
140 ifneq ($(CONFIG_PACKAGE_quagga-isisd),)
141 CONFIGURE_ARGS+= --enable-isisd
142 endif
143
144 ifneq ($(CONFIG_PACKAGE_quagga-ripngd),)
145 CONFIGURE_ARGS+= --enable-ripngd
146 endif
147
148 define Package/quagga/install
149 $(INSTALL_DIR) $(1)/usr/sbin
150 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zebra $(1)/usr/sbin/
151 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/watchquagga $(1)/usr/sbin/
152 # avoid /etc being set to 0750
153 $(INSTALL_DIR) $(1)/etc/quagga
154 chmod 0750 $(1)/etc/quagga
155 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/zebra.conf
156 $(INSTALL_DIR) $(1)/etc/init.d
157 $(INSTALL_BIN) ./files/quagga $(1)/usr/sbin/quagga.init
158 $(INSTALL_BIN) ./files/quagga.init $(1)/etc/init.d/quagga
159 endef
160
161 define Package/quagga/postinst
162 #!/bin/sh
163
164 name=quagga
165 id=51
166
167 # do not change below
168 # check if we are on real system
169 if [ -z "$${IPKG_INSTROOT}" ]; then
170 # create copies of passwd and group, if we use squashfs
171 rootfs=`mount |awk '/root/ { print $$5 }'`
172 if [ "$$rootfs" = "squashfs" ]; then
173 if [ -h /etc/group ]; then
174 rm /etc/group
175 cp /rom/etc/group /etc/group
176 fi
177 if [ -h /etc/passwd ]; then
178 rm /etc/passwd
179 cp /rom/etc/passwd /etc/passwd
180 fi
181 fi
182 fi
183
184 echo ""
185 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
186 echo "adding group $$name to /etc/group"
187 echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
188 fi
189
190 if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
191 echo "adding user $$name to /etc/passwd"
192 echo "$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc/passwd
193 fi
194
195 grep -q '^zebra[[:space:]]*2601/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
196 if [ $$? -ne 0 ]; then
197 echo "zebrasrv 2600/tcp" >>$${IPKG_INSTROOT}/etc/services
198 echo "zebra 2601/tcp" >>$${IPKG_INSTROOT}/etc/services
199 echo "ripd 2602/tcp" >>$${IPKG_INSTROOT}/etc/services
200 echo "ripngd 2603/tcp" >>$${IPKG_INSTROOT}/etc/services
201 echo "ospfd 2604/tcp" >>$${IPKG_INSTROOT}/etc/services
202 echo "bgpd 2605/tcp" >>$${IPKG_INSTROOT}/etc/services
203 echo "ospf6d 2606/tcp" >>$${IPKG_INSTROOT}/etc/services
204 echo "ospfapi 2607/tcp" >>$${IPKG_INSTROOT}/etc/services
205 echo "isisd 2608/tcp" >>$${IPKG_INSTROOT}/etc/services
206 fi
207 endef
208
209 define Package/quagga-bgpd/install
210 $(INSTALL_DIR) $(1)/usr/sbin
211 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bgpd $(1)/usr/sbin/
212 $(INSTALL_DIR) $(1)/etc/quagga
213 chmod 0750 $(1)/etc/quagga
214 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/bgpd.conf
215 endef
216
217 define Package/quagga-isisd/install
218 $(INSTALL_DIR) $(1)/usr/sbin
219 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/isisd $(1)/usr/sbin/
220 $(INSTALL_DIR) $(1)/etc/quagga
221 chmod 0750 $(1)/etc/quagga
222 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/isisd.conf
223 endef
224
225 define Package/quagga-ospfd/install
226 $(INSTALL_DIR) $(1)/usr/sbin
227 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospfd $(1)/usr/sbin/
228 $(INSTALL_DIR) $(1)/etc/quagga
229 chmod 0750 $(1)/etc/quagga
230 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospfd.conf
231 endef
232
233 define Package/quagga-ospf6d/install
234 $(INSTALL_DIR) $(1)/usr/sbin
235 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospf6d $(1)/usr/sbin/
236 $(INSTALL_DIR) $(1)/etc/quagga
237 chmod 0750 $(1)/etc/quagga
238 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospf6d.conf
239 endef
240
241 define Package/quagga-ripd/install
242 $(INSTALL_DIR) $(1)/usr/sbin
243 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripd $(1)/usr/sbin/
244 $(INSTALL_DIR) $(1)/etc/quagga
245 chmod 0750 $(1)/etc/quagga
246 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripd.conf
247 endef
248
249 define Package/quagga-ripngd/install
250 $(INSTALL_DIR) $(1)/usr/sbin
251 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripngd $(1)/usr/sbin/
252 $(INSTALL_DIR) $(1)/etc/quagga
253 chmod 0750 $(1)/etc/quagga
254 $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripngd.conf
255 endef
256
257 define Package/quagga-vtysh/install
258 $(INSTALL_DIR) $(1)/usr/bin
259 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/
260 endef
261
262 define Package/quagga-libospf/install
263 $(INSTALL_DIR) $(1)/usr/lib
264 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(1)/usr/lib/
265 endef
266
267 define Package/quagga-libzebra/install
268 $(INSTALL_DIR) $(1)/usr/lib
269 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(1)/usr/lib/
270 endef
271
272 $(eval $(call BuildPackage,quagga))
273 $(eval $(call BuildPackage,quagga-libzebra))
274 $(eval $(call BuildPackage,quagga-libospf))
275 $(eval $(call BuildPackage,quagga-bgpd))
276 $(eval $(call BuildPackage,quagga-isisd))
277 $(eval $(call BuildPackage,quagga-ospfd))
278 $(eval $(call BuildPackage,quagga-ospf6d))
279 $(eval $(call BuildPackage,quagga-ripd))
280 $(eval $(call BuildPackage,quagga-ripngd))
281 $(eval $(call BuildPackage,quagga-vtysh))