source: packages/net/quagga/Makefile @ 20678

Last change on this file since 20678 was 20678, checked in by acinonyx, 6 years ago

[packages] quagga{,-unstable}: Add package maintainer

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