Add mirror
[openwrt.git] / openwrt / package / quagga / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=quagga
6 PKG_VERSION:=0.98.2
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=8757b155aa2458f6158ccd330d0e1b39
9
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)
15 PKG_CAT:=zcat
16 PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)-all_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
17 PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg/quagga
18
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
23
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
29
30 TARGETS:=$(PKG_IPK)
31 ifneq ($(BR2_PACKAGE_QUAGGA_ZEBRA),)
32 TARGETS += $(PKG_ZEBRA)
33 endif
34 ifneq ($(BR2_PACKAGE_QUAGGA_BGPD),)
35 TARGETS += $(PKG_BGPD)
36 endif
37 ifneq ($(BR2_PACKAGE_QUAGGA_RIPD),)
38 TARGETS += $(PKG_RIPD)
39 endif
40 ifneq ($(BR2_PACKAGE_QUAGGA_OSPFD),)
41 TARGETS += $(PKG_OSPFD)
42 endif
43
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
47 endif
48 ifeq ($(BR2_PACKAGE_QUAGGA_BGPD),y)
49 INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/quagga-bgpd.list
50 endif
51 ifeq ($(BR2_PACKAGE_QUAGGA_RIPD),y)
52 INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/quagga-ripd.list
53 endif
54 ifeq ($(BR2_PACKAGE_QUAGGA_OSPFD),y)
55 INSTALL_TARGETS := $(IPKG_STATE_DIR)/info/quagga-ospfd.list
56 endif
57
58 $(DL_DIR)/$(PKG_SOURCE):
59 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL)
60
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
65
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)" \
70 ./configure \
71 --target=$(GNU_TARGET_NAME) \
72 --host=$(GNU_TARGET_NAME) \
73 --build=$(GNU_HOST_NAME) \
74 --prefix=/usr \
75 --exec-prefix=/usr \
76 --bindir=/usr/bin \
77 --sbindir=/usr/sbin \
78 --libexecdir=/usr/lib \
79 --datadir=/usr/share \
80 --localstatedir=/var \
81 --mandir=/usr/man \
82 --infodir=/usr/info \
83 --disable-static \
84 --disable-ipv6 \
85 --disable-vtysh \
86 --enable-user=quagga \
87 --enable-group=quagga \
88 --sysconfdir=/etc/quagga \
89 --disable-exampledir \
90 );
91 touch $(PKG_BUILD_DIR)/.configured
92
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
96
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)
111
112 $(IPKG_STATE_DIR)/info/quagga.list: $(PKG_IPK)
113 $(IPKG) install $(PKG_IPK)
114
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)
124
125 $(IPKG_STATE_DIR)/info/quagga-zebra.list: $(PKG_ZEBRA)
126 $(IPKG) install $(PKG_ZEBRA)
127
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)
135
136 $(IPKG_STATE_DIR)/info/quagga-bgpd.list: $(PKG_BGPD)
137 $(IPKG) install $(PKG_BGPD)
138
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)
146
147 $(IPKG_STATE_DIR)/info/quagga-ripd.list: $(PKG_RIPD)
148 $(IPKG) install $(PKG_RIPD)
149
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)
159
160 $(IPKG_STATE_DIR)/info/quagga-ospfd.list: $(PKG_OSPFD)
161 $(IPKG) install $(PKG_OSPFD)
162
163 source: $(DL_DIR)/$(PKG_SOURCE)
164 prepare: $(PKG_BUILD_DIR)/.unpacked
165 compile: $(TARGETS)
166 install: $(INSTALL_TARGETS)
167
168 clean:
169 rm -rf $(PKG_BUILD_DIR)
170 rm -f $(PKG_IPK) $(PKG_ZEBRA) $(PKG_OSPFD) $(PKG_RIPD) $(PKG_BGPD)
This page took 0.053866 seconds and 5 git commands to generate.