Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/nagios-core/, net-analyzer/nagios-core/files/
Date: Mon, 03 Sep 2018 14:21:41
Message-Id: 1535984343.56e365a929aedd2af9efe846365dfbf721b4c6c5.mjo@gentoo
1 commit: 56e365a929aedd2af9efe846365dfbf721b4c6c5
2 Author: Tomas Mozes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Mon Sep 3 05:33:55 2018 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 3 14:19:03 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56e365a9
7
8 net-analyzer/nagios-core: bump to 4.4.2
9
10 Package-Manager: Portage-2.3.48, Repoman-2.3.10
11 Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
12
13 net-analyzer/nagios-core/Manifest | 1 +
14 .../nagios-core/files/nagios-4.4.3-pre.patch | 42 ++++
15 net-analyzer/nagios-core/nagios-core-4.4.2.ebuild | 218 +++++++++++++++++++++
16 3 files changed, 261 insertions(+)
17
18 diff --git a/net-analyzer/nagios-core/Manifest b/net-analyzer/nagios-core/Manifest
19 index 11a8055082a..bb184319683 100644
20 --- a/net-analyzer/nagios-core/Manifest
21 +++ b/net-analyzer/nagios-core/Manifest
22 @@ -2,4 +2,5 @@ DIST nagios-4.3.3.tar.gz 11101531 BLAKE2B 537d49ecf28b457fbc1e24eaaa9c5d9e8c4db5
23 DIST nagios-4.3.4.tar.gz 11101966 BLAKE2B 6cb8182f40a4f83875c94df040bb1c62ce078d4130e10fa8595ea0b14cf715fc2a237ffb34199da9c1528e4789f3ce8deae3d993b5b795ad712d48b1e5fdb820 SHA512 f4e92aa98151739442a225a245871d93b5560d89510bdacb1a615959b9687f7a92675f10fcba71078b104ca8f237b0155a9261d67ec66f80aec7f033b4b3e316
24 DIST nagios-4.4.0.tar.gz 11295727 BLAKE2B f89e7934b13814ec8c0ae7a19f14eed8842c7b0044fb2812f1399f27a82e5a639b63cc53f04b58ae99aa87bf595b2e25642ad3eb134a041e39f744919bd46d2f SHA512 8c136463133cf26c756ccd39b158ed417297e30f8a0b12d063a4dba6a43f126b27bb5f7ea962c8cde9fb9c1fd8d3439d7cfeaab833045315a9800c993fa0676f
25 DIST nagios-4.4.1.tar.gz 11296403 BLAKE2B fdbaec5f913d18d5591f44cd1e0622b9741d7415b591f24f1521f2897b8a1bdbff00e9378ef6b3a6a99ab8d639960abd3d734fd66b665ea88ea1de169b552ace SHA512 d84f22a8fd21a573b4162f232c3a6bb2ba0b7d3a470e5fd80183a1862d2ae666956cfc2dd4c7fe6319ee7ccedb9f8a6920ba39a6b499ed9ff5b8be60a9779fa9
26 +DIST nagios-4.4.2.tar.gz 11301454 BLAKE2B 1b5ffa775bbf147e96d07edd36a387db271802d58cc1a1d1eb867645955aec0044e757785578a60c12549bd4e66e4c95ef06dd0f3f8be3599187d0ef0bcc8a4b SHA512 a6ddb2d8ca1c523d02659a2af0b9c67a3802893c946279bb15be53645dc64c997cd5562b77eab9dae03e756ec6622a9a641f7bd68269aba4ddd56ee21f50959e
27 DIST nagios-core-gentoo-icons-20141125.tar 40960 BLAKE2B 31c1953e1160c7c7b89606b72b1a80407e4c1b7a7938b40bd1c577cd0c309dd88ca6b775d692a9b846dbf67736537fa9c91e56aa15fdd447769608ca525bff09 SHA512 bf109879cddd6136b76baba55d0b60b2596e37431dcf5ce0905d34a9fa292ebf7e4bde82d9a084362c486e8fac344c76d88f9298b1b85541ed70ffd608493766
28
29 diff --git a/net-analyzer/nagios-core/files/nagios-4.4.3-pre.patch b/net-analyzer/nagios-core/files/nagios-4.4.3-pre.patch
30 new file mode 100644
31 index 00000000000..3c5eb030547
32 --- /dev/null
33 +++ b/net-analyzer/nagios-core/files/nagios-4.4.3-pre.patch
34 @@ -0,0 +1,42 @@
35 +diff --git a/Changelog b/Changelog
36 +index c695bd54..4c348894 100644
37 +--- a/Changelog
38 ++++ b/Changelog
39 +@@ -2,6 +2,11 @@
40 + Nagios Core 4 Change Log
41 + ########################
42 +
43 ++4.4.3 - 2018-XX-XX
44 ++------------------
45 ++FIXES
46 ++* Fixed services sending recovery emails when they recover if host in down state (#572) (Scott Wilkerson)
47 ++
48 + 4.4.2 - 2018-08-16
49 + ------------------
50 + FIXES
51 +diff --git a/base/notifications.c b/base/notifications.c
52 +index d4574c41..58ad140f 100644
53 +--- a/base/notifications.c
54 ++++ b/base/notifications.c
55 +@@ -591,10 +591,6 @@ int check_service_notification_viability(service *svc, int type, int options) {
56 + return ERROR;
57 + }
58 +
59 +- /***** RECOVERY NOTIFICATIONS ARE GOOD TO GO AT THIS POINT *****/
60 +- if(svc->current_state == STATE_OK)
61 +- return OK;
62 +-
63 + /* don't notify contacts about this service problem again if the notification interval is set to 0 */
64 + if(svc->no_more_notifications == TRUE) {
65 + log_debug_info(DEBUGL_NOTIFICATIONS, 1, "We shouldn't re-notify contacts about this service problem.\n");
66 +@@ -1501,10 +1497,6 @@ int check_host_notification_viability(host *hst, int type, int options) {
67 + return ERROR;
68 + }
69 +
70 +- /***** RECOVERY NOTIFICATIONS ARE GOOD TO GO AT THIS POINT *****/
71 +- if(hst->current_state == HOST_UP)
72 +- return OK;
73 +-
74 + /* check if we shouldn't renotify contacts about the host problem */
75 + if(hst->no_more_notifications == TRUE) {
76 + log_debug_info(DEBUGL_NOTIFICATIONS, 1, "We shouldn't re-notify contacts about this host problem.\n");
77
78 diff --git a/net-analyzer/nagios-core/nagios-core-4.4.2.ebuild b/net-analyzer/nagios-core/nagios-core-4.4.2.ebuild
79 new file mode 100644
80 index 00000000000..cb47956dba4
81 --- /dev/null
82 +++ b/net-analyzer/nagios-core/nagios-core-4.4.2.ebuild
83 @@ -0,0 +1,218 @@
84 +# Copyright 1999-2018 Gentoo Foundation
85 +# Distributed under the terms of the GNU General Public License v2
86 +
87 +EAPI=6
88 +
89 +inherit toolchain-funcs user
90 +
91 +MY_P=${PN/-core}-${PV}
92 +DESCRIPTION="Nagios core - monitoring daemon, web GUI, and documentation"
93 +HOMEPAGE="https://www.nagios.org/"
94 +
95 +# The name of the directory into which our Gentoo icons will be
96 +# extracted, and also the basename of the archive containing it.
97 +GENTOO_ICONS="${PN}-gentoo-icons-20141125"
98 +SRC_URI="mirror://sourceforge/nagios/${MY_P}.tar.gz
99 + web? ( https://dev.gentoo.org/~mjo/distfiles/${GENTOO_ICONS}.tar )"
100 +
101 +LICENSE="GPL-2"
102 +SLOT="0"
103 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
104 +IUSE="apache2 classicui lighttpd perl +web vim-syntax"
105 +
106 +# In pkg_postinst(), we change the group of the Nagios configuration
107 +# directory to that of the web server user. It can't belong to both
108 +# apache/lighttpd groups at the same time, so we block this combination
109 +# for our own sanity.
110 +#
111 +# This could be made to work, but we would need a better way to allow
112 +# the web user read-only access to Nagios's configuration directory.
113 +#
114 +REQUIRED_USE="apache2? ( !lighttpd )"
115 +
116 +# sys-devel/libtool dependency is bug #401237.
117 +#
118 +# Note, we require one of the apache2 CGI modules:
119 +#
120 +# * mod_cgi
121 +# * mod_cgid
122 +# * mod_fcgid
123 +#
124 +# We just don't care /which/ one. And of course PHP supports both CGI
125 +# (USE=cgi) and FastCGI (USE=fpm). We're pretty lenient with the
126 +# dependencies, and expect the user not to do anything /too/
127 +# stupid. (For example, installing Apache with only FastCGI support, and
128 +# PHP with only CGI support.)
129 +#
130 +# Another annoyance is that the upstream Makefile uses app-arch/unzip to
131 +# extract a snapshot of AngularJS, but that's only needed when USE=web.
132 +#
133 +MOD_ALIAS=apache2_modules_alias
134 +DEPEND="sys-devel/libtool
135 + virtual/mailx
136 + perl? ( dev-lang/perl:= )
137 + web? (
138 + app-arch/unzip
139 + media-libs/gd[jpeg,png]
140 + lighttpd? ( www-servers/lighttpd[php] )
141 + apache2? (
142 + || (
143 + >=www-servers/apache-2.4[${MOD_ALIAS},apache2_modules_cgi]
144 + >=www-servers/apache-2.4[${MOD_ALIAS},apache2_modules_cgid]
145 + >=www-servers/apache-2.4[${MOD_ALIAS},apache2_modules_fcgid] )
146 + || (
147 + dev-lang/php:*[apache2]
148 + dev-lang/php:*[cgi]
149 + dev-lang/php:*[fpm] )
150 + )
151 + )"
152 +RDEPEND="${DEPEND}
153 + vim-syntax? ( app-vim/nagios-syntax )"
154 +
155 +PATCHES=(
156 + "${FILESDIR}/nagios-4.4.3-pre.patch"
157 +)
158 +
159 +S="${WORKDIR}/${MY_P}"
160 +
161 +pkg_setup() {
162 + enewgroup nagios
163 + enewuser nagios -1 /bin/bash /var/nagios/home nagios
164 +}
165 +
166 +src_configure() {
167 + local myconf
168 +
169 + if use perl; then
170 + myconf="${myconf} --enable-embedded-perl --with-perlcache"
171 + fi
172 +
173 + if use !apache2 && use !lighttpd ; then
174 + myconf="${myconf} --with-command-group=nagios"
175 + else
176 + if use apache2 ; then
177 + myconf="${myconf} --with-command-group=apache"
178 + myconf="${myconf} --with-httpd-conf=/etc/apache2/conf.d"
179 + elif use lighttpd ; then
180 + myconf="${myconf} --with-command-group=lighttpd"
181 + fi
182 + fi
183 +
184 + econf ${myconf} \
185 + --prefix=/usr \
186 + --bindir=/usr/sbin \
187 + --sbindir=/usr/$(get_libdir)/nagios/cgi-bin \
188 + --datadir=/usr/share/nagios/htdocs \
189 + --localstatedir=/var/nagios \
190 + --sysconfdir=/etc/nagios \
191 + --libexecdir=/usr/$(get_libdir)/nagios/plugins
192 +}
193 +
194 +src_compile() {
195 + emake CC=$(tc-getCC) nagios
196 +
197 + if use web; then
198 + # Only compile the CGIs/HTML when USE=web is set.
199 + emake CC=$(tc-getCC) DESTDIR="${D}" cgis html
200 + fi
201 +}
202 +
203 +src_install() {
204 + dodoc Changelog CONTRIBUTING.md README.md THANKS UPGRADING
205 +
206 + # There is no way to install the CGIs unstripped from the top-level
207 + # makefile, so descend into base/ here. The empty INSTALL_OPTS
208 + # ensures that root:root: owns the nagios executables.
209 + cd "${S}/base" || die
210 + emake INSTALL_OPTS="" DESTDIR="${D}" install-unstripped
211 + cd "${S}" || die
212 +
213 + # Otherwise this gets installed as 770 and you get "access denied"
214 + # for some reason or other when starting nagios. The permissions
215 + # on nagiostats are just for consistency (these should both get
216 + # fixed upstream).
217 + fperms 775 /usr/sbin/nagios /usr/sbin/nagiostats
218 +
219 + # INSTALL_OPTS are needed for most of install-basic, but we don't
220 + # want them on the LIBEXECDIR, argh.
221 + emake DESTDIR="${D}" install-basic
222 + fowners root:root /usr/$(get_libdir)/nagios/plugins
223 +
224 + # Don't make the configuration owned by the nagios user, because
225 + # then he can edit nagios.cfg and trick nagios into running as root
226 + # and doing his bidding.
227 + emake INSTALL_OPTS="" DESTDIR="${D}" install-config
228 +
229 + # No INSTALL_OPTS used in install-commandmode, thankfully.
230 + emake DESTDIR="${D}" install-commandmode
231 +
232 + if use web; then
233 + # There is no way to install the CGIs unstripped from the
234 + # top-level makefile, so descend into cgi/ here. The empty
235 + # INSTALL_OPTS ensures that root:root: owns the CGI executables.
236 + cd "${S}/cgi" || die
237 + emake INSTALL_OPTS="" DESTDIR="${D}" install-unstripped
238 + cd "${S}" || die
239 +
240 + # install-html installs the new exfoliation theme
241 + emake INSTALL_OPTS="" DESTDIR="${D}" install-html
242 +
243 + if use classicui; then
244 + # This overwrites the already-installed exfoliation theme
245 + emake INSTALL_OPTS="" DESTDIR="${D}" install-classicui
246 + fi
247 +
248 + # Install cute Gentoo icons (bug #388323), setting their
249 + # owner, group, and mode to match those of the rest of Nagios's
250 + # images.
251 + insinto /usr/share/nagios/htdocs/images/logos
252 + doins "${WORKDIR}/${GENTOO_ICONS}"/*.*
253 + fi
254 +
255 + newinitd startup/openrc-init nagios
256 +
257 + if use web ; then
258 + if use apache2 ; then
259 + # Install the Nagios configuration file for Apache.
260 + insinto "/etc/apache2/modules.d"
261 + doins "${FILESDIR}"/99_nagios4.conf
262 + elif use lighttpd ; then
263 + # Install the Nagios configuration file for Lighttpd.
264 + insinto /etc/lighttpd
265 + newins "${FILESDIR}/lighttpd_nagios4.conf" nagios.conf
266 + else
267 + ewarn "${CATEGORY}/${PF} only supports apache or lighttpd"
268 + ewarn "out of the box. Since you are not using one of them, you"
269 + ewarn "will have to configure your webserver yourself."
270 + fi
271 + fi
272 +}
273 +
274 +pkg_postinst() {
275 +
276 + if use web; then
277 + if use apache2 || use lighttpd ; then
278 + if use apache2; then
279 + elog "To enable the Nagios web front-end, please edit"
280 + elog "${ROOT}etc/conf.d/apache2 and add \"-D NAGIOS -D PHP\""
281 + elog "to APACHE2_OPTS. Then Nagios will be available at,"
282 + elog
283 + elif use lighttpd; then
284 + elog "To enable the Nagios web front-end, please add"
285 + elog "'include \"nagios.conf\"' to the lighttpd configuration"
286 + elog "file at ${ROOT}etc/lighttpd/lighttpd.conf. Then Nagios"
287 + elog "will be available at,"
288 + elog
289 + fi
290 +
291 + elog " http://localhost/nagios/"
292 + fi
293 + fi
294 +
295 + elog
296 + elog "If your kernel has /proc protection, nagios"
297 + elog "will not be happy as it relies on accessing the proc"
298 + elog "filesystem. You can fix this by adding nagios into"
299 + elog "the group wheel, but this is not recomended."
300 + elog
301 +}