Merge pull request #281 from stepet92/mcproxy-fix
[feed/routing.git] / 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:=4016a1980d900309771e432d1f7c741d6c48d477
35 PKG_VERSION:=r2017032301
36 PKG_RELEASE:=5
37 PKG_LICENSE:=GPL-2.0
38
39 PKG_SOURCE_VERSION:=$(PKG_REV)
40 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
41 PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
42 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
43
44 include $(INCLUDE_DIR)/package.mk
45
46
47 TARGET_CFLAGS += $(FPIC)
48
49 MAKE_ARGS += \
50 EXTRA_CFLAGS="$(TARGET_CFLAGS) -I. -I$(STAGING_DIR)/usr/include -DNO_DEBUG_ALL -DNO_DEBUG_DUMP" \
51 EXTRA_LDFLAGS="-L$(STAGING_DIR)/usr/lib " \
52 GIT_REV="$(PKG_REV)" \
53 CC="$(TARGET_CC)" \
54 INSTALL_DIR="$(PKG_INSTALL_DIR)" \
55 STRIP="/bin/false" \
56 build_all
57
58 define Package/bmx6/Default
59 SECTION:=net
60 CATEGORY:=Network
61 SUBMENU:=Routing and Redirection
62 TITLE:=BMX6 layer 3 routing daemon
63 URL:=http://bmx6.net/
64 MAINTAINER:=Axel Neumann <neumann@cgws.de>
65 DEPENDS:=+kmod-ip6-tunnel +kmod-iptunnel6 +kmod-tun
66 endef
67
68 define Package/bmx6/description
69 BMX6 layer 3 routing daemon supporting IPv4, IPv6, and IPv4 over IPv6
70 endef
71
72 define Package/bmx6
73 $(call Package/bmx6/Default)
74 MENU:=1
75 endef
76
77 define Package/bmx6-uci-config
78 $(call Package/bmx6/Default)
79 DEPENDS:=bmx6 +libuci
80 TITLE:=configuration plugin based on uci (recommended!)
81 endef
82
83 define Package/bmx6-json
84 $(call Package/bmx6/Default)
85 DEPENDS:=bmx6 +libjson-c
86 TITLE:=json plugin based on json-c
87 endef
88
89 define Package/bmx6-sms
90 $(call Package/bmx6/Default)
91 DEPENDS:=bmx6
92 TITLE:=sms plugin
93 endef
94
95 #define Package/bmx6-quagga
96 # $(call Package/bmx6/Default)
97 # DEPENDS:=bmx6 +qmp-quagga @BROKEN
98 # TITLE:=bmx6 quagga plugin to redistribute/export routes (needs manet/bmx6 patched quagga 0.99.21)
99 #endef
100
101 define Package/bmx6-table
102 $(call Package/bmx6/Default)
103 DEPENDS:=bmx6
104 TITLE:=bmx6 table plugin to automatic announce routing-table routes via ip6ip tunnels
105 endef
106
107 define Build/Configure
108 mkdir -p $(PKG_INSTALL_DIR)
109 endef
110
111 define Build/Compile
112 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS)
113 endef
114
115 define Package/bmx6/install
116 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
117 $(INSTALL_BIN) $(PKG_BUILD_DIR)/bmx6 $(1)/usr/sbin/bmx6
118 endef
119
120 define Package/bmx6-uci-config/conffiles
121 /etc/config/bmx6
122 endef
123
124 define Package/bmx6-uci-config/install
125 $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/config $(1)/etc/init.d
126 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_uci_config/bmx6_config.so $(1)/usr/lib/bmx6_config.so
127 $(INSTALL_BIN) ./files/etc/init.d/bmx6 $(1)/etc/init.d/bmx6
128 $(INSTALL_DATA) ./files/etc/config/bmx6 $(1)/etc/config/bmx6
129 endef
130
131 define Package/bmx6-json/install
132 $(INSTALL_DIR) $(1)/usr/lib
133 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_json/bmx6_json.so $(1)/usr/lib/bmx6_json.so
134 endef
135
136 define Package/bmx6-sms/install
137 $(INSTALL_DIR) $(1)/usr/lib
138 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_sms/bmx6_sms.so $(1)/usr/lib/bmx6_sms.so
139 endef
140
141 define Package/bmx6-table/install
142 $(INSTALL_DIR) $(1)/usr/lib
143 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_table/bmx6_table.so $(1)/usr/lib/bmx6_table.so
144 endef
145
146 #define Package/bmx6-quagga/install
147 # $(INSTALL_DIR) $(1)/usr/lib
148 # $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_quagga/bmx6_quagga.so $(1)/usr/lib/bmx6_quagga.so
149 #endef
150
151 $(eval $(call BuildPackage,bmx6))
152 $(eval $(call BuildPackage,bmx6-uci-config))
153 $(eval $(call BuildPackage,bmx6-json))
154 $(eval $(call BuildPackage,bmx6-sms))
155 #$(eval $(call BuildPackage,bmx6-quagga))
156 $(eval $(call BuildPackage,bmx6-table))