You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
3.7 KiB

  1. #
  2. # Copyright (C) 2016-2017 Dan Luedtke <mail@danrl.com>
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. include $(TOPDIR)/rules.mk
  7. include $(INCLUDE_DIR)/kernel.mk
  8. PKG_NAME:=jool
  9. PKG_VERSION:=4.1.6
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://github.com/NICMx/Jool/releases/download/v$(PKG_VERSION)
  13. PKG_HASH:=dccfde88e3b97a7d1c44c53b6541b74873a04f50bb8cfd187eb399d5ae8d2c81
  14. PKG_MAINTAINER:=
  15. PKG_LICENSE:=GPL-2.0-only
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_INSTALL:=1
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone
  20. include $(INCLUDE_DIR)/package.mk
  21. define Build/Compile
  22. $(MAKE) -C "$(LINUX_DIR)" \
  23. KERNEL_DIR="$(LINUX_DIR)" \
  24. ARCH="$(LINUX_KARCH)" \
  25. CROSS_COMPILE="$(TARGET_CROSS)" \
  26. M="$(PKG_BUILD_DIR)/src/mod/common" \
  27. V="$(V)" \
  28. modules
  29. $(MAKE) -C "$(LINUX_DIR)" \
  30. KERNEL_DIR="$(LINUX_DIR)" \
  31. ARCH="$(LINUX_KARCH)" \
  32. CROSS_COMPILE="$(TARGET_CROSS)" \
  33. M="$(PKG_BUILD_DIR)/src/mod/nat64" \
  34. V="$(V)" \
  35. modules
  36. $(MAKE) -C "$(LINUX_DIR)" \
  37. KERNEL_DIR="$(LINUX_DIR)" \
  38. ARCH="$(LINUX_KARCH)" \
  39. CROSS_COMPILE="$(TARGET_CROSS)" \
  40. M="$(PKG_BUILD_DIR)/src/mod/siit" \
  41. V="$(V)" \
  42. modules
  43. $(call Build/Compile/Default)
  44. endef
  45. define Package/jool/Default
  46. SECTION:=net
  47. CATEGORY:=Network
  48. URL:=https://www.jool.mx
  49. endef
  50. define Package/jool/Default/description
  51. Jool is an Open Source SIIT and NAT64 for Linux.
  52. endef
  53. define KernelPackage/jool
  54. SECTION:=kernel
  55. CATEGORY:=Kernel modules
  56. SUBMENU:=Network Support
  57. TITLE:=Jool kernel module
  58. DEPENDS:= \
  59. @IPV6 \
  60. +kmod-crypto-md5 \
  61. +kmod-nf-conntrack \
  62. +kmod-nf-conntrack6 \
  63. +kmod-nf-ipt
  64. FILES:= \
  65. $(PKG_BUILD_DIR)/src/mod/common/jool_common.$(LINUX_KMOD_SUFFIX) \
  66. $(PKG_BUILD_DIR)/src/mod/nat64/jool.$(LINUX_KMOD_SUFFIX) \
  67. $(PKG_BUILD_DIR)/src/mod/siit/jool_siit.$(LINUX_KMOD_SUFFIX)
  68. JOOL_AUTOLOAD:= \
  69. jool \
  70. jool_siit
  71. AUTOLOAD:=$(call AutoLoad,46,jool_common)
  72. AUTOLOAD:=$(call AutoLoad,48,$(JOOL_AUTOLOAD))
  73. endef
  74. define KernelPackage/jool/description
  75. $(call Package/jool/Default/description)
  76. This package provides the kernel module for Jool.
  77. endef
  78. define Package/jool-tools
  79. $(call Package/jool/Default)
  80. TITLE:=Jool userspace control programs
  81. DEPENDS:=+kmod-jool +libnl +libxtables
  82. endef
  83. define Package/jool-tools/description
  84. $(call Package/jool/Default/description)
  85. This package provides the userspace control programs for Jool.
  86. endef
  87. CONFIGURE_ARGS += \
  88. --disable-shared \
  89. --without-bash-completion-dir
  90. CONFIGURE_VARS += \
  91. ac_cv_func_memset=yes \
  92. ac_cv_func_strcasecmp=yes
  93. JOOL_AUTOLOAD:= \
  94. jool_common \
  95. jool \
  96. jool_siit
  97. define Package/jool-tools/install
  98. $(INSTALL_DIR) $(1)/usr/bin/
  99. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/jool $(1)/usr/bin/
  100. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/joold $(1)/usr/bin/
  101. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/jool_siit $(1)/usr/bin/
  102. $(INSTALL_DIR) $(1)/usr/lib/iptables
  103. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/iptables/libxt_JOOL_SIIT.so \
  104. $(1)/usr/lib/iptables
  105. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/iptables/libxt_JOOL.so \
  106. $(1)/usr/lib/iptables
  107. $(INSTALL_DIR) $(1)/etc/config
  108. $(INSTALL_CONF) ./files/jool.config $(1)/etc/config/jool
  109. $(INSTALL_DIR) $(1)/etc/init.d
  110. $(INSTALL_BIN) ./files/jool.init $(1)/etc/init.d/jool
  111. $(INSTALL_DIR) $(1)/etc/jool
  112. $(INSTALL_DATA) ./files/jool-nat64.conf.json $(1)/etc/jool/jool-nat64.conf.json.default
  113. $(INSTALL_DATA) ./files/jool-siit.conf.json $(1)/etc/jool/jool-siit.conf.json.default
  114. $(INSTALL_DATA) ./files/readme.md $(1)/etc/jool/readme.md
  115. endef
  116. $(eval $(call KernelPackage,jool))
  117. $(eval $(call BuildPackage,jool-tools))