blob: d7e8b259618240805c732314c3b36628e00ecabf [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001DESCRIPTION = "IPsec-Tools is a port of KAME's IPsec utilities to the \
2Linux-2.6 IPsec implementation."
3HOMEPAGE = "http://ipsec-tools.sourceforge.net/"
4SECTION = "net"
5LICENSE = "BSD"
6LIC_FILES_CHKSUM = "file://src/libipsec/pfkey.c;beginline=6;endline=31;md5=bc9b7ff40beff19fe6bc6aef26bd2b24"
7
8DEPENDS = "virtual/kernel openssl readline flex-native bison-native"
9
10PACKAGE_ARCH = "${MACHINE_ARCH}"
11
Brad Bishop7f28bc52017-12-03 23:42:40 -050012SRC_URI = "http://ftp.netbsd.org/pub/NetBSD/misc/ipsec-tools/0.8/ipsec-tools-${PV}.tar.bz2 \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050013 file://0002-Don-t-link-against-libfl.patch \
14 file://configure.patch \
15 file://0001-racoon-pfkey-avoid-potential-null-pointer-dereferenc.patch \
16 file://racoon-check-invalid-pointers.patch \
17 file://racoon-check-invalid-ivm.patch \
18 file://glibc-2.20.patch \
19 file://racoon-Resend-UPDATE-message-when-received-EINTR-message.patch \
20 file://racoon.conf.sample \
21 file://racoon.conf \
22 file://racoon.service \
23 file://fix-CVE-2015-4047.patch \
Brad Bishop7f28bc52017-12-03 23:42:40 -050024 file://0001-Fix-build-with-clang.patch \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050025 file://0001-Fix-header-issues-found-with-musl-libc.patch \
26 file://0002-cfparse-clear-memory-equal-to-size-of-array.patch \
27 "
Patrick Williamsb48b7b42016-08-17 15:04:38 -050028SRC_URI[md5sum] = "d53ec14a0a3ece64e09e5e34b3350b41"
29SRC_URI[sha256sum] = "8eb6b38716e2f3a8a72f1f549c9444c2bc28d52c9536792690564c74fe722f2d"
30
31inherit autotools systemd
32
33# Options:
34# --enable-adminport enable admin port
35# --enable-rc5 enable RC5 encryption (patented)
36# --enable-idea enable IDEA encryption (patented)
37# --enable-gssapi enable GSS-API authentication
38# --enable-hybrid enable hybrid, both mode-cfg and xauth support
39# --enable-frag enable IKE fragmentation payload support
40# --enable-stats enable statistics logging function
41# --enable-dpd enable dead peer detection
42# --enable-samode-unspec enable to use unspecified a mode of SA
43# --disable-ipv6 disable ipv6 support
44# --enable-natt enable NAT-Traversal (yes/no/kernel)
45# --enable-natt-versions=list list of supported NAT-T versions delimited by coma.
46# --with-kernel-headers=/lib/modules/<uname>/build/include
47# where your Linux Kernel headers are installed
48# --with-readline support readline input (yes by default)
49# --with-flex use directiory (default: no)
50# --with-flexlib=<LIB> specify flex library.
51# --with-openssl=DIR specify OpenSSL directory
52# --with-libradius=DIR specify libradius path (like/usr/pkg)
53# --with-libpam=DIR specify libpam path (like/usr/pkg)
54#
55# Note: if you give it the actual kernel headers it won't build, it actually
56# needs to point at the linux-libc-headers version of the kernel headers.
57#
58EXTRA_OECONF = "--with-kernel-headers=${STAGING_INCDIR} \
59 --with-readline \
60 --with-openssl=${STAGING_LIBDIR}/.. \
61 --without-libradius \
62 --disable-security-context \
63 --enable-shared \
64 --enable-dpd \
65 --enable-natt=yes \
66 --sysconfdir=${sysconfdir}/racoon \
Patrick Williamsddad1a12017-02-23 20:36:32 -060067 ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', '--enable-ipv6=yes', '', d)}"
Patrick Williamsb48b7b42016-08-17 15:04:38 -050068
69# See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=530527
70CFLAGS += "-fno-strict-aliasing"
71
72PACKAGECONFIG ??= ""
73PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam,"
74PACKAGECONFIG[selinux] = "--enable-security-context,--disable-security-context,libselinux,"
75
76SYSTEMD_SERVICE_${PN} = "racoon.service"
77
78do_install_append() {
79 install -d ${D}${sysconfdir}/racoon
80 install -m 0644 ${WORKDIR}/racoon.conf.sample ${D}${sysconfdir}/racoon/racoon.conf
81
82 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
83 install -d ${D}${systemd_unitdir}/system
84 install -m 0644 ${WORKDIR}/racoon.service ${D}${systemd_unitdir}/system
85
86 sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/racoon.service
87 sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/racoon.service
88
89 install -d ${D}${sysconfdir}/default/
90 install -m 0644 ${WORKDIR}/racoon.conf ${D}${sysconfdir}/default/racoon
91 fi
92}
93
94FILES_${PN} += "${sysconfdir}/racoon/racoon.conf \
95 ${sysconfdir}/default/racoon"