1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils user systemd bash-completion-r1 autotools
8 DESCRIPTION="Implementation of IEEE 802.1ab (LLDP)"
9 HOMEPAGE="https://vincentbernat.github.com/lldpd/"
10 SRC_URI="http://media.luffy.cx/files/${PN}/${P}.tar.gz"
15 IUSE="cdp doc +dot1 +dot3 edp fdp graph jansson +lldpmed old-kernel
16 sanitizers seccomp sonmp snmp static-libs readline xml zsh-completion"
18 RDEPEND="dev-libs/libbsd
19 >=dev-libs/libevent-2.0.5
20 snmp? ( net-analyzer/net-snmp[extensible(+)] )
21 xml? ( dev-libs/libxml2 )
22 jansson? ( dev-libs/jansson )
23 seccomp? ( sys-libs/libseccomp )
24 zsh-completion? ( app-shells/zsh )"
28 graph? ( app-doc/doxygen[dot] )
29 !graph? ( app-doc/doxygen )
32 REQUIRED_USE="graph? ( doc )"
35 "${FILESDIR}/${PN}-0.7.11-zsh-completion-dir.patch"
36 "${FILESDIR}/${PN}-0.9-seccomp-missing-syscalls.patch"
40 ebegin "Creating lldpd user and group"
42 enewuser ${PN} -1 -1 -1 ${PN}
55 --without-embedded-libevent \
56 --with-privsep-user=${PN} \
57 --with-privsep-group=${PN} \
58 --with-privsep-chroot=/run/${PN} \
59 --with-lldpd-ctl-socket=/run/${PN}.socket \
60 --with-lldpd-pid-file=/run/${PN}.pid \
61 --docdir=/usr/share/doc/${PF} \
63 $(use_enable doc doxygen-man) \
64 $(use_enable doc doxygen-pdf) \
65 $(use_enable doc doxygen-html) \
70 $(use_enable graph doxygen-dot) \
71 $(use_with jansson json) \
72 $(use_enable lldpmed) \
73 $(use_enable old-kernel oldies) \
75 $(use_enable static-libs static) \
76 $(use_with readline) \
77 $(use_enable sanitizers) \
85 use doc && emake doxygen-doc
89 emake DESTDIR="${D}" install
92 newinitd "${FILESDIR}"/${PN}-initd-5 ${PN}
93 newconfd "${FILESDIR}"/${PN}-confd-1 ${PN}
94 newbashcomp src/client/completion/lldpcli lldpcli
96 use doc && dodoc -r doxygen/html
99 doins "${FILESDIR}/lldpd.conf"
102 systemd_dounit "${FILESDIR}"/${PN}.service
103 systemd_newtmpfilesd "${FILESDIR}"/tmpfilesd ${PN}.conf