diff options
author | Andrew Savchenko <bircoph@gmail.com> | 2010-11-28 17:51:09 +0300 |
---|---|---|
committer | Andrew Savchenko <bircoph@gmail.com> | 2010-11-28 17:51:09 +0300 |
commit | b10e6fd4474a63464a7d694e441091da36d65abd (patch) | |
tree | 468fd0964307f3be77377b45e5bd4d9f0ca38412 /net-dialup/openl2tp | |
parent | openl2tp: Silence both module probes (diff) | |
download | bircoph-b10e6fd4474a63464a7d694e441091da36d65abd.tar.gz bircoph-b10e6fd4474a63464a7d694e441091da36d65abd.tar.bz2 bircoph-b10e6fd4474a63464a7d694e441091da36d65abd.zip |
openl2tp version 1.8 bump
Add main files only.
Diffstat (limited to 'net-dialup/openl2tp')
-rw-r--r-- | net-dialup/openl2tp/files/openl2tp-1.8-ldflags.patch | 73 | ||||
-rw-r--r-- | net-dialup/openl2tp/files/openl2tp-1.8-pppd.patch | 25 | ||||
-rw-r--r-- | net-dialup/openl2tp/files/openl2tp-1.8-werror.patch | 36 | ||||
-rw-r--r-- | net-dialup/openl2tp/openl2tp-1.8.ebuild | 150 |
4 files changed, 284 insertions, 0 deletions
diff --git a/net-dialup/openl2tp/files/openl2tp-1.8-ldflags.patch b/net-dialup/openl2tp/files/openl2tp-1.8-ldflags.patch new file mode 100644 index 0000000..7d1efff --- /dev/null +++ b/net-dialup/openl2tp/files/openl2tp-1.8-ldflags.patch @@ -0,0 +1,73 @@ +diff -Naur openl2tp-1.8.werror/Makefile openl2tp-1.8/Makefile +--- openl2tp-1.8.werror/Makefile 2010-11-28 17:18:02.000000000 +0300 ++++ openl2tp-1.8/Makefile 2010-11-28 17:22:27.950475976 +0300 +@@ -266,10 +266,10 @@ + etags $(wildcard *.c) $(wildcard *.h) + + openl2tpd: $(L2TPD_SRCS.o) +- $(CC) -o $@ $^ $(LDFLAGS.l2tpd) ++ $(CC) $(LDFLAGS) -o $@ $^ $(LDFLAGS.l2tpd) + + l2tpconfig: $(L2TPCONFIG_SRCS.o) +- $(CC) -o $@ $^ $(LDFLAGS.l2tpconfig) ++ $(CC) $(LDFLAGS) -o $@ $^ $(LDFLAGS.l2tpconfig) + + %.o: %.c + $(CC) -c $(CFLAGS) $< -o $@ +diff -Naur openl2tp-1.8.werror/cli/Makefile openl2tp-1.8/cli/Makefile +--- openl2tp-1.8.werror/cli/Makefile 2010-11-28 17:18:27.000000000 +0300 ++++ openl2tp-1.8/cli/Makefile 2010-11-28 17:22:27.950475976 +0300 +@@ -19,7 +19,7 @@ + $(AR) rus $@ $^ + + cli_test: $(CLI_SRCS_TEST.o) libcli.a +- $(CC) -o $@ $(CLI_SRCS_TEST.o) $(LDFLAGS.cli_test) ++ $(CC) $(LDFLAGS) -o $@ $(CLI_SRCS_TEST.o) $(LDFLAGS.cli_test) + + clean: + $(RM) $(CLI_SRCS.o) $(CLI_SRCS_TEST.o) libcli.a cli_test $(wildcard *.d) +diff -Naur openl2tp-1.8.werror/plugins/Makefile openl2tp-1.8/plugins/Makefile +--- openl2tp-1.8.werror/plugins/Makefile 2010-11-22 17:05:29.000000000 +0300 ++++ openl2tp-1.8/plugins/Makefile 2010-11-28 17:22:27.950475976 +0300 +@@ -1,7 +1,7 @@ + CFLAGS := $(CFLAGS.optimize) -MMD -Wall \ + -isystem ../include \ + -I. -I.. -I../usl -fPIC $(EXTRA_CFLAGS) +-LDFLAGS := -shared ++LDFLAGS.plugins := -shared + + PLUGINS.c:= ppp_unix.c ppp_null.c ipsec.c event_sock.c + +@@ -21,7 +21,7 @@ + $(RM) $(PLUGINS.so) $(wildcard *.o) $(wildcard *.d) $(SRC.generated) + + %.so: %.c +- $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $< ++ $(CC) $(LDFLAGS) -o $@ $(LDFLAGS.plugins) $(CFLAGS) $< + + install: all + $(INSTALL) -d $(DESTDIR)$(SYS_LIBDIR)/openl2tp +diff -Naur openl2tp-1.8.werror/test/Makefile openl2tp-1.8/test/Makefile +--- openl2tp-1.8.werror/test/Makefile 2007-05-28 18:28:53.000000000 +0400 ++++ openl2tp-1.8/test/Makefile 2010-11-28 17:25:52.871882050 +0300 +@@ -3,7 +3,7 @@ + all: pppd_dummy + + pppd_dummy: pppd_dummy.c +- $(CC) -o $@ $< ++ $(CC) $(LDFLAGS) -o $@ $< + + clean: + -$(RM) pppd_dummy +diff -Naur openl2tp-1.8.werror/usl/Makefile openl2tp-1.8/usl/Makefile +--- openl2tp-1.8.werror/usl/Makefile 2010-11-28 17:18:15.000000000 +0300 ++++ openl2tp-1.8/usl/Makefile 2010-11-28 17:22:27.950475976 +0300 +@@ -26,7 +26,7 @@ + $(AR) rus $@ $^ + + usl_test: $(USL_SRCS_TEST.o) libusl.a +- $(CC) -o $@ $(USL_SRCS_TEST.o) $(LDFLAGS.usl_test) ++ $(CC) $(LDFLAGS) -o $@ $(USL_SRCS_TEST.o) $(LDFLAGS.usl_test) + + clean: + -$(RM) $(USL_SRCS.o) $(USL_SRCS_TEST.o) libusl.a usl_test $(wildcard *.d) diff --git a/net-dialup/openl2tp/files/openl2tp-1.8-pppd.patch b/net-dialup/openl2tp/files/openl2tp-1.8-pppd.patch new file mode 100644 index 0000000..c53b3a0 --- /dev/null +++ b/net-dialup/openl2tp/files/openl2tp-1.8-pppd.patch @@ -0,0 +1,25 @@ +diff -Naur openl2tp-1.8.ldflags/Makefile openl2tp-1.8/Makefile +--- openl2tp-1.8.ldflags/Makefile 2010-11-28 17:22:27.000000000 +0300 ++++ openl2tp-1.8/Makefile 2010-11-28 17:33:46.010509533 +0300 +@@ -55,7 +55,6 @@ + # in the pppd subdirectory of the compiler's default search path + # (e.g. /usr/include/pppd). but can be pointed to another directory if + # desired. +-PPPD_VERSION= 2.4.5 + # PPPD_INCDIR= /usr/include/pppd + # PPPD_LIBDIR= $(SYS_LIBDIR)/pppd/$(PPPD_VERSION) + +@@ -97,13 +96,6 @@ + export L2TP_FEATURE_LOCAL_CONF_FILE + export L2TP_FEATURE_LOCAL_STAT_FILE + +-# Build pppd dir only if ppp version is earlier than 2.4.5 since the +-# openl2tp plugins were integrated in ppp-2.4.5. +-PPPD_SUBDIR=pppd +-ifeq ($(PPPD_VERSION),2.4.5) +-PPPD_SUBDIR= +-endif +- + SUBDIRS= usl cli plugins $(PPPD_SUBDIR) test doc + + .PHONY: $(SUBDIRS:%=subdir-%) diff --git a/net-dialup/openl2tp/files/openl2tp-1.8-werror.patch b/net-dialup/openl2tp/files/openl2tp-1.8-werror.patch new file mode 100644 index 0000000..d36447d --- /dev/null +++ b/net-dialup/openl2tp/files/openl2tp-1.8-werror.patch @@ -0,0 +1,36 @@ +diff -Naur openl2tp-1.8.orig/Makefile openl2tp-1.8/Makefile +--- openl2tp-1.8.orig/Makefile 2010-11-22 12:47:26.000000000 +0300 ++++ openl2tp-1.8/Makefile 2010-11-28 17:18:02.547651027 +0300 +@@ -154,7 +154,7 @@ + + CPPFLAGS= $(CPPFLAGS.l2tptest) $(CPPFLAGS-y) + CFLAGS= -I. -Iusl -Icli -isystem include \ +- -MMD -Wall -Werror -Wno-strict-aliasing \ ++ -MMD -Wall -Wno-strict-aliasing \ + $(CPPFLAGS) $(CPPFLAGS.dmalloc) \ + -DSYS_LIBDIR=$(SYS_LIBDIR) + LDFLAGS.l2tpd= -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc +diff -Naur openl2tp-1.8.orig/cli/Makefile openl2tp-1.8/cli/Makefile +--- openl2tp-1.8.orig/cli/Makefile 2010-11-12 15:28:47.000000000 +0300 ++++ openl2tp-1.8/cli/Makefile 2010-11-28 17:18:27.707453102 +0300 +@@ -7,7 +7,7 @@ + + LDFLAGS.cli_test= -L.. -L. $(READLINE_LDFLAGS) -lcli -lusl -lreadline -lcurses -lc + +-CFLAGS= $(CFLAGS.optimize) -MMD -Wall -Werror -I.. $(READLINE_CFLAGS) ++CFLAGS= $(CFLAGS.optimize) -MMD -Wall -I.. $(READLINE_CFLAGS) + + .PHONY: all test clean + +diff -Naur openl2tp-1.8.orig/usl/Makefile openl2tp-1.8/usl/Makefile +--- openl2tp-1.8.orig/usl/Makefile 2010-11-04 19:27:08.000000000 +0300 ++++ openl2tp-1.8/usl/Makefile 2010-11-28 17:18:15.615816682 +0300 +@@ -14,7 +14,7 @@ + endif + + CPPFLAGS+= $(CFLAGS.optimize) -g +-CFLAGS= -I. -MMD -Wall -Werror -Wno-strict-aliasing $(CPPFLAGS) $(CPPFLAGS.dmalloc) ++CFLAGS= -I. -MMD -Wall -Wno-strict-aliasing $(CPPFLAGS) $(CPPFLAGS.dmalloc) + + .PHONY: all test clean + diff --git a/net-dialup/openl2tp/openl2tp-1.8.ebuild b/net-dialup/openl2tp/openl2tp-1.8.ebuild new file mode 100644 index 0000000..129f1ca --- /dev/null +++ b/net-dialup/openl2tp/openl2tp-1.8.ebuild @@ -0,0 +1,150 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=3 + +inherit eutils linux-info + +DESCRIPTION="Userspace tools for kernel L2TP implementation." +HOMEPAGE="http://openl2tp.sourceforge.net" +SRC_URI="mirror://sourceforge/openl2tp/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc +client pppd rpc server -stats" + +CDEPEND="net-dialup/ppp + sys-libs/readline + " +DEPEND="${CDEPEND} + sys-devel/bison + sys-devel/flex + " +RDEPEND="${CDEPEND} + rpc? ( || ( + net-nds/rpcbind + net-nds/portmap + ) )" + +CONFIG_CHECK="~PPPOL2TP" + +pkg_setup() { + # check for sane USE flags + if ! use server && ! use client; then + eerror + eerror "You have disabled both server and client parts!" + eerror "At least one of them must be enabled. ;)" + eerror + die "bad USE flags" + fi + # kernel requirements + linux-info_pkg_setup + if kernel_is -lt 2 6 23; then + eerror + eerror "Your kernel is too old. At least 2.6.23 is required to work with this program." + eerror + die "kernel is too old" + fi +} + +src_prepare() { + # disable -Werror, as warnings may occur on different CFLAGS + epatch "${FILESDIR}/${P}-werror.patch" + # use system LDFLAGS + epatch "${FILESDIR}/${P}-ldflags.patch" + # let ebuild to control pppd plugins support + epatch "${FILESDIR}/${P}-pppd.patch" + # do not gzip man pages, let portage to compress them + epatch "${FILESDIR}/${PN}-1.7-man.patch" + # install l2tpconfig to /usr/sbin with 0700 permissions + # to make it at least a bit more secure + epatch "${FILESDIR}/${PN}-1.7-l2tpconfig.patch" +} + +src_configure() { + myconf="" # not local, should be used at src_compile() + + use client || myconf+="L2TP_FEATURE_LAC_SUPPORT=n \ + L2TP_FEATURE_LAIC_SUPPORT=n \ + L2TP_FEATURE_LAOC_SUPPORT=n " + + use server || myconf+="L2TP_FEATURE_LNS_SUPPORT=n \ + L2TP_FEATURE_LNIC_SUPPORT=n \ + L2TP_FEATURE_LNOC_SUPPORT=n " + + use rpc || myconf+="L2TP_FEATURE_RPC_MANAGEMENT=n " + + use stats && myconf+="L2TP_FEATURE_LOCAL_STAT_FILE=y " + + # pppd plugin is only needed for pppd < 2.4.5 + unset PPPD_SUBDIR + if use pppd; then + export PPPD_VERSION=$( gawk '{ + if ($2=="VERSION") { + gsub("\"","",$3); + print $3 + } + }' /usr/include/pppd/patchlevel.h ) || die "gawk failed" + einfo "Building for pppd version $PPPD_VERSION" + + # convert version to comparable format + local ver=$( echo $PPPD_VERSION | gawk -F "." '{ + print lshift($1,16) + lshift($2,8) + $3 + }' ) + if [[ $ver -lt $(( (2<<16) + (4<<8) + 5)) ]]; then + export PPPD_SUBDIR="pppd" + else + ewarn + ewarn "openl2tp plugins are already integrated in >=net-dialup/ppp-2.4.5" + fi + fi +} + +src_compile() { + # upstream use OPT_CFLAGS for optimizations + export OPT_CFLAGS=${CFLAGS} + emake ${myconf} || die "emake failed" +} + +src_install() { + emake ${myconf} DESTDIR="${D}" install || die "emake install failed" + dodoc CHANGES INSTALL README + + if use doc; then + dodoc doc/*.txt "${FILESDIR}"/openl2tpd.conf.sample + newdoc plugins/README README.plugins + use pppd && newdoc pppd/README README.pppd + docinto ipsec + dodoc ipsec/* + fi + + newinitd "${FILESDIR}"/openl2tpd.initd openl2tpd + # init.d script is quite different for RPC and non-RPC versions. + use rpc || sed -i s/userpc=\"yes\"/userpc=\"no\"/ "${D}/etc/init.d/openl2tpd" || die "sed failed" + newconfd "${FILESDIR}"/openl2tpd.confd openl2tpd +} + +pkg_postinst() { + if use rpc; then + ewarn + ewarn "RPC control does not provide any auth checks for control connection." + ewarn "By default localhost only is allowed and l2tpconfig is installed" + ewarn "accessible only by root, but local users may install or compile binary" + ewarn "on they own if not prohibited by system administrator." + ewarn + ewarn "Therefore DO NOT USE RPC IN INSECURE ENVIRONMENTS!" + else + ewarn + ewarn "Without RPC support you won't be able to use l2tpconfig." + ewarn "Warning: config file parser is buggy due to flex braindead parsing logincs" + ewarn "and will deny you to use numerical login names, passwords with special" + ewarn "characters, short hostnames without dot symbol and many more." + fi + if use stats; then + ewarn + ewarn "To enable status files openl2tpd must be started with -S option." + ewarn "Upstream warns about runtime overhead with status files enabled." + fi +} |