source: packages/net/quagga/Makefile @ 18095

Last change on this file since 18095 was 18095, checked in by acinonyx, 7 years ago

[packages] quagga, quagga-unstable: Clean up packages

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