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

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

net/quagga-unstable: Update to v0.99.17, refresh patches

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