bmx: Use repos from https://github.com/bmx-routing and remove bmx7 json-c patch
[feed/routing.git] / bmx7 / Makefile
index 7e8d6a9..8999d8d 100644 (file)
@@ -1,4 +1,3 @@
-#    Copyright (C) 2011 Fundacio Privada per a la Xarxa Oberta, Lliure i Neutral guifi.net
 #
 #    This program is free software; you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
@@ -28,12 +27,11 @@ PKG_NAME:=bmx7
 
 PKG_SOURCE_PROTO:=git
 
-#PKG_SOURCE_URL:=git://bmx6.net/bmx6.git
-PKG_SOURCE_URL:=git://github.com/axn/bmx6.git
-#PKG_SOURCE_URL:=file:///home/neumann/bmx6/bmx6.git
+PKG_SOURCE_URL:=git://github.com/bmx-routing/bmx7.git
+#PKG_SOURCE_URL:=file:///usr/src/bmx-routing/bmx7.git
 
-PKG_REV:=ecfb56ca08af8dbd8004b62b4c8b1966023c9a57
-PKG_VERSION:=r2015082101
+PKG_REV:=a0b18da22d4195afdea82ac080eba02f1121f86b
+PKG_VERSION:=r2018010203
 PKG_RELEASE:=4
 PKG_LICENSE:=GPL-2.0
 
@@ -46,13 +44,13 @@ include $(INCLUDE_DIR)/package.mk
 
 TARGET_CFLAGS += $(FPIC)
 
+MAKE_ARGS += EXTRA_CFLAGS="$(TARGET_CFLAGS) -I. -I$(STAGING_DIR)/usr/include -DCRYPTLIB=MBEDTLS_2_4_0 -DCORE_LIMIT=20000 -DTRAFFIC_DUMP -DNO_TRACE_FUNCTION_CALLS -DBMX7_LIB_IWINFO"
+
 MAKE_ARGS += \
-        EXTRA_CFLAGS="$(TARGET_CFLAGS) -I. -I$(STAGING_DIR)/usr/include -DCRYPTLIB=POLARSSL_1_3_4 -DCORE_LIMIT=20000 -DTRAFFIC_DUMP -DDEBUG_MALLOC" \
-        EXTRA_LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib " \
+        EXTRA_LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib -liwinfo" \
         GIT_REV="$(PKG_REV)" \
         CC="$(TARGET_CC)" \
         INSTALL_DIR="$(PKG_INSTALL_DIR)" \
-        STRIP="/bin/false" \
         build_all
 
 define Package/bmx7/Default
@@ -60,13 +58,13 @@ define Package/bmx7/Default
   CATEGORY:=Network
   SUBMENU:=Routing and Redirection
   TITLE:=BMX7 layer 3 routing daemon
-  URL:=http://bmx6.net/
+  URL:=http://github.com/bmx-routing/bmx7
   MAINTAINER:=Axel Neumann <neumann@cgws.de>
-  DEPENDS:=+zlib +libpolarssl +kmod-ip6-tunnel +kmod-iptunnel6 +kmod-tun @!bmx6
+  DEPENDS:=+zlib +libmbedtls +libiwinfo
 endef
 
 define Package/bmx7/description
-BMX7 layer 3 routing daemon supporting IPv6, and IPv4 over IPv6
+BMX7 routing daemon supporting securely-entrusted IPv6 (and IPv4in6) routing
 endef
 
 define Package/bmx7
@@ -80,6 +78,18 @@ define Package/bmx7-uci-config
   TITLE:=configuration plugin based on uci (recommended!)
 endef
 
+define Package/bmx7-iwinfo
+  $(call Package/bmx7/Default)
+  DEPENDS:=bmx7 +libiwinfo
+  TITLE:=link characteristics plugin based on libiwinfo (recommended!)
+endef
+
+define Package/bmx7-topology
+  $(call Package/bmx7/Default)
+  DEPENDS:=bmx7
+  TITLE:=topology plugin
+endef
+
 define Package/bmx7-json
   $(call Package/bmx7/Default)
   DEPENDS:=bmx7 +libjson-c
@@ -92,16 +102,16 @@ define Package/bmx7-sms
   TITLE:=sms plugin
 endef
 
