summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick McLean <chutzpah@gentoo.org>2014-09-22 18:09:19 +0000
committerPatrick McLean <chutzpah@gentoo.org>2014-09-22 18:09:19 +0000
commit75a2328f578e57146689fe4b7fdbbaa92a279bfd (patch)
tree9cfc7448b9ee246b036f8a00f4c762dee9e5707e /net-misc
parentNew lib that will be required by NetworkManager soon (#520002 by Timo Rothenp... (diff)
downloadgentoo-2-75a2328f578e57146689fe4b7fdbbaa92a279bfd.tar.gz
gentoo-2-75a2328f578e57146689fe4b7fdbbaa92a279bfd.tar.bz2
gentoo-2-75a2328f578e57146689fe4b7fdbbaa92a279bfd.zip
Version bump, add json-c USE flag and rename json to jansson. Import bash and zsh completions from upstream git. Import some bugfix patches from upstream.
(Portage version: 2.2.13/cvs/Linux x86_64, signed Manifest commit with key 0xE3F69979BB4B8928DA78E3D17CBF44EF)
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/lldpd/ChangeLog12
-rw-r--r--net-misc/lldpd/files/lldpd-0.7.10-completions.patch85
-rw-r--r--net-misc/lldpd/files/lldpd-0.7.10-handle-read-errors.patch0
-rw-r--r--net-misc/lldpd/files/lldpd-0.7.10-only-use-physical-for-chassis-id.patch30
-rw-r--r--net-misc/lldpd/files/lldpd-0.7.10-zsh-completion-dir.patch11
-rw-r--r--net-misc/lldpd/lldpd-0.7.10.ebuild106
-rw-r--r--net-misc/lldpd/metadata.xml2
7 files changed, 245 insertions, 1 deletions
diff --git a/net-misc/lldpd/ChangeLog b/net-misc/lldpd/ChangeLog
index 94c43600c612..589efffadb6e 100644
--- a/net-misc/lldpd/ChangeLog
+++ b/net-misc/lldpd/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for net-misc/lldpd
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/lldpd/ChangeLog,v 1.17 2014/07/08 23:17:39 chutzpah Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/lldpd/ChangeLog,v 1.18 2014/09/22 18:09:19 chutzpah Exp $
+
+*lldpd-0.7.10 (22 Sep 2014)
+
+ 22 Sep 2014; Patrick McLean <chutzpah@gentoo.org> +lldpd-0.7.10.ebuild,
+ +files/lldpd-0.7.10-completions.patch,
+ +files/lldpd-0.7.10-handle-read-errors.patch,
+ +files/lldpd-0.7.10-only-use-physical-for-chassis-id.patch,
+ +files/lldpd-0.7.10-zsh-completion-dir.patch, metadata.xml:
+ Version bump, add json-c USE flag and rename json to jansson. Import bash and
+ zsh completions from upstream git. Import some bugfix patches from upstream.
*lldpd-0.7.9-r3 (08 Jul 2014)
diff --git a/net-misc/lldpd/files/lldpd-0.7.10-completions.patch b/net-misc/lldpd/files/lldpd-0.7.10-completions.patch
new file mode 100644
index 000000000000..bdaba252ba49
--- /dev/null
+++ b/net-misc/lldpd/files/lldpd-0.7.10-completions.patch
@@ -0,0 +1,85 @@
+diff --git a/src/client/Makefile.am b/src/client/Makefile.am
+index af747ea..f7305db 100644
+--- a/src/client/Makefile.am
++++ b/src/client/Makefile.am
+@@ -39,3 +39,9 @@ lldpcli_SOURCES += jsonc_writer.c
+ lldpcli_CFLAGS += @JSONC_CFLAGS@
+ lldpcli_LDADD += @JSONC_LIBS@
+ endif
++
++# Completions
++bashcompletiondir = $(sysconfdir)/bash_completion.d
++bashcompletion_DATA = lldpcli.bash-completion
++zshcompletiondir = $(datadir)/zsh/vendor-completions
++zshcompletion_DATA = _lldpcli
+diff --git a/src/client/_lldpcli b/src/client/_lldpcli
+new file mode 100644
+index 0000000..9f7a98a
+--- /dev/null
++++ b/src/client/_lldpcli
+@@ -0,0 +1,40 @@
++#compdef lldpcli
++#
++# zsh completion for lldpcli
++#
++# Copyright (c) 2014 Vincent Bernat <bernat@luffy.cx>
++#
++# Permission to use, copy, modify, and/or distribute this software for any
++# purpose with or without fee is hereby granted, provided that the above
++# copyright notice and this permission notice appear in all copies.
++#
++# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
++# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++
++
++__lldpcli_command () {
++ local -a completions
++ completions=(${(f)"$(_call_program commands lldpcli complete ${words[1,$(($CURRENT-1))]})"})
++ completions=(${completions:s/ /:/})
++ _describe -t lldpcli-command "lldpcli completion" completions "$@"
++}
++
++_lldpcli () {
++ local curcontext="$curcontext" state line
++
++ _arguments -C \
++ '*-d[print more debugging information]' \
++ '(- *)-v[print version number and exit]' \
++ '-u[use an alternate socket with lldpd]:UNIX socket:_files' \
++ '-f[output format]:format:(plain xml json keyvalue)' \
++ '*-c[read a configuration file]:configuration file:_files' \
++ '(-)*::lldpcli command:__lldpcli_command'
++}
++
++
++_lldpcli "$@"
+diff --git a/src/client/lldpcli.bash-completion b/src/client/lldpcli.bash-completion
+new file mode 100755
+index 0000000..8ce68d7
+--- /dev/null
++++ b/src/client/lldpcli.bash-completion
+@@ -0,0 +1,19 @@
++# -*- sh -*-
++_lldpcli()
++{
++ COMPREPLY=()
++ COMP_WORDBREAKS=" "
++ local cur=${COMP_WORDS[COMP_CWORD]}
++ local cmd=(${COMP_WORDS[*]})
++
++ if [ "" != "$cur" ]; then
++ unset cmd[COMP_CWORD]
++ fi
++
++ local choices=$(${cmd[0]} complete ${cmd[@]:1} | \
++ cut -d " " -f 1)
++ COMPREPLY=($(compgen -W '${choices}' -- ${cur} ))
++ return 0
++}
++
++complete -F _lldpcli lldpcli
diff --git a/net-misc/lldpd/files/lldpd-0.7.10-handle-read-errors.patch b/net-misc/lldpd/files/lldpd-0.7.10-handle-read-errors.patch
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/net-misc/lldpd/files/lldpd-0.7.10-handle-read-errors.patch
diff --git a/net-misc/lldpd/files/lldpd-0.7.10-only-use-physical-for-chassis-id.patch b/net-misc/lldpd/files/lldpd-0.7.10-only-use-physical-for-chassis-id.patch
new file mode 100644
index 000000000000..43602a84d27c
--- /dev/null
+++ b/net-misc/lldpd/files/lldpd-0.7.10-only-use-physical-for-chassis-id.patch
@@ -0,0 +1,30 @@
+commit 790752d0b5e7941a2e368cee6e30df6695162752
+Author: Vincent Bernat <vincent@bernat.im>
+Date: Thu Sep 18 11:27:21 2014 +0200
+
+ interfaces: only use physical interfaces to get a chassis ID
+
+diff --git a/src/daemon/interfaces.c b/src/daemon/interfaces.c
+index d29eacc..a52e99c 100644
+--- a/src/daemon/interfaces.c
++++ b/src/daemon/interfaces.c
+@@ -288,8 +288,8 @@ interfaces_helper_vlan(struct lldpd *cfg,
+ }
+ #endif
+
+-/* Fill out chassis ID if not already done. This handler is special
+- because we will only handle interfaces that are already handled. */
++/* Fill out chassis ID if not already done. Only physical interfaces are
++ * considered. */
+ void
+ interfaces_helper_chassis(struct lldpd *cfg,
+ struct interfaces_device_list *interfaces)
+@@ -313,7 +313,7 @@ interfaces_helper_chassis(struct lldpd *cfg,
+ return; /* We already have one */
+
+ TAILQ_FOREACH(iface, interfaces, next) {
+- if (iface->flags) continue;
++ if (!(iface->type & IFACE_PHYSICAL_T)) continue;
+ if (cfg->g_config.c_cid_pattern &&
+ !pattern_match(iface->name, cfg->g_config.c_cid_pattern, 0)) continue;
+
diff --git a/net-misc/lldpd/files/lldpd-0.7.10-zsh-completion-dir.patch b/net-misc/lldpd/files/lldpd-0.7.10-zsh-completion-dir.patch
new file mode 100644
index 000000000000..666e8d5ac027
--- /dev/null
+++ b/net-misc/lldpd/files/lldpd-0.7.10-zsh-completion-dir.patch
@@ -0,0 +1,11 @@
+diff --git a/src/client/Makefile.am b/src/client/Makefile.am
+index 8281555..994904c 100644
+--- a/src/client/Makefile.am
++++ b/src/client/Makefile.am
+@@ -43,5 +43,5 @@ endif
+ # Completions
+ bashcompletiondir = $(sysconfdir)/bash_completion.d
+ bashcompletion_DATA = lldpcli.bash-completion
+-zshcompletiondir = $(datadir)/zsh/vendor-completions
++zshcompletiondir = $(datadir)/zsh/site-functions
+ zshcompletion_DATA = _lldpcli
diff --git a/net-misc/lldpd/lldpd-0.7.10.ebuild b/net-misc/lldpd/lldpd-0.7.10.ebuild
new file mode 100644
index 000000000000..213443379b28
--- /dev/null
+++ b/net-misc/lldpd/lldpd-0.7.10.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/lldpd/lldpd-0.7.10.ebuild,v 1.1 2014/09/22 18:09:19 chutzpah Exp $
+
+EAPI=5
+
+inherit eutils user systemd bash-completion-r1
+
+DESCRIPTION="Implementation of IEEE 802.1ab (LLDP)"
+HOMEPAGE="http://vincentbernat.github.com/lldpd/"
+SRC_URI="http://media.luffy.cx/files/${PN}/${P}.tar.gz"
+
+LICENSE="ISC"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="cdp doc +dot1 +dot3 edp fdp graph jansson json-c +lldpmed seccomp sonmp
+ snmp static-libs readline xml zsh-completion"
+
+RDEPEND=">=dev-libs/libevent-2.0.5
+ snmp? ( net-analyzer/net-snmp[extensible(+)] )
+ xml? ( dev-libs/libxml2 )
+ jansson? ( dev-libs/jansson )
+ json-c? ( dev-libs/json-c )
+ seccomp? ( sys-libs/libseccomp )
+ zsh-completion? ( app-shells/zsh )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ doc? (
+ graph? ( app-doc/doxygen[dot] )
+ !graph? ( app-doc/doxygen )
+ )"
+
+REQUIRED_USE="graph? ( doc ) json-c? ( !jansson )"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-completions.patch
+ "${FILESDIR}"/${P}-handle-read-errors.patch
+ "${FILESDIR}"/${P}-only-use-physical-for-chassis-id.patch
+ "${FILESDIR}"/${P}-zsh-completion-dir.patch
+)
+
+pkg_setup() {
+ ebegin "Creating lldpd user and group"
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 -1 ${PN}
+ eend $?
+}
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+ epatch_user
+}
+
+src_configure() {
+ econf \
+ --without-embedded-libevent \
+ --with-privsep-user=${PN} \
+ --with-privsep-group=${PN} \
+ --with-privsep-chroot=/run/${PN} \
+ --with-lldpd-ctl-socket=/run/${PN}.socket \
+ --with-lldpd-pid-file=/run/${PN}.pid \
+ --docdir=/usr/share/doc/${PF} \
+ $(use_enable graph doxygen-dot) \
+ $(use_enable doc doxygen-man) \
+ $(use_enable doc doxygen-pdf) \
+ $(use_enable doc doxygen-html) \
+ $(use_enable cdp) \
+ $(use_enable dot1) \
+ $(use_enable dot3) \
+ $(use_enable edp) \
+ $(use_enable fdp) \
+ $(use_enable lldpmed) \
+ $(use_enable sonmp) \
+ $(use_enable static-libs static) \
+ $(use_with json-c) \
+ $(use_with jansson) \
+ $(use_with readline) \
+ $(use_with seccomp) \
+ $(use_with snmp) \
+ $(use_with xml)
+}
+
+src_compile() {
+ emake
+ use doc && emake doxygen-doc
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ prune_libtool_files
+
+ newinitd "${FILESDIR}"/${PN}-initd-3 ${PN}
+ newconfd "${FILESDIR}"/${PN}-confd-1 ${PN}
+ newbashcomp src/client/lldpcli.bash-completion lldpcli
+
+ if use zsh-completion; then
+ insinto /usr/share/zsh/site-functions
+ doins src/client/_lldpcli
+ fi
+
+ use doc && dohtml -r doxygen/html/*
+
+ keepdir /etc/${PN}.d
+
+ systemd_dounit "${FILESDIR}"/${PN}.service
+}
diff --git a/net-misc/lldpd/metadata.xml b/net-misc/lldpd/metadata.xml
index b6d7fc9d49e2..6953550edc2a 100644
--- a/net-misc/lldpd/metadata.xml
+++ b/net-misc/lldpd/metadata.xml
@@ -25,7 +25,9 @@ lldpd also implements CDP (Cisco Discovery Protocol), FDP (Foundry Discovery Pro
<flag name='dot3'>Enable Dot3 extension (PHY stuff)</flag>
<flag name='edp'>Enable Extreme Discovery Protocol</flag>
<flag name='fdp'>Enable Foundry Discovery Protocol</flag>
+ <flag name='jansson'>Enable JSON output via Jansson</flag>
<flag name='json'>Enable JSON output via Jansson</flag>
+ <flag name='json-c'>Enable JSON output via json-c</flag>
<flag name='lldpmed'>Enable LLDP-MED extension</flag>
<flag name='seccomp'>Enable use of libseccomp for system call filtering</flag>
<flag name='sonmp'>Enable SynOptics Network Management</flag>