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:=2022-01-20
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_LICENSE:=GPL-2.0-only
  12. PKG_LICENSE_FILES:=COPYING
  13. PKG_SOURCE_PROTO:=git
  14. PKG_SOURCE_URL:=https://github.com/NICMx/Jool.git
  15. PKG_SOURCE_VERSION:=04ef98dd6c7528fc25f68bef304fb74c59cb7083
  16. PKG_MIRROR_HASH:=f17551f8ab80a75b6d7f4b5d9208013a4a8101298b80ae9adaa2892db30ac385
  17. PKG_BUILD_DIR=$(KERNEL_BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone
  20. PKG_FIXUP:=autoreconf
  21. MAKE_PATH:=src/usr
  22. CONFIGURE_PATH:=src/usr
  23. include $(INCLUDE_DIR)/package.mk
  24. define Build/Compile
  25. $(MAKE) -C "$(LINUX_DIR)" \
  26. KERNEL_DIR="$(LINUX_DIR)" \
  27. ARCH="$(LINUX_KARCH)" \
  28. CROSS_COMPILE="$(TARGET_CROSS)" \
  29. M="$(PKG_BUILD_DIR)/src/mod/common" \
  30. V="$(V)" \
  31. CFLAGS_MODULE=$(NOXTABLES) \
  32. modules
  33. $(MAKE) -C "$(LINUX_DIR)" \
  34. KERNEL_DIR="$(LINUX_DIR)" \
  35. ARCH="$(LINUX_KARCH)" \
  36. CROSS_COMPILE="$(TARGET_CROSS)" \
  37. M="$(PKG_BUILD_DIR)/src/mod/nat64" \
  38. CFLAGS_MODULE=$(NOXTABLES) \
  39. V="$(V)" \
  40. modules
  41. $(MAKE) -C "$(LINUX_DIR)" \
  42. KERNEL_DIR="$(LINUX_DIR)" \
  43. ARCH="$(LINUX_KARCH)" \
  44. CROSS_COMPILE="$(TARGET_CROSS)" \
  45. M="$(PKG_BUILD_DIR)/src/mod/siit" \
  46. CFLAGS_MODULE=$(NOXTABLES) \
  47. V="$(V)" \
  48. modules
  49. $(call Build/Compile/Default)
  50. endef
  51. define Build/Configure
  52. (cd $(PKG_BUILD_DIR); ./autogen.sh );
  53. $(call Build/Configure/Default, --with-xtables=no)
  54. endef
  55. define Package/jool/Default
  56. SECTION:=net
  57. CATEGORY:=Network
  58. URL:=https://www.jool.mx
  59. endef
  60. define Package/jool/Default/description
  61. Jool is an Open Source SIIT and NAT64 for Linux.
  62. endef
  63. define KernelPackage/jool-netfilter
  64. SECTION:=kernel
  65. CATEGORY:=Kernel modules
  66. SUBMENU:=Network Support
  67. TITLE:=Jool kernel module
  68. DEPENDS:= \
  69. @IPV6 \
  70. +kmod-crypto-md5 \
  71. +kmod-nf-conntrack \
  72. +kmod-nf-conntrack6
  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. AUTOLOAD:=$(call AutoLoad,48,$(JOOL_AUTOLOAD))
  78. endef
  79. define KernelPackage/jool-netfilter/description
  80. $(call Package/jool/Default/description)
  81. This package provides the kernel module for Jool with netfilter API Only.
  82. endef
  83. define Package/jool-tools-netfilter
  84. $(call Package/jool/Default)
  85. TITLE:=Jool userspace control programs
  86. DEPENDS:=+libnl +kmod-jool-netfilter
  87. endef
  88. define Package/jool-tools-netfilter/description
  89. $(call Package/jool/Default/description)
  90. This package provides the userspace control programs for Jool.
  91. endef
  92. JOOL_AUTOLOAD:= \
  93. jool \
  94. jool_siit
  95. NOXTABLES:=-DXTABLES_DISABLED
  96. define Package/jool-tools-netfilter/conffiles
  97. /etc/config/jool
  98. /etc/jool/jool-nat64.conf.json
  99. /etc/jool/jool-siit.conf.json
  100. endef
  101. define Package/jool-tools-netfilter/install
  102. $(INSTALL_DIR) $(1)/usr/bin/
  103. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/usr/nat64/jool $(1)/usr/bin/
  104. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/usr/joold/joold $(1)/usr/bin/
  105. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/usr/siit/jool_siit $(1)/usr/bin/
  106. $(INSTALL_DIR) $(1)/etc/config
  107. $(INSTALL_CONF) ./files/jool.config $(1)/etc/config/jool
  108. $(INSTALL_DIR) $(1)/etc/init.d
  109. $(INSTALL_BIN) ./files/jool.init $(1)/etc/init.d/jool
  110. $(INSTALL_DIR) $(1)/etc/jool
  111. $(INSTALL_CONF) ./files/jool-nat64.conf.json $(1)/etc/jool/jool-nat64.conf.json
  112. $(INSTALL_CONF) ./files/jool-siit.conf.json $(1)/etc/jool/jool-siit.conf.json
  113. $(INSTALL_DATA) ./files/readme.md $(1)/etc/jool/readme.md
  114. endef
  115. $(eval $(call KernelPackage,jool-netfilter))
  116. $(eval $(call BuildPackage,jool-tools-netfilter))