source: packages/net/quagga-unstable/Makefile @ 23450

Last change on this file since 23450 was 23450, checked in by acoul, 6 years ago

net/quagga-unstable: Enable parallel build

File size: 8.1 KB
Line 
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
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=quagga-unstable
11PKG_VERSION:=0.99.17
12PKG_RELEASE:=1
13
14PKG_SOURCE:=quagga-$(PKG_VERSION).tar.gz
15PKG_SOURCE_URL:=http://www.quagga.net/download/ \
16                http://www.de.quagga.net/download/ \
17                http://www.uk.quagga.net/download/
18PKG_MD5SUM:=37b9022adca04b03863d2d79787e643f
19
20PKG_BUILD_PARALLEL:=1
21
22PKG_BUILD_DIR:=$(BUILD_DIR)/quagga-$(PKG_VERSION)
23
24PKG_CONFIG_DEPENDS:= \
25        CONFIG_PACKAGE_quagga-unstable-isisd \
26        CONFIG_PACKAGE_quagga-unstable-ripngd
27
28PKG_INSTALL:=1
29
30include $(INCLUDE_DIR)/package.mk
31
32define 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>
39endef
40
41define Package/quagga-unstable
42  $(call Package/quagga-unstable/Default)
43  DEPENDS:= +librt
44  MENU:=1
45endef
46
47define 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+
51endef
52
53define Package/quagga-unstable-libzebra
54  $(call Package/quagga-unstable/Default)
55  TITLE:=zebra library
56endef
57
58define Package/quagga-unstable-libospf
59  $(call Package/quagga-unstable/Default)
60  TITLE:=OSPF library
61endef
62
63define Package/quagga-unstable-bgpd
64  $(call Package/quagga-unstable/Default)
65  DEPENDS+= +quagga-unstable-libzebra
66  TITLE:=BGPv4, BGPv4+, BGPv4- routing engine
67endef
68
69define Package/quagga-unstable-isisd
70  $(call Package/quagga-unstable/Default)
71  TITLE:=IS-IS routing engine
72endef
73
74define Package/quagga-unstable-ospfd
75  $(call Package/quagga-unstable/Default)
76  DEPENDS+= +quagga-unstable-libospf +quagga-unstable-libzebra
77  TITLE:=OSPFv2 routing engine
78endef
79
80define Package/quagga-unstable-ospf6d
81  $(call Package/quagga-unstable/Default)
82  DEPENDS+= +quagga-unstable-libospf +quagga-unstable-libzebra @IPV6
83  TITLE:=OSPFv3 routing engine
84endef
85
86define Package/quagga-unstable-ripd
87  $(call Package/quagga-unstable/Default)
88  DEPENDS+= +quagga-unstable-libzebra
89  TITLE:=RIP routing engine
90endef
91
92define Package/quagga-unstable-ripngd
93  $(call Package/quagga-unstable/Default)
94  DEPENDS+= +quagga-unstable-libzebra @BROKEN
95  TITLE:=RIPNG routing engine
96endef
97
98define 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
102endef
103
104define Package/quagga-unstable/conffiles
105/etc/quagga/zebra.conf
106endef
107
108define Package/quagga-unstable-bgpd/conffiles
109/etc/quagga/bgpd.conf
110endef
111
112define Package/quagga-unstable-isisd/conffiles
113/etc/quagga/isisd.conf
114endef
115
116define Package/quagga-unstable-ospfd/conffiles
117/etc/quagga/ospfd.conf
118endef
119
120define Package/quagga-unstable-ospf6d/conffiles
121/etc/quagga/ospf6d.conf
122endef
123
124define Package/quagga-unstable-ripd/conffiles
125/etc/quagga/ripd.conf
126endef
127
128define Package/quagga-unstable-ripngd/conffiles
129/etc/quagga/ripngd.conf
130endef
131
132CONFIGURE_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
143ifneq ($(CONFIG_PACKAGE_quagga-unstable-isisd),)
144  CONFIGURE_ARGS+= --enable-isisd
145endif
146
147ifneq ($(CONFIG_PACKAGE_quagga-unstable-ripngd),)
148  CONFIGURE_ARGS+= --enable-ripngd
149endif
150
151define 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
162endef
163
164define Package/quagga-unstable/postinst
165#!/bin/sh
166
167name=quagga
168id=51
169
170# do not change below
171# check if we are on real system
172if [ -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
185fi
186
187echo ""
188if [ -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
191fi
192
193if [ -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
196fi
197
198grep -q '^zebra[[:space:]]*2601/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
199if [ $$? -ne 0 ]; then
200echo "zebrasrv      2600/tcp" >>$${IPKG_INSTROOT}/etc/services
201echo "zebra         2601/tcp" >>$${IPKG_INSTROOT}/etc/services
202echo "ripd          2602/tcp" >>$${IPKG_INSTROOT}/etc/services
203echo "ripngd        2603/tcp" >>$${IPKG_INSTROOT}/etc/services
204echo "ospfd         2604/tcp" >>$${IPKG_INSTROOT}/etc/services
205echo "bgpd          2605/tcp" >>$${IPKG_INSTROOT}/etc/services
206echo "ospf6d        2606/tcp" >>$${IPKG_INSTROOT}/etc/services
207echo "ospfapi       2607/tcp" >>$${IPKG_INSTROOT}/etc/services
208echo "isisd         2608/tcp" >>$${IPKG_INSTROOT}/etc/services
209fi
210endef
211
212define 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
218endef
219
220define 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
226endef
227
228define 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
234endef
235
236define 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
242endef
243
244define 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
250endef
251
252define 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
258endef
259
260define Package/quagga-unstable-vtysh/install
261        $(INSTALL_DIR) $(1)/usr/bin
262        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/
263endef
264
265define Package/quagga-unstable-libospf/install
266        $(INSTALL_DIR) $(1)/usr/lib
267        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(1)/usr/lib/
268endef
269
270define Package/quagga-unstable-libzebra/install
271        $(INSTALL_DIR) $(1)/usr/lib
272        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(1)/usr/lib/
273endef
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))
Note: See TracBrowser for help on using the repository browser.