summaryrefslogtreecommitdiff
path: root/package/quagga/Makefile
blob: 32d6d6603e41f1a6448a332c99696ef4c46e8c32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# $Id$

include $(TOPDIR)/rules.mk

PKG_NAME:=quagga
PKG_VERSION:=0.98.4
PKG_RELEASE:=1
PKG_MD5SUM:=c68e409931449afc5730289d3105f502

PKG_SOURCE_URL:=http://www.quagga.net/download/ \
                http://www.de.quagga.net/download/ \
                http://www.uk.quagga.net/download/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_CAT:=zcat

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install

include $(TOPDIR)/package/rules.mk

$(eval $(call PKG_template,QUAGGA,quagga,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,QUAGGA_BGPD,quagga-bgpd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,QUAGGA_OSPFD,quagga-ospfd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,QUAGGA_OSPF6D,quagga-ospf6d,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,QUAGGA_RIPD,quagga-ripd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,QUAGGA_RIPNGD,quagga-ripngd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
$(eval $(call PKG_template,QUAGGA_VTYSH,quagga-vtysh,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))

$(PKG_BUILD_DIR)/.configured:
	(cd $(PKG_BUILD_DIR); rm -rf config.{cache,status}; \
		$(TARGET_CONFIGURE_OPTS) \
		CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
		LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" \
		./configure \
		--target=$(GNU_TARGET_NAME) \
		--host=$(GNU_TARGET_NAME) \
		--build=$(GNU_HOST_NAME) \
		--program-prefix="" \
		--program-suffix="" \
		--prefix=/usr \
		--exec-prefix=/usr \
		--bindir=/usr/bin \
		--sbindir=/usr/sbin \
		--libexecdir=/usr/lib \
		--datadir=/usr/share \
		--includedir=/usr/include \
		--infodir=/usr/share/info \
		--libdir=/usr/lib \
		--libexecdir=/usr/lib \
		--localstatedir=/var/run/quagga \
		--mandir=/usr/share/man \
		--sbindir=/usr/sbin \
		--sysconfdir=/etc/quagga \
		$(DISABLE_NLS) \
		$(DISABLE_LARGEFILE) \
		--enable-shared \
		--disable-static \
		--enable-ipv6 \
		--enable-vtysh \
		--enable-user=quagga \
		--enable-group=quagga \
	);
	touch $@

$(PKG_BUILD_DIR)/.built:
	$(MAKE) -C $(PKG_BUILD_DIR) \
		DESTDIR=$(PKG_INSTALL_DIR) \
		all install
	touch $@

$(IPKG_QUAGGA):
	install -d -m0755 $(IDIR_QUAGGA)/usr/lib
	cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(IDIR_QUAGGA)/usr/lib/
	install -d -m0755 $(IDIR_QUAGGA)/usr/sbin
	cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/zebra $(IDIR_QUAGGA)/usr/sbin/
	cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/watchquagga $(IDIR_QUAGGA)/usr/sbin/
	# avoid /etc being set to 0750
	install -d -m0755 $(IDIR_QUAGGA)/etc/quagga/
	chmod 0750 $(IDIR_QUAGGA)/etc/quagga/
	install -d -m0755 $(IDIR_QUAGGA)/etc/init.d/
	install -m0755 ./files/quagga.init $(IDIR_QUAGGA)/etc/init.d/quagga
	ln -sf quagga $(IDIR_QUAGGA)/etc/init.d/S49quagga
	$(RSTRIP) $(IDIR_QUAGGA)
	$(IPKG_BUILD) $(IDIR_QUAGGA) $(PACKAGE_DIR)

$(IPKG_QUAGGA_BGPD):
	install -d -m0755 $(IDIR_QUAGGA_BGPD)/usr/sbin
	cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/bgpd $(IDIR_QUAGGA_BGPD)/usr/sbin/
	$(RSTRIP) $(IDIR_QUAGGA_BGPD)
	$(IPKG_BUILD) $(IDIR_QUAGGA_BGPD) $(PACKAGE_DIR)

$(IPKG_QUAGGA_OSPFD):
	install -d -m0755 $(IDIR_QUAGGA_OSPFD)/usr/lib
	cp -fpR $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(IDIR_QUAGGA_OSPFD)/usr/lib/
	install -d -m0755 $(IDIR_QUAGGA_OSPFD)/usr/sbin
	cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/ospfd $(IDIR_QUAGGA_OSPFD)/usr/sbin/
	$(RSTRIP) $(IDIR_QUAGGA_OSPFD)
	$(IPKG_BUILD) $(IDIR_QUAGGA_OSPFD) $(PACKAGE_DIR)

$(IPKG_QUAGGA_OSPF6D):
	install -d -m0755 $(IDIR_QUAGGA_OSPF6D)/usr/sbin
	cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/ospf6d $(IDIR_QUAGGA_OSPF6D)/usr/sbin/
	$(RSTRIP) $(IDIR_QUAGGA_OSPF6D)
	$(IPKG_BUILD) $(IDIR_QUAGGA_OSPF6D) $(PACKAGE_DIR)

$(IPKG_QUAGGA_RIPD):
	install -d -m0755 $(IDIR_QUAGGA_RIPD)/usr/sbin
	cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/ripd $(IDIR_QUAGGA_RIPD)/usr/sbin/
	$(RSTRIP) $(IDIR_QUAGGA_RIPD)
	$(IPKG_BUILD) $(IDIR_QUAGGA_RIPD) $(PACKAGE_DIR)

$(IPKG_QUAGGA_RIPNGD):
	install -d -m0755 $(IDIR_QUAGGA_RIPNGD)/usr/sbin
	cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/ripngd $(IDIR_QUAGGA_RIPNGD)/usr/sbin/
	$(RSTRIP) $(IDIR_QUAGGA_RIPNGD)
	$(IPKG_BUILD) $(IDIR_QUAGGA_RIPNGD) $(PACKAGE_DIR)

$(IPKG_QUAGGA_VTYSH):
	install -d -m0755 $(IDIR_QUAGGA_VTYSH)/usr/bin
	cp -fpR $(PKG_INSTALL_DIR)/usr/bin/vtysh $(IDIR_QUAGGA_VTYSH)/usr/bin/
	$(RSTRIP) $(IDIR_QUAGGA_VTYSH)
	$(IPKG_BUILD) $(IDIR_QUAGGA_VTYSH) $(PACKAGE_DIR)