1 # Copyright 1999-2019 Gentoo Authors
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"
14 KEYWORDS="~amd64 ~x86"
15 IUSE="cdp doc +dot1 +dot3 edp fdp graph +lldpmed old-kernel sanitizers
16 seccomp sonmp snmp static-libs test readline xml zsh-completion"
18 RDEPEND="dev-libs/libbsd
19 >=dev-libs/libevent-2.0.5:=
21 snmp? ( net-analyzer/net-snmp[extensible(+)] )
22 xml? ( dev-libs/libxml2 )
23 seccomp? ( sys-libs/libseccomp )
24 zsh-completion? ( app-shells/zsh )"
28 graph? ( app-doc/doxygen[dot] )
29 !graph? ( app-doc/doxygen )
31 test? ( dev-libs/check )"
33 REQUIRED_USE="graph? ( doc )"
36 "${FILESDIR}/${PN}-0.9.5-seccomp-add-socket-ops.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_enable lldpmed) \
72 $(use_enable old-kernel oldies) \
74 $(use_enable static-libs static) \
75 $(use_with readline) \
76 $(use_enable sanitizers) \
84 use doc && emake doxygen-doc
88 emake DESTDIR="${D}" install
91 newinitd "${FILESDIR}"/${PN}-initd-5 ${PN}
92 newconfd "${FILESDIR}"/${PN}-confd-1 ${PN}
93 newbashcomp src/client/completion/lldpcli lldpcli
95 use doc && dodoc -r doxygen/html
98 doins "${FILESDIR}/lldpd.conf"
101 systemd_dounit "${FILESDIR}"/${PN}.service
102 systemd_newtmpfilesd "${FILESDIR}"/tmpfilesd ${PN}.conf