2014-11-21 22:42:42 +00:00
|
|
|
SUMMARY = "A full-featured SSL VPN solution via tun device."
|
|
|
|
HOMEPAGE = "http://openvpn.sourceforge.net"
|
|
|
|
SECTION = "console/network"
|
|
|
|
LICENSE = "GPLv2"
|
|
|
|
LIC_FILES_CHKSUM = "file://COPYING;md5=5aac200199fde47501876cba7263cb0c"
|
|
|
|
DEPENDS = "lzo openssl iproute2 ${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
|
|
|
|
|
|
|
|
inherit autotools
|
|
|
|
|
2014-12-12 18:19:29 +00:00
|
|
|
PR = "r3"
|
2014-11-21 23:05:29 +00:00
|
|
|
|
2014-11-21 22:42:42 +00:00
|
|
|
SRC_URI = "http://swupdate.openvpn.org/community/releases/openvpn-${PV}.tar.gz \
|
2014-11-21 22:54:02 +00:00
|
|
|
file://openvpn \
|
|
|
|
file://openvpn-generator \
|
|
|
|
file://openvpn@.service \
|
|
|
|
file://openvpn.service"
|
2014-11-21 22:42:42 +00:00
|
|
|
|
2014-12-12 18:19:29 +00:00
|
|
|
SRC_URI[md5sum] = "6ca03fe0fd093e0d01601abee808835c"
|
|
|
|
SRC_URI[sha256sum] = "7baed2ff39c12e1a1a289ec0b46fcc49ff094ca58b8d8d5f29b36ac649ee5b26"
|
2014-11-21 22:42:42 +00:00
|
|
|
|
|
|
|
CFLAGS += "-fno-inline"
|
|
|
|
|
|
|
|
# I want openvpn to be able to read password from file (hrw)
|
|
|
|
EXTRA_OECONF += "--enable-password-save --enable-iproute2"
|
|
|
|
EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'pam', '', '--disable-plugin-auth-pam', d)}"
|
|
|
|
|
|
|
|
# Explicitly specify IPROUTE to bypass the configure-time check for /sbin/ip on the host.
|
|
|
|
EXTRA_OECONF += "IPROUTE=/sbin/ip"
|
|
|
|
|
|
|
|
do_install_append() {
|
|
|
|
install -d ${D}/${sysconfdir}/init.d
|
|
|
|
install -d ${D}/${sysconfdir}/openvpn
|
|
|
|
install -m 755 ${WORKDIR}/openvpn ${D}/${sysconfdir}/init.d
|
2014-11-21 22:54:02 +00:00
|
|
|
|
|
|
|
# systemd files
|
|
|
|
install -d ${D}${systemd_unitdir}/system
|
|
|
|
install -d ${D}${systemd_unitdir}/system-generators
|
|
|
|
install -m 0644 ${WORKDIR}/openvpn.service ${D}${systemd_unitdir}/system
|
|
|
|
install -m 0644 ${WORKDIR}/openvpn@.service ${D}${systemd_unitdir}/system
|
|
|
|
install -m 0755 ${WORKDIR}/openvpn-generator ${D}${systemd_unitdir}/system-generators
|
2014-11-21 22:42:42 +00:00
|
|
|
}
|
|
|
|
|
2014-12-12 19:56:23 +00:00
|
|
|
RDEPENDS_${PN} += "update-rc.d"
|
2014-11-21 22:42:42 +00:00
|
|
|
RRECOMMENDS_${PN} = "kernel-module-tun"
|
|
|
|
|
|
|
|
FILES_${PN}-dbg += "${libdir}/openvpn/plugins/.debug"
|
|
|
|
|
2014-11-21 22:54:02 +00:00
|
|
|
# Don't go through the systemd.bbclass as we do not want magic to happen
|
|
|
|
# during install and upgrade. Simply ship the files.
|
|
|
|
FILES_${PN} += "${systemd_unitdir}"
|
|
|
|
|
2014-12-12 19:56:23 +00:00
|
|
|
pkg_postinst_${PN} () {
|
|
|
|
if [ "x$D" != "x" ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -L /etc/rc2.d/S*openvpn ]; then
|
|
|
|
update-rc.d -f openvpn remove
|
|
|
|
if [ ! -L /etc/systemd/system/multi-user.target.wants/openvpn.service ]; then
|
|
|
|
ln -s '/lib/systemd/system/openvpn.service' '/etc/systemd/system/multi-user.target.wants/openvpn.service'
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|