root/kamikaze/packages/quagga-dn42/Makefile

Revision 191, 7.7 KB (checked in by soma, 23 months ago)

its probably more correct that way

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