3 include $(TOPDIR
)/rules.mk
8 PKG_MD5SUM
:=8757b155aa2458f6158ccd330d0e1b39
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 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(PKG_IPK_DIR
) control
/$(PKG_NAME
).control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
100 mkdir
-p
$(PKG_IPK_DIR
)/usr
/sbin
101 mkdir
-p
$(PKG_IPK_DIR
)/usr
/lib
102 mkdir
-p
$(PKG_IPK_DIR
)/etc
/quagga
103 rm $(PKG_IPK_DIR
)/usr
/lib
/*.la
104 rm -rf
$(PKG_IPK_DIR
)/usr
/include
105 rm -rf
$(PKG_IPK_DIR
)/usr
/info
106 rm -rf
$(PKG_IPK_DIR
)/usr
/man
107 $(STRIP
) $(PKG_IPK_DIR
)/usr
/lib
/*
108 $(STRIP
) $(PKG_IPK_DIR
)/usr
/sbin
/*
109 mkdir
-p
$(PACKAGE_DIR
)
110 $(IPKG_BUILD
) $(PKG_IPK_DIR
) $(PACKAGE_DIR
)
112 $(IPKG_STATE_DIR
)/info/quagga.list
: $(PKG_IPK
)
113 $(IPKG
) install $(PKG_IPK
)
115 $(PKG_ZEBRA
): $(PKG_IPK_DIR
)/zebra
116 mkdir
-p
$(PKG_ZEBRA_DIR
)/etc
/quagga
117 mkdir
-p
$(PKG_ZEBRA_DIR
)/usr
/sbin
118 mkdir
-p
$(PKG_ZEBRA_DIR
)/usr
/lib
119 cp
-a .
/ipkg
/* $(PKG_ZEBRA_DIR
)/
120 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(PKG_ZEBRA_DIR
) control
/$(PKG_NAME
)-zebra.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
121 cp
$(PKG_IPK_DIR
)/usr
/sbin
/zebra
$(PKG_ZEBRA_DIR
)/usr
/sbin
122 cp
$(PKG_IPK_DIR
)/usr
/lib
/libzebra
* $(PKG_ZEBRA_DIR
)/usr
/lib
123 $(IPKG_BUILD
) $(PKG_ZEBRA_DIR
) $(PACKAGE_DIR
)
125 $(IPKG_STATE_DIR
)/info/quagga-zebra.list
: $(PKG_ZEBRA
)
126 $(IPKG
) install $(PKG_ZEBRA
)
128 $(PKG_BGPD
): $(PKG_IPK_DIR
)/zebra
129 mkdir
-p
$(PKG_BGPD_DIR
)/etc
/quagga
130 mkdir
-p
$(PKG_BGPD_DIR
)/usr
/sbin
131 cp
-a .
/ipkg
/* $(PKG_BGPD_DIR
)/
132 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(PKG_BGPD_DIR
) control
/$(PKG_NAME
)-bgpd.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
133 cp
$(PKG_IPK_DIR
)/usr
/sbin
/bgpd
$(PKG_BGPD_DIR
)/usr
/sbin
134 $(IPKG_BUILD
) $(PKG_BGPD_DIR
) $(PACKAGE_DIR
)
136 $(IPKG_STATE_DIR
)/info/quagga-bgpd.list
: $(PKG_BGPD
)
137 $(IPKG
) install $(PKG_BGPD
)
139 $(PKG_RIPD
): $(PKG_IPK_DIR
)/zebra
140 mkdir
-p
$(PKG_RIPD_DIR
)/etc
/quagga
141 mkdir
-p
$(PKG_RIPD_DIR
)/usr
/sbin
142 cp
-a .
/ipkg
/* $(PKG_RIPD_DIR
)/
143 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(PKG_RIPD_DIR
) control
/$(PKG_NAME
)-ripd.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
144 cp
$(PKG_IPK_DIR
)/usr
/sbin
/ripd
$(PKG_RIPD_DIR
)/usr
/sbin
145 $(IPKG_BUILD
) $(PKG_RIPD_DIR
) $(PACKAGE_DIR
)
147 $(IPKG_STATE_DIR
)/info/quagga-ripd.list
: $(PKG_RIPD
)
148 $(IPKG
) install $(PKG_RIPD
)
150 $(PKG_OSPFD
): $(PKG_IPK_DIR
)/zebra
151 mkdir
-p
$(PKG_OSPFD_DIR
)/etc
/quagga
152 mkdir
-p
$(PKG_OSPFD_DIR
)/usr
/sbin
153 mkdir
-p
$(PKG_OSPFD_DIR
)/usr
/lib
154 cp
-a .
/ipkg
/* $(PKG_OSPFD_DIR
)/
155 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(PKG_OSPFD_DIR
) control
/$(PKG_NAME
)-ospfd.control
$(PKG_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
156 cp
$(PKG_IPK_DIR
)/usr
/sbin
/ospfd
$(PKG_OSPFD_DIR
)/usr
/sbin
157 cp
$(PKG_IPK_DIR
)/usr
/lib
/libospf
* $(PKG_OSPFD_DIR
)/usr
/lib
158 $(IPKG_BUILD
) $(PKG_OSPFD_DIR
) $(PACKAGE_DIR
)
160 $(IPKG_STATE_DIR
)/info/quagga-ospfd.list
: $(PKG_OSPFD
)
161 $(IPKG
) install $(PKG_OSPFD
)
163 source
: $(DL_DIR
)/$(PKG_SOURCE
)
164 prepare
: $(PKG_BUILD_DIR
)/.unpacked
166 install: $(INSTALL_TARGETS
)
169 rm -rf
$(PKG_BUILD_DIR
)
170 rm -f
$(PKG_IPK
) $(PKG_ZEBRA
) $(PKG_OSPFD
) $(PKG_RIPD
) $(PKG_BGPD
)