diff options
author | Andrew Savchenko <bircoph@gentoo.org> | 2018-03-19 00:42:15 +0300 |
---|---|---|
committer | Andrew Savchenko <bircoph@gentoo.org> | 2018-03-19 00:42:15 +0300 |
commit | 7760ce14bb18a3114e67574aefa9524d398fa433 (patch) | |
tree | 727f76da608519524986d91d81931a9606b5cd28 | |
parent | orangefs: fix slot dependency (diff) | |
download | bircoph-7760ce14bb18a3114e67574aefa9524d398fa433.tar.gz bircoph-7760ce14bb18a3114e67574aefa9524d398fa433.tar.bz2 bircoph-7760ce14bb18a3114e67574aefa9524d398fa433.zip |
openl2tpd: various QA fixes
- fix metadata indentation
- update copyright year
- add USE=debug
- add optional dev-libs/dmalloc support
- remove obsolete net-nds/portmap dependency
- remove unused var
- make Makefile properly configurable
- fix ignored CFLAGS problem
-rw-r--r-- | net-dialup/openl2tp/files/openl2tp-1.8-cflags.patch | 19 | ||||
-rw-r--r-- | net-dialup/openl2tp/files/openl2tp-1.8-configure-Makefile.patch | 58 | ||||
-rw-r--r-- | net-dialup/openl2tp/files/openl2tp-1.8-parallelbuild.patch | 9 | ||||
-rw-r--r-- | net-dialup/openl2tp/files/openl2tp-1.8-unused-var.patch | 21 | ||||
-rw-r--r-- | net-dialup/openl2tp/metadata.xml | 13 | ||||
-rw-r--r-- | net-dialup/openl2tp/openl2tp-1.8-r6.ebuild | 39 |
6 files changed, 135 insertions, 24 deletions
diff --git a/net-dialup/openl2tp/files/openl2tp-1.8-cflags.patch b/net-dialup/openl2tp/files/openl2tp-1.8-cflags.patch new file mode 100644 index 0000000..8a6ddf4 --- /dev/null +++ b/net-dialup/openl2tp/files/openl2tp-1.8-cflags.patch @@ -0,0 +1,19 @@ +--- openl2tp-1.8/Makefile.orig 2018-03-17 14:24:57.000000000 +0300 ++++ openl2tp-1.8/Makefile 2018-03-17 15:07:29.794479939 +0300 +@@ -153,14 +155,14 @@ + endif + + CPPFLAGS= $(CPPFLAGS.l2tptest) $(CPPFLAGS-y) +-CFLAGS= -I. -Iusl -Icli -isystem include \ ++CFLAGS+= -I. -Iusl -Icli -isystem include \ + -MMD -Wall -Wno-strict-aliasing \ + $(CPPFLAGS) $(CPPFLAGS.dmalloc) \ + -DSYS_LIBDIR=$(SYS_LIBDIR) + LDFLAGS.l2tpd= -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc + LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc + +-OPT_CFLAGS?= -O ++OPT_CFLAGS?= + + ifeq ($(L2TP_DEBUG),y) + CFLAGS.optimize= -g diff --git a/net-dialup/openl2tp/files/openl2tp-1.8-configure-Makefile.patch b/net-dialup/openl2tp/files/openl2tp-1.8-configure-Makefile.patch new file mode 100644 index 0000000..f840b2b --- /dev/null +++ b/net-dialup/openl2tp/files/openl2tp-1.8-configure-Makefile.patch @@ -0,0 +1,58 @@ +--- openl2tp-1.8/Makefile.orig 2018-03-17 14:24:57.000000000 +0300 ++++ openl2tp-1.8/Makefile 2018-03-17 14:46:34.769800757 +0300 +@@ -1,26 +1,26 @@ + # BEGIN CONFIGURABLE SETTINGS + + # Compile-time features +-L2TP_FEATURE_LAC_SUPPORT= y +-L2TP_FEATURE_LNS_SUPPORT= y +-L2TP_FEATURE_RPC_MANAGEMENT= y +-L2TP_FEATURE_LAIC_SUPPORT= y +-L2TP_FEATURE_LAOC_SUPPORT= y +-L2TP_FEATURE_LNIC_SUPPORT= y +-L2TP_FEATURE_LNOC_SUPPORT= y ++L2TP_FEATURE_LAC_SUPPORT ?= y ++L2TP_FEATURE_LNS_SUPPORT ?= y ++L2TP_FEATURE_RPC_MANAGEMENT ?= y ++L2TP_FEATURE_LAIC_SUPPORT ?= y ++L2TP_FEATURE_LAOC_SUPPORT ?= y ++L2TP_FEATURE_LNIC_SUPPORT ?= y ++L2TP_FEATURE_LNOC_SUPPORT ?= y + L2TP_FEATURE_LOCAL_CONF_FILE= y +-#L2TP_FEATURE_LOCAL_STAT_FILE= y ++L2TP_FEATURE_LOCAL_STAT_FILE ?= n + + # Define USE_DMALLOC to enable dmalloc memory debugging +-# USE_DMALLOC= y ++USE_DMALLOC ?= n + + # Define to include test code. This must be defined to run the + # regression tests +-# L2TP_TEST= y ++L2TP_TEST ?= n + + # Define to compile in debug code. Also makes default trace flags + # enable all messages +-# L2TP_DEBUG= y ++L2TP_DEBUG ?= n + + # Use asynchronous RPC requests where appropriate + # Affects only L2TP-PPP-IPPOOL interfaces, not management interfaces. +@@ -99,12 +99,14 @@ + + # 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= ++ ++TEST= ++ifeq ($(L2TP_TEST),y) ++TEST=test + endif + +-SUBDIRS= usl cli plugins $(PPPD_SUBDIR) test doc ++SUBDIRS= usl cli plugins $(PPPD_SUBDIR) $(TEST) doc + + .PHONY: $(SUBDIRS:%=subdir-%) + diff --git a/net-dialup/openl2tp/files/openl2tp-1.8-parallelbuild.patch b/net-dialup/openl2tp/files/openl2tp-1.8-parallelbuild.patch index 994a485..fb6b9f9 100644 --- a/net-dialup/openl2tp/files/openl2tp-1.8-parallelbuild.patch +++ b/net-dialup/openl2tp/files/openl2tp-1.8-parallelbuild.patch @@ -10,6 +10,15 @@ diff -rau openl2tp-1.8.o/Makefile openl2tp-1.8/Makefile $(MAKE) -C $(@:subdir-%=%) $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)" ifeq ($(L2TP_FEATURE_LOCAL_CONF_FILE),y) +@@ -211,7 +211,7 @@ + %.h %.c: %.y + $(YACC) -d -o l2tp_config_parse.c $< + +-l2tp_config_token.o: l2tp_config_token.c ++l2tp_config_token.o: l2tp_config_token.c l2tp_config_parse.h + $(CC) -I. -MMD -w $(CFLAGS.optimize) -c -DYY_NO_UNPUT $< + + l2tp_config_parse.o: l2tp_config_parse.c l2tp_config_parse.h @@ -271,7 +271,7 @@ l2tpconfig: $(L2TPCONFIG_SRCS.o) $(CC) $(LDFLAGS) -o $@ $^ $(LDFLAGS.l2tpconfig) diff --git a/net-dialup/openl2tp/files/openl2tp-1.8-unused-var.patch b/net-dialup/openl2tp/files/openl2tp-1.8-unused-var.patch new file mode 100644 index 0000000..2e1f627 --- /dev/null +++ b/net-dialup/openl2tp/files/openl2tp-1.8-unused-var.patch @@ -0,0 +1,21 @@ +diff -Naurd openl2tp-1.8.orig/pppd/pppol2tp.c openl2tp-1.8/pppd/pppol2tp.c +--- openl2tp-1.8.orig/pppd/pppol2tp.c 2010-11-15 15:12:43.000000000 +0300 ++++ openl2tp-1.8/pppd/pppol2tp.c 2018-03-17 14:11:07.484281421 +0300 +@@ -297,7 +297,7 @@ + static bool got_recv_accm = 0; + static uint32_t recv_accm = 0xffffffff; + static uint32_t send_accm = 0xffffffff; +- static bool snooping = 1; ++ // static bool snooping = 1; + + uint16_t protocol; + uint16_t lcp_pkt_len; +@@ -328,7 +328,7 @@ + "Network protocol %04x found.", + protocol); + } +- snooping = 0; ++ // snooping = 0; + return; + } + diff --git a/net-dialup/openl2tp/metadata.xml b/net-dialup/openl2tp/metadata.xml index 6cc232d..4d28915 100644 --- a/net-dialup/openl2tp/metadata.xml +++ b/net-dialup/openl2tp/metadata.xml @@ -6,11 +6,12 @@ <name>Andrew Savchenko</name> </maintainer> <use> - <flag name='client'>Enable l2tp client</flag> - <flag name='rpc'>Enable RPC queries and control. This flag is required for - l2tpconfig to be built and used.</flag> - <flag name='server'>Enable l2tp server</flag> - <flag name='stats'>Enable status files. Note: when they are used, this - hampers performance of the daemon.</flag> + <flag name='client'>Enable l2tp client.</flag> + <flag name='dmalloc'>Enable debugging using <pkg>dev-libs/dmalloc</pkg>.</flag> + <flag name='rpc'>Enable RPC queries and control. This flag is required for + l2tpconfig to be built and used.</flag> + <flag name='server'>Enable l2tp server.</flag> + <flag name='stats'>Enable status files. Note: when they are used, this + hampers performance of the daemon.</flag> </use> </pkgmetadata> diff --git a/net-dialup/openl2tp/openl2tp-1.8-r6.ebuild b/net-dialup/openl2tp/openl2tp-1.8-r6.ebuild index c6ff9f2..a585a70 100644 --- a/net-dialup/openl2tp/openl2tp-1.8-r6.ebuild +++ b/net-dialup/openl2tp/openl2tp-1.8-r6.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=6 @@ -12,22 +12,22 @@ SRC_URI="mirror://sourceforge/openl2tp/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="+client doc +examples rpc server -stats" +IUSE="+client debug dmalloc doc +examples rpc server stats" REQUIRED_USE="|| ( client server )" -CDEPEND=">=net-dialup/ppp-2.4.5 +CDEPEND=" + >=net-dialup/ppp-2.4.5 sys-libs/readline:= + dmalloc? ( dev-libs/dmalloc ) " DEPEND="${CDEPEND} sys-devel/bison sys-devel/flex " RDEPEND="${CDEPEND} - rpc? ( || ( - net-nds/rpcbind - net-nds/portmap - ) )" + rpc? ( net-nds/rpcbind ) + " CONFIG_CHECK="~PPPOL2TP" @@ -41,30 +41,33 @@ PATCHES=( "${FILESDIR}/${P}-optionsfile.patch" "${FILESDIR}/${P}-clientip_as_ipparam.patch" "${FILESDIR}/${P}-setkey.patch" + "${FILESDIR}/${P}-unused-var.patch" + "${FILESDIR}/${P}-configure-Makefile.patch" + "${FILESDIR}/${P}-cflags.patch" ) src_configure() { - myconf="" # not local, should be used at src_compile() + declare -a 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 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 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 rpc || myconf+=( L2TP_FEATURE_RPC_MANAGEMENT=n ) - use stats && myconf+="L2TP_FEATURE_LOCAL_STAT_FILE=y " + use stats && myconf+=( L2TP_FEATURE_LOCAL_STAT_FILE=y ) + use debug && myconf+=( L2TP_DEBUG=y ) + use dmalloc && myconf+=( USE_DMALLOC=y ) # pppd plugin is only needed for pppd < 2.4.5 unset PPPD_SUBDIR } src_compile() { - # upstream use OPT_CFLAGS for optimizations - export OPT_CFLAGS=${CFLAGS} emake ${myconf} } |