-#define Package/bmx7-quagga
-#  $(call Package/bmx7/Default)
-#  DEPENDS:=bmx7 +qmp-quagga @BROKEN
-#  TITLE:=bmx7 quagga plugin to redistribute/export routes (needs manet/bmx patched quagga 0.99.21)
-#endef
+define Package/bmx7-tun
+  $(call Package/bmx7/Default)
+  DEPENDS:=bmx7 +kmod-ip6-tunnel +kmod-iptunnel6 +kmod-tun
+  TITLE:=ipip-based tunnel plugin (recommended!)
+endef
 
 define Package/bmx7-table
   $(call Package/bmx7/Default)
-  DEPENDS:=bmx7
-  TITLE:=bmx7 table plugin to automatically announce routing-table routes via ip6ip tunnels
+  DEPENDS:=bmx7 +bmx7-tun
+  TITLE:=plugin to announce routes from tables via tunnels
 endef
 
 define Build/Configure
@@ -114,43 +124,67 @@ endef
 
 define Package/bmx7/install
        $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bmx6 $(1)/usr/sbin/bmx6
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bmx7 $(1)/usr/sbin/bmx7
 endef
 
+define Package/bmx7/postinst
+#!/bin/sh
+# # check if we are on real system
+if [ -z "$${IPKG_INSTROOT}" ]; then
+       if [ -f /etc/sysupgrade.conf ] && ! grep bmx7 /etc/sysupgrade.conf; then
+               echo /etc/bmx7 >> /etc/sysupgrade.conf
+        fi
+fi
+endef
+
+
 define Package/bmx7-uci-config/conffiles
-/etc/config/bmx6
+/etc/config/bmx7
 endef
 
 define Package/bmx7-uci-config/install
        $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/config $(1)/etc/init.d
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_uci_config/bmx6_config.so $(1)/usr/lib/bmx6_config.so
-       $(INSTALL_BIN) ./files/etc/init.d/bmx6 $(1)/etc/init.d/bmx6
-       $(INSTALL_DATA) ./files/etc/config/bmx6 $(1)/etc/config/bmx6
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_uci_config/bmx7_config.so $(1)/usr/lib/bmx7_config.so
+       $(INSTALL_BIN) ./files/etc/init.d/bmx7 $(1)/etc/init.d/bmx7
+       $(INSTALL_DATA) ./files/etc/config/bmx7 $(1)/etc/config/bmx7
+endef
+
+define Package/bmx7-iwinfo/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_iwinfo/bmx7_iwinfo.so $(1)/usr/lib/bmx7_iwinfo.so
+endef
+
+define Package/bmx7-topology/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_topology/bmx7_topology.so $(1)/usr/lib/bmx7_topology.so
 endef
 
 define Package/bmx7-json/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_json/bmx6_json.so $(1)/usr/lib/bmx6_json.so
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_json/bmx7_json.so $(1)/usr/lib/bmx7_json.so
 endef
 
 define Package/bmx7-sms/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_sms/bmx6_sms.so $(1)/usr/lib/bmx6_sms.so
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_sms/bmx7_sms.so $(1)/usr/lib/bmx7_sms.so
+endef
+
+define Package/bmx7-tun/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_tun/bmx7_tun.so $(1)/usr/lib/bmx7_tun.so
 endef
 
 define Package/bmx7-table/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_table/bmx6_table.so $(1)/usr/lib/bmx6_table.so
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx7_table/bmx7_table.so $(1)/usr/lib/bmx7_table.so
 endef
 
-#define Package/bmx7-quagga/install
-#      $(INSTALL_DIR) $(1)/usr/lib
-#      $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_quagga/bmx6_quagga.so $(1)/usr/lib/bmx6_quagga.so
-#endef
 
 $(eval $(call BuildPackage,bmx7))
 $(eval $(call BuildPackage,bmx7-uci-config))
+$(eval $(call BuildPackage,bmx7-iwinfo))
+$(eval $(call BuildPackage,bmx7-topology))
 $(eval $(call BuildPackage,bmx7-json))
 $(eval $(call BuildPackage,bmx7-sms))
-#$(eval $(call BuildPackage,bmx7-quagga))
 $(eval $(call BuildPackage,bmx7-table))
+$(eval $(call BuildPackage,bmx7-tun))