1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 GENTOO_DEPEND_ON_PERL=no
7 PYTHON_COMPAT=( python2_7 )
8 inherit autotools perl-module python-single-r1
13 DESCRIPTION="Nagios/Icinga event broker that allows quick/direct access to your status data"
14 HOMEPAGE="http://mathias-kettner.de/checkmk_livestatus.html"
15 SRC_URI="http://mathias-kettner.de/download/${MY_P}.tar.gz"
19 KEYWORDS="~amd64 ~ppc ~x86"
20 IUSE="examples nagios4 perl python test"
21 RESTRICT="!test? ( test )"
22 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
24 RDEPEND="!sys-apps/ucspi-unix:0
27 virtual/perl-Digest-MD5:0
28 virtual/perl-Scalar-List-Utils:0
29 >=virtual/perl-Thread-Queue-2.11:0
33 python? ( ${PYTHON_DEPS} )"
36 dev-perl/Module-Install:0
37 virtual/perl-ExtUtils-MakeMaker:0
38 virtual/perl-File-Path:0
39 virtual/perl-File-Spec:0
40 virtual/perl-File-Temp:0
42 dev-perl/File-Copy-Recursive:0
44 dev-perl/Test-Perl-Critic:0
45 dev-perl/Test-Pod-Coverage:0
46 dev-perl/Perl-Critic:0
47 dev-perl/Perl-Critic-Policy-Dynamic-NoIndirect:0
48 dev-perl/Perl-Critic-Deprecated:0
49 dev-perl/Perl-Critic-Nits:0
56 S="${WORKDIR}/${MY_P}"
59 "${FILESDIR}/1.2.8_p10-MEDIUM-Drop-default-strip.patch"
60 "${FILESDIR}/1.2.8_p10-MINOR-test-Remove-the-usage-of-Perl-Critic-Policy-Mo.patch"
66 # Use system Module::Install instead, it will be copied to $S by
67 # Module::install itself.
68 rm -rf api/perl/inc || die
71 # Ensure patches are not applied twice
73 perl-module_src_prepare
85 perl-module_src_configure
94 perl-module_src_compile
102 export TEST_AUTHOR="Test Author"
108 emake install DESTDIR="${ED}"
110 # install a config file showing whats needed to enable livestatus for nagios
111 cat <<EOF >"${T}"/nagios.cfg
112 # Ensure all data is set to event brokers
113 event_broker_options=-1
114 broker_module=${EPREFIX}/usr/$(get_libdir)/mk-livestatus/livestatus.o
117 cat <<EOF >"${T}"/icigna.cfg
119 module_name mk-livestatus
121 path /usr/$(get_libdir)/mk-livestatus/livestatus.o
122 args /var/lib/icigna/rw/live
125 insinto /usr/share/mk-livestatus
126 doins "${T}"/{nagios,icigna}.cfg
130 perl-module_src_install
133 if use examples; then
135 newdoc api/perl/README README.perl
138 dodoc api/perl/examples/dump.pl
143 python_foreach_impl python_domodule api/python/livestatus.py
145 if use examples; then
147 newdoc api/python/README README.python
150 dodoc api/python/{example,example_multisite,make_nagvis_map}.py
156 elog "Sample configurations for icigna and nagios are available in"
157 elog "/usr/share/${PN}"