Makefile 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. include $(TOPDIR)/rules.mk
  24. PKG_NAME:=bmx6
  25. PKG_SOURCE_PROTO:=git
  26. PKG_SOURCE_URL:=https://github.com/bmx-routing/bmx6.git
  27. PKG_REV:=0312168aaa384379ccbefd4b2d936fc698664d5b
  28. PKG_MIRROR_HASH:=98acdbda8a8cadadf8141c7b8a17b6417112f70f3211b86abad23a8c7a28be10
  29. PKG_VERSION:=r2018020902
  30. PKG_RELEASE:=5
  31. PKG_LICENSE:=GPL-2.0
  32. PKG_SOURCE_VERSION:=$(PKG_REV)
  33. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  34. PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
  35. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
  36. include $(INCLUDE_DIR)/package.mk
  37. TARGET_CFLAGS += $(FPIC)
  38. MAKE_ARGS += \
  39. EXTRA_CFLAGS="$(TARGET_CFLAGS) -I. -I$(STAGING_DIR)/usr/include -DNO_DEBUG_ALL -DNO_DEBUG_DUMP" \
  40. EXTRA_LDFLAGS="-L$(STAGING_DIR)/usr/lib " \
  41. GIT_REV="$(PKG_REV)" \
  42. CC="$(TARGET_CC)" \
  43. INSTALL_DIR="$(PKG_INSTALL_DIR)" \
  44. STRIP="/bin/false" \
  45. build_all
  46. define Package/bmx6/Default
  47. SECTION:=net
  48. CATEGORY:=Network
  49. SUBMENU:=Routing and Redirection
  50. TITLE:=BMX6 layer 3 routing daemon
  51. URL:=http://bmx6.net/
  52. MAINTAINER:=Axel Neumann <neumann@cgws.de>
  53. DEPENDS:=+kmod-ip6-tunnel +kmod-iptunnel6 +kmod-tun
  54. endef
  55. define Package/bmx6/description
  56. BMX6 layer 3 routing daemon supporting IPv4, IPv6, and IPv4 over IPv6
  57. endef
  58. define Package/bmx6
  59. $(call Package/bmx6/Default)
  60. MENU:=1
  61. endef
  62. define Package/bmx6-uci-config
  63. $(call Package/bmx6/Default)
  64. DEPENDS:=bmx6 +libuci
  65. TITLE:=configuration plugin based on uci (recommended!)
  66. endef
  67. define Package/bmx6-json
  68. $(call Package/bmx6/Default)
  69. DEPENDS:=bmx6 +libjson-c
  70. TITLE:=json plugin based on json-c
  71. endef
  72. define Package/bmx6-sms
  73. $(call Package/bmx6/Default)
  74. DEPENDS:=bmx6
  75. TITLE:=sms plugin
  76. endef
  77. #define Package/bmx6-quagga
  78. # $(call Package/bmx6/Default)
  79. # DEPENDS:=bmx6 +qmp-quagga @BROKEN
  80. # TITLE:=bmx6 quagga plugin to redistribute/export routes (needs manet/bmx6 patched quagga 0.99.21)
  81. #endef
  82. define Package/bmx6-table
  83. $(call Package/bmx6/Default)
  84. DEPENDS:=bmx6
  85. TITLE:=bmx6 table plugin to automatic announce routing-table routes via ip6ip tunnels
  86. endef
  87. define Build/Configure
  88. mkdir -p $(PKG_INSTALL_DIR)
  89. endef
  90. define Build/Compile
  91. $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_ARGS)
  92. endef
  93. define Package/bmx6/install
  94. $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
  95. $(INSTALL_BIN) $(PKG_BUILD_DIR)/bmx6 $(1)/usr/sbin/bmx6
  96. endef
  97. define Package/bmx6-uci-config/conffiles
  98. /etc/config/bmx6
  99. endef
  100. define Package/bmx6-uci-config/install
  101. $(INSTALL_DIR) $(1)/usr/lib $(1)/etc/config $(1)/etc/init.d
  102. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_uci_config/bmx6_config.so $(1)/usr/lib/bmx6_config.so
  103. $(INSTALL_BIN) ./files/etc/init.d/bmx6 $(1)/etc/init.d/bmx6
  104. $(INSTALL_DATA) ./files/etc/config/bmx6 $(1)/etc/config/bmx6
  105. endef
  106. define Package/bmx6-json/install
  107. $(INSTALL_DIR) $(1)/usr/lib
  108. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_json/bmx6_json.so $(1)/usr/lib/bmx6_json.so
  109. endef
  110. define Package/bmx6-sms/install
  111. $(INSTALL_DIR) $(1)/usr/lib
  112. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_sms/bmx6_sms.so $(1)/usr/lib/bmx6_sms.so
  113. endef
  114. define Package/bmx6-table/install
  115. $(INSTALL_DIR) $(1)/usr/lib
  116. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_table/bmx6_table.so $(1)/usr/lib/bmx6_table.so
  117. endef
  118. #define Package/bmx6-quagga/install
  119. # $(INSTALL_DIR) $(1)/usr/lib
  120. # $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_quagga/bmx6_quagga.so $(1)/usr/lib/bmx6_quagga.so
  121. #endef
  122. $(eval $(call BuildPackage,bmx6))
  123. $(eval $(call BuildPackage,bmx6-uci-config))
  124. $(eval $(call BuildPackage,bmx6-json))
  125. $(eval $(call BuildPackage,bmx6-sms))
  126. #$(eval $(call BuildPackage,bmx6-quagga))
  127. $(eval $(call BuildPackage,bmx6-table))