app-editors/kakoune: drop old 0_pre20160620
[gentoo.git] / net-misc / lldpd / lldpd-0.9.3-r1.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
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 jansson +lldpmed old-kernel
16         sanitizers seccomp sonmp snmp static-libs readline xml zsh-completion"
17
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 )"
25 DEPEND="${RDEPEND}
26         virtual/pkgconfig
27         doc? (
28                 graph? ( app-doc/doxygen[dot] )
29                 !graph? ( app-doc/doxygen )
30         )"
31
32 REQUIRED_USE="graph? ( doc )"
33
34 PATCHES=(
35         "${FILESDIR}/${PN}-0.7.11-zsh-completion-dir.patch"
36         "${FILESDIR}/${PN}-0.9-seccomp-missing-syscalls.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_with jansson json) \
72                 $(use_enable lldpmed) \
73                 $(use_enable old-kernel oldies) \
74                 $(use_enable sonmp) \
75                 $(use_enable static-libs static) \
76                 $(use_with readline) \
77                 $(use_enable sanitizers) \
78                 $(use_with seccomp) \
79                 $(use_with snmp) \
80                 $(use_with xml)
81 }
82
83 src_compile() {
84         emake
85         use doc && emake doxygen-doc
86 }
87
88 src_install() {
89         emake DESTDIR="${D}" install
90         prune_libtool_files
91
92         newinitd "${FILESDIR}"/${PN}-initd-5 ${PN}
93         newconfd "${FILESDIR}"/${PN}-confd-1 ${PN}
94         newbashcomp src/client/completion/lldpcli lldpcli
95
96         use doc && dodoc -r doxygen/html
97
98         insinto /etc
99         doins "${FILESDIR}/lldpd.conf"
100         keepdir /etc/${PN}.d
101
102         systemd_dounit "${FILESDIR}"/${PN}.service
103         systemd_newtmpfilesd "${FILESDIR}"/tmpfilesd ${PN}.conf
104 }