blob: a28c73ab5ae978e72a9e6521738b8350f5df9dc8 [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001SUMMARY = "A full-featured SSL VPN solution via tun device."
2HOMEPAGE = "https://openvpn.net/"
3SECTION = "net"
4LICENSE = "GPL-2.0-only"
5LIC_FILES_CHKSUM = "file://COPYING;md5=b76abd82c14ee01cc34c4ff5e3627b89"
6DEPENDS = "lzo openssl iproute2 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
7
Andrew Geissler615f2f12022-07-15 14:00:58 -05008inherit autotools systemd update-rc.d pkgconfig
Andrew Geissler9aee5002022-03-30 16:27:02 +00009
10SRC_URI = "http://swupdate.openvpn.org/community/releases/${BP}.tar.gz \
Andrew Geissler615f2f12022-07-15 14:00:58 -050011 file://0001-configure.ac-eliminate-build-path-from-openvpn-versi.patch \
Andrew Geissler9aee5002022-03-30 16:27:02 +000012 file://openvpn \
Andrew Geissler615f2f12022-07-15 14:00:58 -050013 "
Andrew Geissler9aee5002022-03-30 16:27:02 +000014
15UPSTREAM_CHECK_URI = "https://openvpn.net/community-downloads"
16
Andrew Geissler78b72792022-06-14 06:47:25 -050017SRC_URI[sha256sum] = "08340a389905c84196b6cd750add1bc0fa2d46a1afebfd589c24120946c13e68"
Andrew Geissler9aee5002022-03-30 16:27:02 +000018
19# CVE-2020-7224 and CVE-2020-27569 are for Aviatrix OpenVPN client, not for openvpn.
20CVE_CHECK_IGNORE += "CVE-2020-7224 CVE-2020-27569"
21
Andrew Geissler9aee5002022-03-30 16:27:02 +000022INITSCRIPT_PACKAGES = "${PN}"
23INITSCRIPT_NAME:${PN} = "openvpn"
24INITSCRIPT_PARAMS:${PN} = "start 10 2 3 4 5 . stop 70 0 1 6 ."
25
26CFLAGS += "-fno-inline"
27
28# I want openvpn to be able to read password from file (hrw)
29EXTRA_OECONF += "--enable-iproute2"
30EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '', '--disable-plugin-auth-pam', d)}"
31
32# Explicitly specify IPROUTE to bypass the configure-time check for /sbin/ip on the host.
33EXTRA_OECONF += "IPROUTE=${base_sbindir}/ip"
34
Andrew Geissler615f2f12022-07-15 14:00:58 -050035EXTRA_OECONF += "SYSTEMD_UNIT_DIR=${systemd_system_unitdir} \
36 TMPFILES_DIR=${nonarch_libdir}/tmpfiles.d \
37 "
38
39PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
40 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
41 "
42
43PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"
44PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux"
45
Andrew Geissler9aee5002022-03-30 16:27:02 +000046do_install:append() {
47 install -d ${D}/${sysconfdir}/init.d
48 install -m 755 ${WORKDIR}/openvpn ${D}/${sysconfdir}/init.d
49
50 install -d ${D}/${sysconfdir}/openvpn
Andrew Geissler615f2f12022-07-15 14:00:58 -050051 install -d ${D}/${sysconfdir}/openvpn/server
52 install -d ${D}/${sysconfdir}/openvpn/client
53
Andrew Geissler9aee5002022-03-30 16:27:02 +000054 install -d ${D}/${sysconfdir}/openvpn/sample
Andrew Geissler615f2f12022-07-15 14:00:58 -050055 install -m 644 ${S}/sample/sample-config-files/loopback-server ${D}${sysconfdir}/openvpn/sample/loopback-server.conf
56 install -m 644 ${S}/sample/sample-config-files/loopback-client ${D}${sysconfdir}/openvpn/sample/loopback-client.conf
57 install -dm 755 ${D}${sysconfdir}/openvpn/sample/sample-config-files
Andrew Geissler9aee5002022-03-30 16:27:02 +000058 install -dm 755 ${D}${sysconfdir}/openvpn/sample/sample-keys
Andrew Geissler615f2f12022-07-15 14:00:58 -050059 install -dm 755 ${D}${sysconfdir}/openvpn/sample/sample-scripts
60 install -m 644 ${S}/sample/sample-config-files/* ${D}${sysconfdir}/openvpn/sample/sample-config-files
Andrew Geissler9aee5002022-03-30 16:27:02 +000061 install -m 644 ${S}/sample/sample-keys/* ${D}${sysconfdir}/openvpn/sample/sample-keys
Andrew Geissler615f2f12022-07-15 14:00:58 -050062 install -m 644 ${S}/sample/sample-scripts/* ${D}${sysconfdir}/openvpn/sample/sample-scripts
Andrew Geissler9aee5002022-03-30 16:27:02 +000063
Andrew Geissler615f2f12022-07-15 14:00:58 -050064 install -d -m 710 ${D}/${localstatedir}/lib/openvpn
Andrew Geissler9aee5002022-03-30 16:27:02 +000065}
66
67PACKAGES =+ " ${PN}-sample "
68
69RRECOMMENDS:${PN} = "kernel-module-tun"
70
71FILES:${PN}-dbg += "${libdir}/openvpn/plugins/.debug"
Andrew Geissler615f2f12022-07-15 14:00:58 -050072FILES:${PN} += "${systemd_system_unitdir}/openvpn-server@.service \
73 ${systemd_system_unitdir}/openvpn-client@.service \
74 ${nonarch_libdir}/tmpfiles.d \
Andrew Geissler9aee5002022-03-30 16:27:02 +000075 "
Andrew Geissler615f2f12022-07-15 14:00:58 -050076FILES:${PN}-sample = "${sysconfdir}/openvpn/sample/ \
77 "