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.

121 lines
3.4 KiB

  1. #
  2. # Copyright (C) 2019 Lucian Cristian <lucian.cristian@gmail.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. PKG_NAME:=libreswan
  8. PKG_VERSION:=3.32
  9. PKG_RELEASE:=2
  10. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  11. PKG_SOURCE_URL:=https://download.libreswan.org/
  12. PKG_HASH:=236b57fee8f562302c54f2b16d8a839a9039fcb5893668e61b398ec6b179432e
  13. PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
  14. PKG_LICENSE:=GPL-2.0-or-later
  15. PKG_LICENSE_FILES:=COPYING LICENSE
  16. PKG_CPE_ID:=cpe:/a:libreswan:libreswan
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/libreswan/Default
  21. TITLE:=Libreswan
  22. URL:=https://libreswan.org/
  23. endef
  24. define Package/libreswan/Default/description
  25. Libreswan is a free software implementation of the most widely supported and
  26. standardized VPN protocol based on ("IPsec") and the Internet Key Exchange
  27. ("IKE"). These standards are produced and maintained by the Internet
  28. Engineering Task Force ("IETF").
  29. endef
  30. define Package/libreswan
  31. $(call Package/libreswan/Default)
  32. SUBMENU:=VPN
  33. SECTION:=net
  34. CATEGORY:=Network
  35. DEPENDS:= +IPV6:kmod-ip6-vti +IPV6:kmod-ipsec6 +ip-full +iptables-mod-ipsec \
  36. +kmod-crypto-aead +kmod-crypto-authenc +kmod-crypto-gcm \
  37. +kmod-crypto-hash +kmod-crypto-rng +kmod-ip-vti +kmod-ipsec \
  38. +kmod-ipsec4 +kmod-ipt-ipsec +libevent2 +libevent2-pthreads \
  39. +libldns +librt +libunbound-heavy +nss-utils +nspr +libcap-ng
  40. PROVIDES:=openswan
  41. CONFLICTS:=strongswan
  42. TITLE+= IPsec Server
  43. endef
  44. define Package/libreswan/description
  45. $(call Package/libreswan/Default/description)
  46. Libreswan is a free software implementation of the most widely supported and
  47. standardized VPN protocol based on ("IPsec") and the Internet Key Exchange
  48. ("IKE"). These standards are produced and maintained by the Internet
  49. Engineering Task Force ("IETF").
  50. endef
  51. define Package/libreswan/conffiles
  52. /etc/ipsec.d
  53. /etc/ipsec.conf
  54. /etc/ipsec.secrets
  55. endef
  56. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  57. TARGET_CFLAGS += -flto
  58. MAKE_FLAGS+= \
  59. WERROR_CFLAGS=" " \
  60. NSS_REQ_AVA_COPY=false \
  61. USE_LINUX_AUDIT=false \
  62. USE_LABELED_IPSEC=false \
  63. USE_NM=false \
  64. USE_NSS_KDF=true \
  65. USE_NSS_PRF=true \
  66. USE_LIBCURL=false \
  67. USE_GLIBC_KERN_FLIP_HEADERS=true \
  68. USE_XAUTHPAM=false \
  69. USE_LIBCAP_NG=true \
  70. USE_SYSTEMD_WATCHDOG=false \
  71. USE_SECCOMP=false\
  72. INC_USRLOCAL="/usr" \
  73. FINALRUNDIR="/var/run/pluto" \
  74. MODPROBEARGS="-q" \
  75. ARCH="$(LINUX_KARCH)" \
  76. ifdef CONFIG_LINUX_4_14
  77. MAKE_FLAGS+= USE_XFRM_INTERFACE_IFLA_HEADER=true
  78. endif
  79. define Build/Prepare
  80. $(call Build/Prepare/Default)
  81. $(SED) 's,include $$$$(top_srcdir)/mk/manpages.mk,,g' \
  82. $(PKG_BUILD_DIR)/mk/program.mk
  83. endef
  84. define Build/Compile
  85. $(call Build/Compile/Default,all)
  86. endef
  87. define Package/libreswan/install
  88. $(INSTALL_DIR) \
  89. $(1)/etc/init.d \
  90. $(1)/etc/ipsec.d/policies \
  91. $(1)/usr/libexec/ipsec \
  92. $(1)/usr/sbin
  93. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipsec \
  94. $(1)/usr/sbin/ipsec
  95. $(INSTALL_BIN) ./files/ipsec.init $(1)/etc/init.d/ipsec
  96. $(INSTALL_DATA) ./files/ipsec.conf $(1)/etc/ipsec.conf
  97. $(INSTALL_DATA) ./files/ipsec.secrets $(1)/etc/ipsec.secrets
  98. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/ipsec.d/policies/* \
  99. $(1)/etc/ipsec.d/policies/
  100. $(CP) $(PKG_INSTALL_DIR)/usr/libexec/ipsec/* \
  101. $(1)/usr/libexec/ipsec/
  102. endef
  103. $(eval $(call BuildPackage,libreswan))