Upgraded bmx6 to last version
[feed/routing.git] / packages / bmx6 / Makefile
1 # Copyright (C) 2011 Fundacio Privada per a la Xarxa Oberta, Lliure i Neutral guifi.net
2 #
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License along
14 # with this program; if not, write to the Free Software Foundation, Inc.,
15 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 #
17 # The full GNU General Public License is included in this distribution in
18 # the file called "COPYING".
19 #
20 # Contibutors:
21 # Axel Neumann, Simó Albert i Beltran, Pau Escrich
22 #
23
24
25 include $(TOPDIR)/rules.mk
26
27 PKG_NAME:=bmx6
28
29 PKG_SOURCE_PROTO:=git
30
31 PKG_SOURCE_URL:=git://bmx6.net/bmx6.git
32 #PKG_SOURCE_URL:=git://github.com/axn/bmx6.git
33
34 PKG_REV:=9d144096d2217a11c691e06acc8cfc44bd8c140c
35 PKG_VERSION:=r2013041601
36 PKG_RELEASE:=4
37
38 PKG_SOURCE_VERSION:=$(PKG_REV)
39 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
40 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
41 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
42
43 include $(INCLUDE_DIR)/package.mk
44
45
46 TARGET_CFLAGS += $(FPIC)
47
48 MAKE_ARGS += \
49 EXTRA_CFLAGS="$(TARGET_CFLAGS) -I. -I$(STAGING_DIR)/usr/include -DNO_DEBUG_ALL -DNO_DEBUG_DUMP" \
50 EXTRA_LDFLAGS="-L$(STAGING_DIR)/usr/lib " \
51 REVISION_VERSION="$(PKG_REV)" \
52 CC="$(TARGET_CC)" \
53 INSTALL_DIR="$(PKG_INSTALL_DIR)" \
54 STRIP="/bin/false" \
55 build_all
56
57 define Package/bmx6/Default
58 SECTION:=net
59 CATEGORY:=Network
60 SUBMENU:=Routing and Redirection
61 TITLE:=BMX6 layer 3 routing daemon (QMP version)
62 URL:=http://bmx6.net/
63 MAINTAINER:=Axel Neumann <neumann@cgws.de>
64 endef
65
66 define Package/bmx6/description
67 BMX6 layer 3 routing daemon supporting IPv4, IPv6, and IPv4 over IPv6
68 endef
69
70 define Package/bmx6
71 $(call Package/bmx6/Default)
72 MENU:=1
73 endef
74
75 define Package/bmx6-uci-config
76 $(call Package/bmx6/Default)
77 DEPENDS:=bmx6 +libuci
78 TITLE:=configuration plugin based on uci (recommended!)
79 endef
80
81
82 define Package/bmx6-json
83 $(call Package/bmx6/Default)
84 DEPENDS:=bmx6 +libjson
85 TITLE:=json plugin based on jsonc
86 endef
87
88 define Package/bmx6-sms
89 $(call Package/bmx6/Default)
90 DEPENDS:=bmx6
91 TITLE:=sms plugin
92 endef
93
94 define Package/bmx6-quagga
95 $(call Package/bmx6/Default)
96 DEPENDS:=bmx6 +qmp-quagga @BROKEN
97 TITLE:=bmx6 quagga plugin to redistribute/export routes (needs manet/bmx6 patched quagga 0.99.21)
98 endef
99
100 define Build/Configure
101 mkdir -p $(PKG_INSTALL_DIR)
102 endef
103
104 define Build/Compile
105 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS)
106 endef
107
108
109 define Package/bmx6/install
110 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
111 $(INSTALL_BIN) $(PKG_BUILD_DIR)/bmx6 $(1)/usr/sbin/bmx6
112 endef
113
114
115 define Package/bmx6-uci-config/conffiles
116 /etc/config/bmx6
117 endef
118
119
120 define Package/bmx6-uci-config/install
121 $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/config $(1)/etc/init.d
122 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_uci_config/bmx6_config.so $(1)/usr/lib/bmx6_config.so
123 $(INSTALL_BIN) ./files/etc/init.d/bmx6 $(1)/etc/init.d/bmx6
124 $(INSTALL_DATA) ./files/etc/config/bmx6 $(1)/etc/config/bmx6
125 endef
126
127 define Package/bmx6-json/install
128 $(INSTALL_DIR) $(1)/usr/lib
129 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_json/bmx6_json.so $(1)/usr/lib/bmx6_json.so
130 endef
131
132 define Package/bmx6-sms/install
133 $(INSTALL_DIR) $(1)/usr/lib
134 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_sms/bmx6_sms.so $(1)/usr/lib/bmx6_sms.so
135 endef
136
137 define Package/bmx6-quagga/install
138 $(INSTALL_DIR) $(1)/usr/lib
139 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_quagga/bmx6_quagga.so $(1)/usr/lib/bmx6_quagga.so
140 endef
141
142 $(eval $(call BuildPackage,bmx6))
143 $(eval $(call BuildPackage,bmx6-uci-config))
144 $(eval $(call BuildPackage,bmx6-json))
145 $(eval $(call BuildPackage,bmx6-sms))
146 $(eval $(call BuildPackage,bmx6-quagga))
147