From fcd4c83b9d13beb2c57a9ae42cba6c117cea4568 Mon Sep 17 00:00:00 2001 From: Ben Chan Date: Thu, 22 Sep 2011 16:53:32 -0700 Subject: [PATCH] net-dialup/xl2tpd: import xl2tpd 1.3.0 from upstream Gentoo BUG=chromium-os:20746 TEST=emerge xl2tpd-1.3.0 for x86-generic and arm-generic Change-Id: Iedc3cc3a16484f0fea205f756f8b53d2936b6e92 Reviewed-on: http://gerrit.chromium.org/gerrit/8176 Reviewed-by: Ken Mixter Tested-by: Ben Chan --- .../xl2tpd/files/xl2tpd-1.3.0-LDFLAGS.patch | 13 ++++++ .../xl2tpd/files/xl2tpd-dnsretry.patch | 42 ++++++++++++++++++ .../net-dialup/xl2tpd/files/xl2tpd-init | 32 ++++++++++++++ .../net-dialup/xl2tpd/xl2tpd-1.3.0.ebuild | 44 +++++++++++++++++++ 4 files changed, 131 insertions(+) create mode 100644 sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/files/xl2tpd-1.3.0-LDFLAGS.patch create mode 100644 sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/files/xl2tpd-dnsretry.patch create mode 100644 sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/files/xl2tpd-init create mode 100644 sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/xl2tpd-1.3.0.ebuild diff --git a/sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/files/xl2tpd-1.3.0-LDFLAGS.patch b/sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/files/xl2tpd-1.3.0-LDFLAGS.patch new file mode 100644 index 0000000000..a87ab3fff8 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/files/xl2tpd-1.3.0-LDFLAGS.patch @@ -0,0 +1,13 @@ +=== modified file 'Makefile' +--- Makefile 2011-09-20 04:44:23 +0000 ++++ Makefile 2011-09-20 04:44:35 +0000 +@@ -114,7 +114,7 @@ + $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS) + + $(CONTROL_EXEC): $(CONTROL_SRCS) +- $(CC) $(CONTROL_SRCS) -o $@ ++ $(CC) $(LDFLAGS) $(CONTROL_SRCS) -o $@ + + pfc: + $(CC) $(CFLAGS) -c contrib/pfc.c + diff --git a/sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/files/xl2tpd-dnsretry.patch b/sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/files/xl2tpd-dnsretry.patch new file mode 100644 index 0000000000..b27703fe43 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/files/xl2tpd-dnsretry.patch @@ -0,0 +1,42 @@ +https://bugs.gentoo.org/show_bug.cgi?id=307489 +http://homenet.beeline.ru/index.php?showtopic=192551&st=0&p=1063626345&#entry1063626345 + +--- xl2tpd.c 2010-05-10 22:35:43.000000000 +0200 ++++ xl2tpd.c 2010-08-15 22:02:14.000000000 +0200 +@@ -587,9 +587,33 @@ + hp = gethostbyname (host); + if (!hp) + { +- l2tp_log (LOG_WARNING, "Host name lookup failed for %s.\n", +- host); +- return NULL; ++ if ( lac->redial ) ++ { ++ int imax=lac->rmax; ++ if ( lac->rmax == 0 ) ++ imax = 1; ++ while ( imax > 0 ) ++ { ++ hp = gethostbyname ( host ); ++ if ( hp ) ++ break; ++ l2tp_log ( LOG_WARNING, "Y: Host name lookup failed for %s. Trying to look again in %d seconds.\n", host, lac->rtimeout ); ++ if ( lac->rtimeout > 0 ) ++ sleep ( lac->rtimeout ); ++ if ( lac->rmax > 0 ) ++ imax--; ++ } ++ if ( ( imax == 0 ) && ( lac->rmax > 0 ) ) ++ { ++ l2tp_log ( LOG_WARNING, "Y: Host name lookup failed for %s after %d tries. Lookup stops now.\n", host, lac->rmax ); ++ return NULL; ++ } ++ } ++ else ++ { ++ l2tp_log (LOG_WARNING, "Host name lookup failed for %s.\n", host); ++ return NULL; ++ } + } + bcopy (hp->h_addr, &addr, hp->h_length); + /* Force creation of a new tunnel diff --git a/sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/files/xl2tpd-init b/sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/files/xl2tpd-init new file mode 100644 index 0000000000..639007b577 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/files/xl2tpd-init @@ -0,0 +1,32 @@ +#!/sbin/runscript +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dialup/xl2tpd/files/xl2tpd-init,v 1.2 2007/03/05 10:50:54 mrness Exp $ + +depend() { + need net +} + +checkconfig() { + if [[ ! -f /etc/xl2tpd/xl2tpd.conf ]] ; then + eerror "Missing /etc/xl2tpd/xl2tpd.conf configuration file!" + eerror "Example configuration file could be found in doc directory." + return 1 + fi + + return 0 +} + +start() { + checkconfig || return 1 + + ebegin "Starting xl2tpd" + start-stop-daemon --start --quiet --exec /usr/sbin/xl2tpd + eend $? +} + +stop() { + ebegin "Stopping xl2tpd" + start-stop-daemon --stop --quiet --pidfile /var/run/xl2tpd.pid + eend $? +} diff --git a/sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/xl2tpd-1.3.0.ebuild b/sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/xl2tpd-1.3.0.ebuild new file mode 100644 index 0000000000..09fcc40db7 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/net-dialup/xl2tpd/xl2tpd-1.3.0.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dialup/xl2tpd/xl2tpd-1.3.0.ebuild,v 1.1 2011/09/20 04:49:45 pva Exp $ + +EAPI="4" + +inherit eutils toolchain-funcs + +DESCRIPTION="A modern version of the Layer 2 Tunneling Protocol (L2TP) daemon" +HOMEPAGE="http://www.xelerance.com/services/software/xl2tpd/" +SRC_URI="ftp://ftp.xelerance.com/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="dnsretry" + +DEPEND="net-libs/libpcap" +RDEPEND="${DEPEND} + net-dialup/ppp" + +src_prepare() { + epatch "${FILESDIR}/${PN}-1.3.0-LDFLAGS.patch" + sed -i Makefile -e 's| -O2 ||g' || die "sed Makefile" + use dnsretry && epatch "${FILESDIR}/${PN}-dnsretry.patch" +} + +src_compile() { + emake CC=$(tc-getCC) +} + +src_install() { + emake PREFIX=/usr DESTDIR="${D}" install + + dodoc CREDITS README.xl2tpd \ + doc/README.patents doc/rfc2661.txt doc/*.sample + + dodir /etc/xl2tpd + head -n 2 doc/l2tp-secrets.sample > "${ED}/etc/xl2tpd/l2tp-secrets" || die + fperms 0600 /etc/xl2tpd/l2tp-secrets + newinitd "${FILESDIR}"/xl2tpd-init xl2tpd + + keepdir /var/run/xl2tpd +}