opennds: update to version 10.1.3
[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 PKG_VERSION:=0.1-alpha
29 PKG_RELEASE:=1
30
31 PKG_SOURCE_PROTO:=git
32 PKG_SOURCE_URL:=https://github.com/bmx-routing/bmx6.git
33 PKG_SOURCE_DATE:=2020-06-08
34 PKG_SOURCE_VERSION:=65cb0d542f16a4b4689f5ad2542c9f24215a6616
35 PKG_MIRROR_HASH:=45501cfe9f82e08e8082147f90b94ba5b6bd11771a9140412bfbf5523a796177
36
37 PKG_MAINTAINER:=Axel Neumann <neumann@cgws.de>
38 PKG_LICENSE:=GPL-2.0-or-later
39
40 include $(INCLUDE_DIR)/package.mk
41
42 TARGET_CFLAGS += $(FPIC)
43
44 MAKE_ARGS += \
45 EXTRA_CFLAGS="$(TARGET_CFLAGS) -I. -I$(STAGING_DIR)/usr/include -DNO_DEBUG_ALL -DNO_DEBUG_DUMP" \
46 EXTRA_LDFLAGS="-L$(STAGING_DIR)/usr/lib " \
47 GIT_REV="$(PKG_REV)" \
48 CC="$(TARGET_CC)" \
49 INSTALL_DIR="$(PKG_INSTALL_DIR)" \
50 STRIP="/bin/false" \
51 build_all
52
53 define Package/bmx6/Default
54 SECTION:=net
55 CATEGORY:=Network
56 SUBMENU:=Routing and Redirection
57 TITLE:=BMX6 layer 3 routing daemon
58 URL:=https://bmx6.net/projects/bmx6
59 DEPENDS:=+kmod-ip6-tunnel +kmod-iptunnel6 +kmod-tun
60 endef
61
62 define Package/bmx6/description
63 BMX6 layer 3 routing daemon supporting IPv4, IPv6, and IPv4 over IPv6
64 endef
65
66 define Package/bmx6
67 $(call Package/bmx6/Default)
68 MENU:=1
69 endef
70
71 define Package/bmx6-uci-config
72 $(call Package/bmx6/Default)
73 DEPENDS:=bmx6 +libuci
74 TITLE:=configuration plugin based on uci (recommended!)
75 endef
76
77 define Package/bmx6-json
78 $(call Package/bmx6/Default)
79 DEPENDS:=bmx6 +libjson-c
80 TITLE:=json plugin based on json-c
81 endef
82
83 define Package/bmx6-sms
84 $(call Package/bmx6/Default)
85 DEPENDS:=bmx6
86 TITLE:=sms plugin
87 endef
88
89 #define Package/bmx6-quagga
90 # $(call Package/bmx6/Default)
91 # DEPENDS:=bmx6 +qmp-quagga @BROKEN
92 # TITLE:=bmx6 quagga plugin to redistribute/export routes (needs manet/bmx6 patched quagga 0.99.21)
93 #endef
94
95 define Package/bmx6-table
96 $(call Package/bmx6/Default)
97 DEPENDS:=bmx6
98 TITLE:=bmx6 table plugin to automatic announce routing-table routes via ip6ip tunnels
99 endef
100
101 define Build/Configure
102 mkdir -p $(PKG_INSTALL_DIR)
103 endef
104
105 define Build/Compile
106 $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS)
107 endef
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 define Package/bmx6-uci-config/conffiles
115 /etc/config/bmx6
116 endef
117
118 define Package/bmx6-uci-config/install
119 $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/config $(1)/etc/init.d
120 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_uci_config/bmx6_config.so $(1)/usr/lib/bmx6_config.so
121 $(INSTALL_BIN) ./files/etc/init.d/bmx6 $(1)/etc/init.d/bmx6
122 $(INSTALL_DATA) ./files/etc/config/bmx6 $(1)/etc/config/bmx6
123 endef
124
125 define Package/bmx6-json/install
126 $(INSTALL_DIR) $(1)/usr/lib
127 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_json/bmx6_json.so $(1)/usr/lib/bmx6_json.so
128 endef
129
130 define Package/bmx6-sms/install
131 $(INSTALL_DIR) $(1)/usr/lib
132 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_sms/bmx6_sms.so $(1)/usr/lib/bmx6_sms.so
133 endef
134
135 define Package/bmx6-table/install
136 $(INSTALL_DIR) $(1)/usr/lib
137 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_table/bmx6_table.so $(1)/usr/lib/bmx6_table.so
138 endef
139
140 #define Package/bmx6-quagga/install
141 # $(INSTALL_DIR) $(1)/usr/lib
142 # $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_quagga/bmx6_quagga.so $(1)/usr/lib/bmx6_quagga.so
143 #endef
144
145 $(eval $(call BuildPackage,bmx6))
146 $(eval $(call BuildPackage,bmx6-uci-config))
147 $(eval $(call BuildPackage,bmx6-json))
148 $(eval $(call BuildPackage,bmx6-sms))
149 #$(eval $(call BuildPackage,bmx6-quagga))
150 $(eval $(call BuildPackage,bmx6-table))