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.

132 lines
3.3 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.5
  10. PKG_RELEASE:=1
  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:=ec130a3659acff5450e74924d5f9da52540539fc213b5842fb3a8fd7d919ccf9
  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 Package/jool
  54. $(call Package/jool/Default)
  55. TITLE:=Jool meta-package
  56. DEPENDS:=+kmod-jool +jool-tools
  57. BUILDONLY:=1
  58. endef
  59. define Package/jool/description
  60. $(call Package/jool/Default/description)
  61. endef
  62. define KernelPackage/jool
  63. SECTION:=kernel
  64. CATEGORY:=Kernel modules
  65. SUBMENU:=Network Support
  66. TITLE:=Jool kernel module
  67. DEPENDS:= \
  68. @IPV6 \
  69. +kmod-crypto-md5 \
  70. +kmod-nf-conntrack \
  71. +kmod-nf-conntrack6 \
  72. +kmod-nf-ipt
  73. FILES:= \
  74. $(PKG_BUILD_DIR)/src/mod/common/jool_common.$(LINUX_KMOD_SUFFIX) \
  75. $(PKG_BUILD_DIR)/src/mod/nat64/jool.$(LINUX_KMOD_SUFFIX) \
  76. $(PKG_BUILD_DIR)/src/mod/siit/jool_siit.$(LINUX_KMOD_SUFFIX)
  77. endef
  78. define KernelPackage/jool/description
  79. $(call Package/jool/Default/description)
  80. This package provides the kernel module for Jool.
  81. endef
  82. define Package/jool-tools
  83. $(call Package/jool/Default)
  84. TITLE:=Jool userspace control programs
  85. DEPENDS:=+libnl +libxtables
  86. endef
  87. define Package/jool-tools/description
  88. $(call Package/jool/Default/description)
  89. This package provides the userspace control programs for Jool.
  90. endef
  91. CONFIGURE_ARGS += \
  92. --disable-shared \
  93. --without-bash-completion-dir
  94. CONFIGURE_VARS += \
  95. ac_cv_func_memset=yes \
  96. ac_cv_func_strcasecmp=yes
  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. endef
  108. $(eval $(call BuildPackage,jool))
  109. $(eval $(call KernelPackage,jool))
  110. $(eval $(call BuildPackage,jool-tools))