net-misc/youtube-dl: Version 2019.03.09
[gentoo.git] / net-misc / lldpd / lldpd-1.0.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit eutils user systemd bash-completion-r1 autotools
7
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"
11
12 LICENSE="ISC"
13 SLOT="0"
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"
17
18 RDEPEND="dev-libs/libbsd
19         >=dev-libs/libevent-2.0.5:=
20         sys-libs/readline:0=
21         snmp? ( net-analyzer/net-snmp[extensible(+)] )
22         xml? ( dev-libs/libxml2 )
23         seccomp? ( sys-libs/libseccomp )
24         zsh-completion? ( app-shells/zsh )"
25 DEPEND="${RDEPEND}
26         virtual/pkgconfig
27         doc? (
28                 graph? ( app-doc/doxygen[dot] )
29                 !graph? ( app-doc/doxygen )
30         )
31         test? ( dev-libs/check )"
32
33 REQUIRED_USE="graph? ( doc )"
34
35 PATCHES=(
36         "${FILESDIR}/${PN}-0.9.5-seccomp-add-socket-ops.patch"
37 )
38
39 pkg_setup() {
40         ebegin "Creating lldpd user and group"
41         enewgroup ${PN}
42         enewuser ${PN} -1 -1 -1 ${PN}
43         eend $?
44 }
45
46 src_prepare() {
47         default
48
49         eautoreconf
50         elibtoolize
51 }
52
53 src_configure() {
54         econf \
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} \
62                 $(use_enable cdp) \
63                 $(use_enable doc doxygen-man) \
64                 $(use_enable doc doxygen-pdf) \
65                 $(use_enable doc doxygen-html) \
66                 $(use_enable dot1) \
67                 $(use_enable dot3) \
68                 $(use_enable edp) \
69                 $(use_enable fdp) \
70                 $(use_enable graph doxygen-dot) \
71                 $(use_enable lldpmed) \
72                 $(use_enable old-kernel oldies) \
73                 $(use_enable sonmp) \
74                 $(use_enable static-libs static) \
75                 $(use_with readline) \
76                 $(use_enable sanitizers) \
77                 $(use_with seccomp) \
78                 $(use_with snmp) \
79                 $(use_with xml)
80 }
81
82 src_compile() {
83         emake
84         use doc && emake doxygen-doc
85 }
86
87 src_install() {
88         emake DESTDIR="${D}" install
89         prune_libtool_files
90
91         newinitd "${FILESDIR}"/${PN}-initd-5 ${PN}
92         newconfd "${FILESDIR}"/${PN}-confd-1 ${PN}
93         newbashcomp src/client/completion/lldpcli lldpcli
94
95         use doc && dodoc -r doxygen/html
96
97         insinto /etc
98         doins "${FILESDIR}/lldpd.conf"
99         keepdir /etc/${PN}.d
100
101         systemd_dounit "${FILESDIR}"/${PN}.service
102         systemd_newtmpfilesd "${FILESDIR}"/tmpfilesd ${PN}.conf
103 }