[packages] Add missing libtool fixups
[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_PACKAGE_quagga-unstable-isisd \
22 CONFIG_PACKAGE_quagga-unstable-ripngd
23
24 PKG_FIXUP:=libtool
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/quagga/Default
29 SECTION:=net
30 CATEGORY:=Network
31 DEPENDS:=quagga
32 TITLE:=The Quagga Software Routing Suite
33 URL:=http://www.quagga.net
34 endef
35
36 define Package/quagga
37 $(call Package/quagga/Default)
38 DEPENDS:=
39 MENU:=1
40 endef
41
42 define Package/quagga/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-libzebra
49 $(call Package/quagga/Default)
50 TITLE:=zebra library
51 endef
52
53 define Package/quagga-libospf
54 $(call Package/quagga/Default)
55 TITLE:=OSPF library
56 endef
57
58 define Package/quagga-bgpd
59 $(call Package/quagga/Default)
60 DEPENDS += quagga-libzebra
61 TITLE:=BGPv4, BGPv4+, BGPv4- routing engine
62 endef
63
64 define Package/quagga-isisd
65 $(call Package/quagga/Default)
66 TITLE:=IS-IS routing engine
67 endef
68
69 define Package/quagga-ospfd
70 $(call Package/quagga/Default)
71 DEPENDS += quagga-libospf quagga-libzebra
72 TITLE:=OSPFv2 routing engine
73 endef
74
75 define Package/quagga-ospf6d
76 $(call Package/quagga/Default)
77 DEPENDS += quagga-libospf quagga-libzebra @IPV6
78 TITLE:=OSPFv3 routing engine
79 endef
80
81 define Package/quagga-ripd
82 $(call Package/quagga/Default)
83 DEPENDS += quagga-libzebra
84 TITLE:=RIP routing engine
85 endef
86
87 define Package/quagga-ripngd
88 $(call Package/quagga/Default)
89 DEPENDS += quagga-libzebra @BROKEN
90 TITLE:=RIPNG routing engine
91 endef
92
93 define Package/quagga-vtysh
94 $(call Package/quagga/Default)
95 DEPENDS += quagga-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-isisd),)
110 CONFIGURE_ARGS+= --enable-isisd
111 endif
112
113 ifneq ($(CONFIG_PACKAGE_quagga-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/install
124 $(INSTALL_DIR) $(1)/usr/sbin
125 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zebra $(1)/usr/sbin/
126 $(INSTALL_BIN) $(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/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-bgpd/install
185 $(INSTALL_DIR) $(1)/usr/sbin
186 $(INSTALL_BIN) $(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-isisd/install
193 $(INSTALL_DIR) $(1)/usr/sbin
194 $(INSTALL_BIN) $(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-ospfd/install
201 $(INSTALL_DIR) $(1)/usr/sbin
202 $(INSTALL_BIN) $(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-ospf6d/install
209 $(INSTALL_DIR) $(1)/usr/sbin
210 $(INSTALL_BIN) $(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-ripd/install
217 $(INSTALL_DIR) $(1)/usr/sbin
218 $(INSTALL_BIN) $(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-ripngd/install
225 $(INSTALL_DIR) $(1)/usr/sbin
226 $(INSTALL_BIN) $(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-vtysh/install
233 $(INSTALL_DIR) $(1)/usr/bin
234 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/
235 endef
236
237 define Package/quagga-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-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))
248 $(eval $(call BuildPackage,quagga-libzebra))
249 $(eval $(call BuildPackage,quagga-libospf))
250 $(eval $(call BuildPackage,quagga-bgpd))
251 $(eval $(call BuildPackage,quagga-isisd))
252 $(eval $(call BuildPackage,quagga-ospfd))
253 $(eval $(call BuildPackage,quagga-ospf6d))
254 $(eval $(call BuildPackage,quagga-ripd))
255 $(eval $(call BuildPackage,quagga-ripngd))
256 $(eval $(call BuildPackage,quagga-vtysh))