3 include $(TOPDIR
)/rules.mk
8 PKG_MD5SUM
:=68be5e911e4d604c0f5959338263356e
10 PKG_SOURCE_URL
:=http
://www.quagga.net
/download
/ \
11 http
://www.de.quagga.net
/download
/ \
12 http
://www.uk.quagga.net
/download
/
13 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
14 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
16 PKG_IPK
:=$(PACKAGE_DIR
)/$(PKG_NAME
)-all_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
17 PKG_IPK_DIR
:=$(PKG_BUILD_DIR
)/ipkg
/quagga
19 PKG_ZEBRA_DIR
:=$(PKG_BUILD_DIR
)/ipkg
/zebra
20 PKG_BGPD_DIR
:=$(PKG_BUILD_DIR
)/ipkg
/bgpd
21 PKG_OSPFD_DIR
:=$(PKG_BUILD_DIR
)/ipkg
/ospfd
22 PKG_RIPD_DIR
:=$(PKG_BUILD_DIR
)/ipkg
/ripd
24 # separate ipkg for zebra,bgpd,ospf and ripd
25 PKG_ZEBRA
:=$(PACKAGE_DIR
)/$(PKG_NAME
)-zebra_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
26 PKG_BGPD
:=$(PACKAGE_DIR
)/$(PKG_NAME
)-bgpd_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
27 PKG_RIPD
:=$(PACKAGE_DIR
)/$(PKG_NAME
)-ripd_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
28 PKG_OSPFD
:=$(PACKAGE_DIR
)/$(PKG_NAME
)-ospfd_
$(PKG_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
31 ifneq ($(BR2_PACKAGE_QUAGGA_ZEBRA
),)
32 TARGETS
+= $(PKG_ZEBRA
)
34 ifneq ($(BR2_PACKAGE_QUAGGA_BGPD
),)
35 TARGETS
+= $(PKG_BGPD
)
37 ifneq ($(BR2_PACKAGE_QUAGGA_RIPD
),)
38 TARGETS
+= $(PKG_RIPD
)
40 ifneq ($(BR2_PACKAGE_QUAGGA_OSPFD
),)
41 TARGETS
+= $(PKG_OSPFD
)
44 INSTALL_TARGETS
:= $(IPKG_STATE_DIR
)/info/quagga.list
45 ifeq ($(BR2_PACKAGE_QUAGGA_ZEBRA
),y
)
46 INSTALL_TARGETS
:= $(IPKG_STATE_DIR
)/info/quagga-zebra.list
48 ifeq ($(BR2_PACKAGE_QUAGGA_BGPD
),y
)
49 INSTALL_TARGETS
:= $(IPKG_STATE_DIR
)/info/quagga-bgpd.list
51 ifeq ($(BR2_PACKAGE_QUAGGA_RIPD
),y
)
52 INSTALL_TARGETS
:= $(IPKG_STATE_DIR
)/info/quagga-ripd.list
54 ifeq ($(BR2_PACKAGE_QUAGGA_OSPFD
),y
)
55 INSTALL_TARGETS
:= $(IPKG_STATE_DIR
)/info/quagga-ospfd.list
58 $(DL_DIR
)/$(PKG_SOURCE
):
59 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(PKG_SOURCE
) $(PKG_MD5SUM
) $(PKG_SOURCE_URL
)
61 $(PKG_BUILD_DIR
)/.unpacked
: $(DL_DIR
)/$(PKG_SOURCE
)
62 $(PKG_CAT
) $(DL_DIR
)/$(PKG_SOURCE
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
63 $(PATCH
) $(PKG_BUILD_DIR
) .
/patches
64 touch
$(PKG_BUILD_DIR
)/.unpacked
66 $(PKG_BUILD_DIR
)/.configured
: $(PKG_BUILD_DIR
)/.unpacked
67 (cd
$(PKG_BUILD_DIR
); rm -rf config.cache
; \
68 $(TARGET_CONFIGURE_OPTS
) \
69 CFLAGS
="$(TARGET_CFLAGS)" \
71 --target
=$(GNU_TARGET_NAME
) \
72 --host
=$(GNU_TARGET_NAME
) \
73 --build
=$(GNU_HOST_NAME
) \
78 --libexecdir
=/usr
/lib \
79 --datadir=/usr
/share \
80 --localstatedir
=/var \
86 --enable-user
=quagga \
87 --enable-group
=quagga \
88 --sysconfdir
=/etc
/quagga \
89 --disable-exampledir \
91 touch
$(PKG_BUILD_DIR
)/.configured
93 $(PKG_IPK_DIR
)/zebra
: $(PKG_BUILD_DIR
)/.configured
94 $(MAKE
) -C
$(PKG_BUILD_DIR
)
95 $(MAKE
) DESTDIR
=$(PKG_IPK_DIR
) -C
$(PKG_BUILD_DIR
) install
97 $(PKG_IPK
): $(PKG_IPK_DIR
)/zebra
98 cp
-a .
/ipkg
/* $(PKG_IPK_DIR
)/
99 find
$(PKG_IPK_DIR
) -name CVS | xargs
rm -rf
100 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(PKG_IPK_DIR
) control
/$(PKG_NAME
).control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
101 mkdir
-p
$(PKG_IPK_DIR
)/usr
/sbin
102 mkdir
-p
$(PKG_IPK_DIR
)/usr
/lib
103 mkdir
-p
$(PKG_IPK_DIR
)/etc
/quagga
104 rm $(PKG_IPK_DIR
)/usr
/lib
/*.la
105 rm -rf
$(PKG_IPK_DIR
)/usr
/include
106 rm -rf
$(PKG_IPK_DIR
)/usr
/info
107 rm -rf
$(PKG_IPK_DIR
)/usr
/man
108 $(STRIP
) $(PKG_IPK_DIR
)/usr
/lib
/*
109 $(STRIP
) $(PKG_IPK_DIR
)/usr
/sbin
/*
110 mkdir
-p
$(PACKAGE_DIR
)
111 $(IPKG_BUILD
) $(PKG_IPK_DIR
) $(PACKAGE_DIR
)
113 $(IPKG_STATE_DIR
)/info/quagga.list
: $(PKG_IPK
)
114 $(IPKG
) install $(PKG_IPK
)
116 $(PKG_ZEBRA
): $(PKG_IPK_DIR
)/zebra
117 mkdir
-p
$(PKG_ZEBRA_DIR
)/etc
/quagga
118 mkdir
-p
$(PKG_ZEBRA_DIR
)/usr
/sbin
119 mkdir
-p
$(PKG_ZEBRA_DIR
)/usr
/lib
120 cp
-a .
/ipkg
/* $(PKG_ZEBRA_DIR
)/
121 find
$(PKG_ZEBRA_DIR
) -name CVS | xargs
rm -rf
122 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(PKG_ZEBRA_DIR
) control
/$(PKG_NAME
)-zebra.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
123 cp
$(PKG_IPK_DIR
)/usr
/sbin
/zebra
$(PKG_ZEBRA_DIR
)/usr
/sbin
124 cp
$(PKG_IPK_DIR
)/usr
/lib
/libzebra
* $(PKG_ZEBRA_DIR
)/usr
/lib
125 $(IPKG_BUILD
) $(PKG_ZEBRA_DIR
) $(PACKAGE_DIR
)
127 $(IPKG_STATE_DIR
)/info/quagga-zebra.list
: $(PKG_ZEBRA
)
128 $(IPKG
) install $(PKG_ZEBRA
)
130 $(PKG_BGPD
): $(PKG_IPK_DIR
)/zebra
131 mkdir
-p
$(PKG_BGPD_DIR
)/etc
/quagga
132 mkdir
-p
$(PKG_BGPD_DIR
)/usr
/sbin
133 cp
-a .
/ipkg
/* $(PKG_BGPD_DIR
)/
134 find
$(PKG_BGPD_DIR
) -name CVS | xargs
rm -rf
135 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(PKG_BGPD_DIR
) control
/$(PKG_NAME
)-bgpd.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
136 cp
$(PKG_IPK_DIR
)/usr
/sbin
/bgpd
$(PKG_BGPD_DIR
)/usr
/sbin
137 $(IPKG_BUILD
) $(PKG_BGPD_DIR
) $(PACKAGE_DIR
)
139 $(IPKG_STATE_DIR
)/info/quagga-bgpd.list
: $(PKG_BGPD
)
140 $(IPKG
) install $(PKG_BGPD
)
142 $(PKG_RIPD
): $(PKG_IPK_DIR
)/zebra
143 mkdir
-p
$(PKG_RIPD_DIR
)/etc
/quagga
144 mkdir
-p
$(PKG_RIPD_DIR
)/usr
/sbin
145 cp
-a .
/ipkg
/* $(PKG_RIPD_DIR
)/
146 find
$(PKG_RIPD_DIR
) -name CVS | xargs
rm -rf
147 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(PKG_RIPD_DIR
) control
/$(PKG_NAME
)-ripd.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
148 cp
$(PKG_IPK_DIR
)/usr
/sbin
/ripd
$(PKG_RIPD_DIR
)/usr
/sbin
149 $(IPKG_BUILD
) $(PKG_RIPD_DIR
) $(PACKAGE_DIR
)
151 $(IPKG_STATE_DIR
)/info/quagga-ripd.list
: $(PKG_RIPD
)
152 $(IPKG
) install $(PKG_RIPD
)
154 $(PKG_OSPFD
): $(PKG_IPK_DIR
)/zebra
155 mkdir
-p
$(PKG_OSPFD_DIR
)/etc
/quagga
156 mkdir
-p
$(PKG_OSPFD_DIR
)/usr
/sbin
157 mkdir
-p
$(PKG_OSPFD_DIR
)/usr
/lib
158 cp
-a .
/ipkg
/* $(PKG_OSPFD_DIR
)/
159 find
$(PKG_OSPFD_DIR
) -name CVS | xargs
rm -rf
160 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(PKG_OSPFD_DIR
) control
/$(PKG_NAME
)-ospfd.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
161 cp
$(PKG_IPK_DIR
)/usr
/sbin
/ospfd
$(PKG_OSPFD_DIR
)/usr
/sbin
162 cp
$(PKG_IPK_DIR
)/usr
/lib
/libospf
* $(PKG_OSPFD_DIR
)/usr
/lib
163 $(IPKG_BUILD
) $(PKG_OSPFD_DIR
) $(PACKAGE_DIR
)
165 $(IPKG_STATE_DIR
)/info/quagga-ospfd.list
: $(PKG_OSPFD
)
166 $(IPKG
) install $(PKG_OSPFD
)
168 source
: $(DL_DIR
)/$(PKG_SOURCE
)
169 prepare
: $(PKG_BUILD_DIR
)/.unpacked
171 install: $(INSTALL_TARGETS
)
174 rm -rf
$(PKG_BUILD_DIR
)
175 rm -f
$(PKG_IPK
) $(PKG_ZEBRA
) $(PKG_OSPFD
) $(PKG_RIPD
) $(PKG_BGPD
)