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