diff options
Diffstat (limited to 'meta-networking/recipes-support/openvpn/openvpn_2.4.7.bb')
-rw-r--r-- | meta-networking/recipes-support/openvpn/openvpn_2.4.7.bb | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/openvpn/openvpn_2.4.7.bb b/meta-networking/recipes-support/openvpn/openvpn_2.4.7.bb new file mode 100644 index 000000000..2a4eb2528 --- /dev/null +++ b/meta-networking/recipes-support/openvpn/openvpn_2.4.7.bb | |||
@@ -0,0 +1,71 @@ | |||
1 | SUMMARY = "A full-featured SSL VPN solution via tun device." | ||
2 | HOMEPAGE = "https://openvpn.net/" | ||
3 | SECTION = "net" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=7aee596ed2deefe3e8a861e24292abba" | ||
6 | DEPENDS = "lzo openssl iproute2 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | ||
7 | |||
8 | inherit autotools systemd update-rc.d | ||
9 | |||
10 | SRC_URI = "http://swupdate.openvpn.org/community/releases/${BP}.tar.gz \ | ||
11 | file://openvpn \ | ||
12 | file://openvpn@.service \ | ||
13 | file://openvpn-volatile.conf" | ||
14 | |||
15 | SRC_URI[md5sum] = "9d67cabc9b0441062ebd4e12bb7dfedb" | ||
16 | SRC_URI[sha256sum] = "73dce542ed3d6f0553674f49025dfbdff18348eb8a25e6215135d686b165423c" | ||
17 | |||
18 | SYSTEMD_SERVICE_${PN} += "openvpn@loopback-server.service openvpn@loopback-client.service" | ||
19 | SYSTEMD_AUTO_ENABLE = "disable" | ||
20 | |||
21 | INITSCRIPT_PACKAGES = "${PN}" | ||
22 | INITSCRIPT_NAME_${PN} = "openvpn" | ||
23 | INITSCRIPT_PARAMS_${PN} = "start 10 2 3 4 5 . stop 70 0 1 6 ." | ||
24 | |||
25 | CFLAGS += "-fno-inline" | ||
26 | |||
27 | # I want openvpn to be able to read password from file (hrw) | ||
28 | EXTRA_OECONF += "--enable-iproute2" | ||
29 | EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '', '--disable-plugin-auth-pam', d)}" | ||
30 | |||
31 | # Explicitly specify IPROUTE to bypass the configure-time check for /sbin/ip on the host. | ||
32 | EXTRA_OECONF += "IPROUTE=${base_sbindir}/ip" | ||
33 | |||
34 | do_install_append() { | ||
35 | install -d ${D}/${sysconfdir}/init.d | ||
36 | install -m 755 ${WORKDIR}/openvpn ${D}/${sysconfdir}/init.d | ||
37 | |||
38 | install -d ${D}/${sysconfdir}/openvpn | ||
39 | install -d ${D}/${sysconfdir}/openvpn/sample | ||
40 | install -m 755 ${S}/sample/sample-config-files/loopback-server ${D}${sysconfdir}/openvpn/sample/loopback-server.conf | ||
41 | install -m 755 ${S}/sample/sample-config-files/loopback-client ${D}${sysconfdir}/openvpn/sample/loopback-client.conf | ||
42 | install -dm 755 ${D}${sysconfdir}/openvpn/sample/sample-keys | ||
43 | install -m 644 ${S}/sample/sample-keys/* ${D}${sysconfdir}/openvpn/sample/sample-keys | ||
44 | |||
45 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | ||
46 | install -d ${D}/${systemd_unitdir}/system | ||
47 | install -m 644 ${WORKDIR}/openvpn@.service ${D}/${systemd_unitdir}/system | ||
48 | install -m 644 ${WORKDIR}/openvpn@.service ${D}/${systemd_unitdir}/system/openvpn@loopback-server.service | ||
49 | install -m 644 ${WORKDIR}/openvpn@.service ${D}/${systemd_unitdir}/system/openvpn@loopback-client.service | ||
50 | |||
51 | install -d ${D}/${localstatedir} | ||
52 | install -d ${D}/${localstatedir}/lib | ||
53 | install -d -m 710 ${D}/${localstatedir}/lib/openvpn | ||
54 | |||
55 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
56 | install -m 0644 ${WORKDIR}/openvpn-volatile.conf ${D}${sysconfdir}/tmpfiles.d/openvpn.conf | ||
57 | sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${sysconfdir}/tmpfiles.d/openvpn.conf | ||
58 | fi | ||
59 | } | ||
60 | |||
61 | PACKAGES =+ " ${PN}-sample " | ||
62 | |||
63 | RRECOMMENDS_${PN} = "kernel-module-tun" | ||
64 | |||
65 | FILES_${PN}-dbg += "${libdir}/openvpn/plugins/.debug" | ||
66 | FILES_${PN} += "${systemd_unitdir}/system/openvpn@.service \ | ||
67 | ${sysconfdir}/tmpfiles.d \ | ||
68 | " | ||
69 | FILES_${PN}-sample += "${systemd_unitdir}/system/openvpn@loopback-server.service \ | ||
70 | ${systemd_unitdir}/system/openvpn@loopback-client.service \ | ||
71 | ${sysconfdir}/openvpn/sample/" | ||