diff options
author | Cédric Krier <cedk@gentoo.org> | 2008-05-14 17:02:25 +0000 |
---|---|---|
committer | Cédric Krier <cedk@gentoo.org> | 2008-05-14 17:02:25 +0000 |
commit | 88e8c0d78a0accb8ff7ed30d7e2b3c34fac06198 (patch) | |
tree | e94d4d00821e0785deceb8a2e0d190b1c4f31d18 /net-misc | |
parent | Stable on ppc64; bug #221063 (diff) | |
download | gentoo-2-88e8c0d78a0accb8ff7ed30d7e2b3c34fac06198.tar.gz gentoo-2-88e8c0d78a0accb8ff7ed30d7e2b3c34fac06198.tar.bz2 gentoo-2-88e8c0d78a0accb8ff7ed30d7e2b3c34fac06198.zip |
Version bump
(Portage version: 2.1.4.4)
Diffstat (limited to 'net-misc')
-rw-r--r-- | net-misc/openvpn/ChangeLog | 9 | ||||
-rw-r--r-- | net-misc/openvpn/files/openvpn-2.0.9-pam.patch | 32 | ||||
-rw-r--r-- | net-misc/openvpn/files/openvpn-2.0.9-persistent.patch | 44 | ||||
-rw-r--r-- | net-misc/openvpn/openvpn-2.0.9.ebuild | 142 |
4 files changed, 226 insertions, 1 deletions
diff --git a/net-misc/openvpn/ChangeLog b/net-misc/openvpn/ChangeLog index 25e6dcb02e2f..d33c708c3c99 100644 --- a/net-misc/openvpn/ChangeLog +++ b/net-misc/openvpn/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-misc/openvpn # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/ChangeLog,v 1.134 2008/05/13 07:55:07 cedk Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/ChangeLog,v 1.135 2008/05/14 17:02:24 cedk Exp $ + +*openvpn-2.0.9 (14 May 2008) + + 14 May 2008; Cédric Krier <cedk@gentoo.org> + +files/openvpn-2.0.9-pam.patch, +files/openvpn-2.0.9-persistent.patch, + +openvpn-2.0.9.ebuild: + Version bump 13 May 2008; Cédric Krier <cedk@gentoo.org> metadata.xml: Take ownership, after Alon Bar-Lev left diff --git a/net-misc/openvpn/files/openvpn-2.0.9-pam.patch b/net-misc/openvpn/files/openvpn-2.0.9-pam.patch new file mode 100644 index 000000000000..38be232b8dd3 --- /dev/null +++ b/net-misc/openvpn/files/openvpn-2.0.9-pam.patch @@ -0,0 +1,32 @@ +diff -ru openvpn-2.0.9~/plugin/auth-pam/Makefile openvpn-2.0.9/plugin/auth-pam/Makefile +--- openvpn-2.0.9~/plugin/auth-pam/Makefile 2008-05-13 23:21:30.000000000 +0200 ++++ openvpn-2.0.9/plugin/auth-pam/Makefile 2008-05-13 23:21:46.000000000 +0200 +@@ -4,7 +4,7 @@ + + # If PAM modules are not linked against libpam.so, set DLOPEN_PAM to 1. This + # must be done on SUSE 9.1, at least. +-DLOPEN_PAM=1 ++DLOPEN_PAM=0 + + ifeq ($(DLOPEN_PAM),1) + LIBPAM=-ldl +diff -ru openvpn-2.0.9~/plugin/auth-pam/pamdl.c openvpn-2.0.9/plugin/auth-pam/pamdl.c +--- openvpn-2.0.9~/plugin/auth-pam/pamdl.c 2008-05-13 23:21:30.000000000 +0200 ++++ openvpn-2.0.9/plugin/auth-pam/pamdl.c 2008-05-13 23:21:46.000000000 +0200 +@@ -10,7 +10,6 @@ + #include <stdio.h> + #include <dlfcn.h> + #include <security/pam_appl.h> +-#include <security/_pam_macros.h> + + #include "pamdl.h" + +@@ -74,7 +73,7 @@ + return real_pam_set_item(pamh, item_type, item); + } + +-int pam_get_item(const pam_handle_t *pamh, int item_type, const void **item) ++int pam_get_item(pam_handle_t *pamh, int item_type, const void **item) + { + int (*real_pam_get_item)(const pam_handle_t *, int, const void **); + RESOLVE_PAM_FUNCTION(pam_get_item, int, diff --git a/net-misc/openvpn/files/openvpn-2.0.9-persistent.patch b/net-misc/openvpn/files/openvpn-2.0.9-persistent.patch new file mode 100644 index 000000000000..e042124ea497 --- /dev/null +++ b/net-misc/openvpn/files/openvpn-2.0.9-persistent.patch @@ -0,0 +1,44 @@ +diff -ru openvpn-2.0.9~/init.c openvpn-2.0.9/init.c +--- openvpn-2.0.9~/init.c 2008-05-13 23:21:30.000000000 +0200 ++++ openvpn-2.0.9/init.c 2008-05-13 23:22:51.000000000 +0200 +@@ -347,7 +347,8 @@ + msg (M_FATAL|M_OPTERR, + "options --mktun or --rmtun should only be used together with --dev"); + tuncfg (options->dev, options->dev_type, options->dev_node, +- options->tun_ipv6, options->persist_mode); ++ options->tun_ipv6, options->persist_mode, ++ &options->tuntap_options); + return true; + } + #endif +diff -ru openvpn-2.0.9~/tun.c openvpn-2.0.9/tun.c +--- openvpn-2.0.9~/tun.c 2008-05-13 23:21:30.000000000 +0200 ++++ openvpn-2.0.9/tun.c 2008-05-13 23:22:51.000000000 +0200 +@@ -1095,13 +1095,14 @@ + #ifdef TUNSETPERSIST + + void +-tuncfg (const char *dev, const char *dev_type, const char *dev_node, bool ipv6, int persist_mode) ++tuncfg (const char *dev, const char *dev_type, const char *dev_node, bool ipv6, int persist_mode, const struct tuntap_options *options) + { + struct tuntap *tt; + + ALLOC_OBJ (tt, struct tuntap); + clear_tuntap (tt); + tt->type = dev_type_enum (dev, dev_type); ++ tt->options = *options; + open_tun (dev, dev_type, dev_node, ipv6, tt); + if (ioctl (tt->fd, TUNSETPERSIST, persist_mode) < 0) + msg (M_ERR, "Cannot ioctl TUNSETPERSIST(%d) %s", persist_mode, dev); +diff -ru openvpn-2.0.9~/tun.h openvpn-2.0.9/tun.h +--- openvpn-2.0.9~/tun.h 2008-05-13 23:21:30.000000000 +0200 ++++ openvpn-2.0.9/tun.h 2008-05-13 23:22:51.000000000 +0200 +@@ -194,7 +194,7 @@ + int read_tun (struct tuntap* tt, uint8_t *buf, int len); + + void tuncfg (const char *dev, const char *dev_type, const char *dev_node, +- bool ipv6, int persist_mode); ++ bool ipv6, int persist_mode, const struct tuntap_options *options); + + const char *guess_tuntap_dev (const char *dev, + const char *dev_type, diff --git a/net-misc/openvpn/openvpn-2.0.9.ebuild b/net-misc/openvpn/openvpn-2.0.9.ebuild new file mode 100644 index 000000000000..94fb8a2856c7 --- /dev/null +++ b/net-misc/openvpn/openvpn-2.0.9.ebuild @@ -0,0 +1,142 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/openvpn-2.0.9.ebuild,v 1.1 2008/05/14 17:02:24 cedk Exp $ + +inherit eutils multilib + +DESCRIPTION="OpenVPN is a robust and highly flexible tunneling application compatible with many OSes." +SRC_URI="http://openvpn.net/release/openvpn-${PV}.tar.gz" +HOMEPAGE="http://openvpn.net/" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~ppc64 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" +IUSE="examples iproute2 minimal pam passwordsave selinux ssl static threads" +RESTRICT="!ssl? ( test )" + +RDEPEND=">=dev-libs/lzo-1.07 + kernel_linux? ( + iproute2? ( sys-apps/iproute2 ) !iproute2? ( sys-apps/net-tools ) + ) + !minimal? ( pam? ( virtual/pam ) ) + selinux? ( sec-policy/selinux-openvpn ) + ssl? ( >=dev-libs/openssl-0.9.6 )" +DEPEND="${RDEPEND} + virtual/os-headers" + +pkg_setup() { + if use iproute2 ; then + if built_with_use sys-apps/iproute2 minimal ; then + eerror "iproute2 support requires that sys-apps/iproute2 was not" + eerror "built with the minimal USE flag" + die "iproute2 support not available" + fi + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}/${P}-pam.patch" + epatch "${FILESDIR}/${P}-persistent.patch" + +} + +src_compile() { + local myconf="" + # We cannot use use_enable with iproute2 as the Makefile stupidly + # enables it with --disable-iproute2 + use iproute2 && myconf="${myconf} --enable-iproute2" + use minimal && myconf="${myconf} --disable-plugins" + + econf ${myconf} \ + $(use_enable passwordsave password-save) \ + $(use_enable ssl) \ + $(use_enable ssl crypto) \ + $(use_enable threads pthread) \ + || die "configure failed" + + use static && sed -i -e '/^LIBS/s/LIBS = /LIBS = -static /' Makefile + + emake || die "make failed" + + if ! use minimal ; then + cd plugin + for i in $( ls 2>/dev/null ); do + [[ ${i} == "README" || ${i} == "examples" ]] && continue + [[ ${i} == "auth-pam" ]] && ! use pam && continue + einfo "Building ${i} plugin" + cd "${i}" + emake || die "make failed" + cd .. + done + cd .. + fi +} + +src_install() { + make DESTDIR="${D}" install || die "make install failed" + + # install documentation + dodoc AUTHORS ChangeLog PORTS README + + # Empty dir + dodir /etc/openvpn + keepdir /etc/openvpn + + # Install the init script + newinitd "${FILESDIR}/openvpn.init" openvpn + + # install examples, controlled by the respective useflag + if use examples ; then + # dodoc does not supportly support directory traversal, #15193 + insinto /usr/share/doc/${PF}/examples + doins -r sample-{config-files,keys,scripts} contrib + prepalldocs + fi + + # Install plugins and easy-rsa + if ! use minimal ; then + cd easy-rsa/2.0 + exeinto "/usr/share/${PN}/easy-rsa" + doexe *-* pkitool + insinto "/usr/share/${PN}/easy-rsa" + doins README openssl.cnf vars + cd ../.. + + exeinto "/usr/$(get_libdir)/${PN}" + doexe plugin/*/*.so + fi +} + +pkg_postinst() { + ewarn "WARNING: The openvpn init script has changed" + ewarn "" + einfo "The openvpn init script expects to find the configuration file" + einfo "openvpn.conf in /etc/openvpn along with any extra files it may need." + einfo "" + einfo "To create more VPNs, simply create a new .conf file for it and" + einfo "then create a symlink to the openvpn init script from a link called" + einfo "openvpn.newconfname - like so" + einfo " cd /etc/openvpn" + einfo " ${EDITOR##*/} foo.conf" + einfo " cd /etc/init.d" + einfo " ln -s openvpn openvpn.foo" + einfo "" + einfo "You can then treat openvpn.foo as any other service, so you can" + einfo "stop one vpn and start another if you need to." + if ! use minimal ; then + einfo "" + einfo "plugins have been installed into /usr/$(get_libdir)/${PN}" + fi + einfo "" + einfo "It is recommended that you create your tun/tap interfaces using" + einfo "the net.tun0/net.tap0 scripts provided by baselayout instead of" + einfo "using the 'server' directive in openvpn configuration files." + einfo "This will insure that the interface really is up after openvpn" + einfo "starts." + einfo "Note that you cannot use net.tun0/net.tap0 and the server option," + einfo "otherwise openvpn will not start." + ebeep +} |