source: packages/net/quagga/Makefile @ 23665

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

net/quagga: honor configure.ac patch changes

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