libreswan: fix build on macos
[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.6
11 PKG_RELEASE:=2
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_SOURCE_URL:=https://download.libreswan.org/
15 PKG_HASH:=26396f4826a682735772a4689a7ce9ae2d409d166a4b72836fc55d14bad356ff
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 +kmod-xfrm-interface +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_AUTHPAM=false \
80 USE_LIBCAP_NG=true \
81 USE_SYSTEMD_WATCHDOG=false \
82 USE_SECCOMP=false\
83 USE_XFRM_INTERFACE_IFLA_HEADER=false \
84 PREFIX="/usr" \
85 FINALRUNDIR="/var/run/pluto" \
86 FINALNSSDIR="/etc/ipsec.d" \
87 MODPROBEARGS="-q" \
88 OSDEP=linux \
89 BUILDENV=linux \
90 ARCH="$(LINUX_KARCH)" \
91
92 define Build/Prepare
93 $(call Build/Prepare/Default)
94 $(SED) 's,include $$$$(top_srcdir)/mk/manpages.mk,,g' \
95 $(PKG_BUILD_DIR)/mk/program.mk
96 endef
97
98 define Build/Compile
99 $(call Build/Compile/Default,all)
100 endef
101
102 define Package/libreswan/install
103 $(INSTALL_DIR) \
104 $(1)/etc/init.d \
105 $(1)/etc/ipsec.d/policies \
106 $(1)/usr/libexec/ipsec \
107 $(1)/usr/sbin
108
109 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipsec \
110 $(1)/usr/sbin/ipsec
111 $(INSTALL_BIN) ./files/ipsec.init $(1)/etc/init.d/ipsec
112 $(INSTALL_DATA) ./files/ipsec.conf $(1)/etc/ipsec.conf
113 $(INSTALL_DATA) ./files/ipsec.secrets $(1)/etc/ipsec.secrets
114 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/ipsec.d/policies/* \
115 $(1)/etc/ipsec.d/policies/
116 $(CP) $(PKG_INSTALL_DIR)/usr/libexec/ipsec/* \
117 $(1)/usr/libexec/ipsec/
118 endef
119
120 $(eval $(call BuildPackage,libreswan))