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