fix monit build
[openwrt.git] / package / quagga / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=quagga
6 PKG_VERSION:=0.98.3
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=68be5e911e4d604c0f5959338263356e
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 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)
112
113 $(IPKG_STATE_DIR)/info/quagga.list: $(PKG_IPK)
114 $(IPKG) install $(PKG_IPK)
115
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)
126
127 $(IPKG_STATE_DIR)/info/quagga-zebra.list: $(PKG_ZEBRA)
128 $(IPKG) install $(PKG_ZEBRA)
129
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)
138
139 $(IPKG_STATE_DIR)/info/quagga-bgpd.list: $(PKG_BGPD)
140 $(IPKG) install $(PKG_BGPD)
141
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)
150
151 $(IPKG_STATE_DIR)/info/quagga-ripd.list: $(PKG_RIPD)
152 $(IPKG) install $(PKG_RIPD)
153
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)
164
165 $(IPKG_STATE_DIR)/info/quagga-ospfd.list: $(PKG_OSPFD)
166 $(IPKG) install $(PKG_OSPFD)
167
168 source: $(DL_DIR)/$(PKG_SOURCE)
169 prepare: $(PKG_BUILD_DIR)/.unpacked
170 compile: $(TARGETS)
171 install: $(INSTALL_TARGETS)
172
173 clean:
174 rm -rf $(PKG_BUILD_DIR)
175 rm -f $(PKG_IPK) $(PKG_ZEBRA) $(PKG_OSPFD) $(PKG_RIPD) $(PKG_BGPD)
This page took 0.06283 seconds and 5 git commands to generate.