Gentoo Archives: gentoo-commits

From: "Michael Orlitzky (mjo)" <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-analyzer/nagios-core: nagios-core-4.0.8-r1.ebuild ChangeLog nagios-core-4.0.8.ebuild
Date: Wed, 26 Nov 2014 14:31:57
Message-Id: 20141126143154.1EF4EAF49@oystercatcher.gentoo.org
1 mjo 14/11/26 14:31:54
2
3 Modified: ChangeLog
4 Added: nagios-core-4.0.8-r1.ebuild
5 Removed: nagios-core-4.0.8.ebuild
6 Log:
7 Revbump to fix bugs #388323 and #530640.
8
9 (Portage version: 2.2.8-r2/cvs/Linux x86_64, signed Manifest commit with key 0x6F48D3DA05C2DADB!)
10
11 Revision Changes Path
12 1.201 net-analyzer/nagios-core/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nagios-core/ChangeLog?rev=1.201&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nagios-core/ChangeLog?rev=1.201&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nagios-core/ChangeLog?r1=1.200&r2=1.201
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/ChangeLog,v
21 retrieving revision 1.200
22 retrieving revision 1.201
23 diff -u -r1.200 -r1.201
24 --- ChangeLog 22 Nov 2014 21:29:34 -0000 1.200
25 +++ ChangeLog 26 Nov 2014 14:31:54 -0000 1.201
26 @@ -1,6 +1,13 @@
27 # ChangeLog for net-analyzer/nagios-core
28 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/ChangeLog,v 1.200 2014/11/22 21:29:34 mjo Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/ChangeLog,v 1.201 2014/11/26 14:31:54 mjo Exp $
31 +
32 +*nagios-core-4.0.8-r1 (26 Nov 2014)
33 +
34 + 26 Nov 2014; Michael Orlitzky <mjo@g.o>
35 + +files/fix-bogus-perf-data-warnings.patch, +nagios-core-4.0.8-r1.ebuild,
36 + -nagios-core-4.0.8.ebuild:
37 + Revbump to fix bugs #388323 and #530640.
38
39 *nagios-core-4.0.8 (22 Nov 2014)
40
41
42
43
44 1.1 net-analyzer/nagios-core/nagios-core-4.0.8-r1.ebuild
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nagios-core/nagios-core-4.0.8-r1.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/nagios-core/nagios-core-4.0.8-r1.ebuild?rev=1.1&content-type=text/plain
48
49 Index: nagios-core-4.0.8-r1.ebuild
50 ===================================================================
51 # Copyright 1999-2014 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/nagios-core-4.0.8-r1.ebuild,v 1.1 2014/11/26 14:31:54 mjo Exp $
54
55 EAPI=5
56
57 inherit depend.apache eutils multilib toolchain-funcs user
58
59 MY_P=${PN/-core}-${PV}
60 DESCRIPTION="Nagios Core - Check daemon, CGIs, docs"
61 HOMEPAGE="http://www.nagios.org/"
62
63 # The name of the directory into which our Gentoo icons will be
64 # extracted, and also the basename of the archive containing it.
65 GENTOO_ICONS="${PN}-gentoo-icons-20141125"
66 SRC_URI="mirror://sourceforge/nagios/${MY_P}.tar.gz
67 web? ( http://dev.gentoo.org/~mjo/distfiles/${GENTOO_ICONS}.tar )"
68
69 LICENSE="GPL-2"
70 SLOT="0"
71 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
72 IUSE="classicui lighttpd perl +web vim-syntax"
73
74 # In pkg_postinst(), we change the group of the Nagios configuration
75 # directory to that of the web server user. It can't belong to both
76 # apache/lighttpd groups at the same time, so we block this combination
77 # for our own sanity.
78 #
79 # This could be made to work, but we would need a better way to allow
80 # the web user read-only access to Nagios's configuration directory.
81 #
82 REQUIRED_USE="apache2? ( !lighttpd )"
83
84 # sys-devel/libtool dependency is bug #401237.
85 #
86 # Note, we require one of the apache2 CGI modules:
87 #
88 # * mod_cgi
89 # * mod_cgid
90 # * mod_fcgid
91 #
92 # We just don't care /which/ one. And of course PHP supports both CGI
93 # (USE=cgi) and FastCGI (USE=fpm). We're pretty lenient with the
94 # dependencies, and expect the user not to do anything /too/
95 # stupid. (For example, installing Apache with only FastCGI support, and
96 # PHP with only CGI support.)
97 #
98 DEPEND="sys-devel/libtool
99 virtual/mailx
100 perl? ( dev-lang/perl )
101 web? (
102 media-libs/gd[jpeg,png]
103 lighttpd? ( www-servers/lighttpd[php] )
104 apache2? (
105 || (
106 >=www-servers/apache-2.4[apache2_modules_alias,apache2_modules_cgi]
107 >=www-servers/apache-2.4[apache2_modules_alias,apache2_modules_cgid]
108 >=www-servers/apache-2.4[apache2_modules_alias,apache2_modules_fcgid]
109 )
110
111 || ( dev-lang/php[apache2] dev-lang/php[cgi] dev-lang/php[fpm] )
112 )
113 )"
114 RDEPEND="${DEPEND}
115 !net-analyzer/nagios-imagepack
116 vim-syntax? ( app-vim/nagios-syntax )"
117
118 want_apache2
119
120 S="${WORKDIR}/${MY_P}"
121
122 pkg_setup() {
123 depend.apache_pkg_setup
124
125 enewgroup nagios
126 enewuser nagios -1 /bin/bash /var/nagios/home nagios
127 }
128
129 src_prepare(){
130 # Upstream bug, fixes a QA warning:
131 #
132 # http://tracker.nagios.org/view.php?id=650
133 #
134 epatch "${FILESDIR}"/use-MAKE-instead-of-bare-make.patch
135
136 # Upstream bug:
137 #
138 # http://tracker.nagios.org/view.php?id=651
139 #
140 # Gentoo bug #388321.
141 #
142 epatch "${FILESDIR}"/use-INSTALL-to-install-themes.patch
143
144 # Upstream bug:
145 #
146 # http://tracker.nagios.org/view.php?id=534
147 #
148 # Gentoo bug #530640.
149 epatch "${FILESDIR}"/fix-bogus-perf-data-warnings.patch
150 }
151
152 src_configure() {
153 local myconf
154
155 if use perl; then
156 myconf="${myconf} --enable-embedded-perl --with-perlcache"
157 fi
158
159 if use !apache2 && use !lighttpd ; then
160 myconf="${myconf} --with-command-group=nagios"
161 else
162 if use apache2 ; then
163 myconf="${myconf} --with-command-group=apache"
164 myconf="${myconf} --with-httpd-conf=/etc/apache2/conf.d"
165 elif use lighttpd ; then
166 myconf="${myconf} --with-command-group=lighttpd"
167 fi
168 fi
169
170 econf ${myconf} \
171 --prefix=/usr \
172 --bindir=/usr/sbin \
173 --sbindir=/usr/$(get_libdir)/nagios/cgi-bin \
174 --datadir=/usr/share/nagios/htdocs \
175 --localstatedir=/var/nagios \
176 --sysconfdir=/etc/nagios \
177 --libexecdir=/usr/$(get_libdir)/nagios/plugins
178 }
179
180 src_compile() {
181 emake CC=$(tc-getCC) nagios
182
183 if use web; then
184 # Only compile the CGIs when USE=web is set.
185 emake CC=$(tc-getCC) DESTDIR="${D}" cgis
186 fi
187 }
188
189 src_install() {
190 dodoc Changelog INSTALLING LEGAL README.asciidoc UPGRADING
191
192 emake DESTDIR="${D}" install-base
193 emake DESTDIR="${D}" install-basic
194 emake DESTDIR="${D}" install-config
195 emake DESTDIR="${D}" install-commandmode
196
197 if use web; then
198 emake DESTDIR="${D}" install-cgis
199
200 # install-html installs the new exfoliation theme
201 emake DESTDIR="${D}" install-html
202
203 if use classicui; then
204 # This overwrites the already-installed exfoliation theme
205 emake DESTDIR="${D}" install-classicui
206 fi
207
208 # Install cute Gentoo icons (bug #388323), setting their
209 # owner, group, and mode to match those of the rest of Nagios's
210 # images.
211 insopts --group=nagios --owner=nagios --mode=0664
212 insinto /usr/share/nagios/htdocs/images/logos
213 doins "${WORKDIR}/${GENTOO_ICONS}"/*.*
214 insopts --mode=0644 # Back to the default...
215 fi
216
217 newinitd "${FILESDIR}"/nagios4 nagios
218 newconfd "${FILESDIR}"/conf.d nagios
219
220 if use web ; then
221 if use apache2 ; then
222 # Install the Nagios configuration file for Apache.
223 insinto "${APACHE_MODULES_CONFDIR}"
224 doins "${FILESDIR}"/99_nagios4.conf
225 elif use lighttpd ; then
226 # Install the Nagios configuration file for Lighttpd.
227 insinto /etc/lighttpd
228 newins "${FILESDIR}/lighttpd_nagios4.conf" nagios.conf
229 else
230 ewarn "${CATEGORY}/${PF} only supports apache or lighttpd"
231 ewarn "out of the box. Since you are not using one of them, you"
232 ewarn "will have to configure your webserver yourself."
233 fi
234 fi
235
236 for dir in etc/nagios var/nagios ; do
237 chown -R nagios:nagios "${D}/${dir}" \
238 || die "failed chown of ${D}/${dir}"
239 done
240
241 chown -R root:root "${D}/usr/$(get_libdir)/nagios" \
242 || die "failed chown of ${D}/usr/$(get_libdir)/nagios"
243
244 # The following two find...exec statements will die properly as long
245 # as chmod is only called once (that is, as long as the argument
246 # list is small enough).
247 find "${D}/usr/$(get_libdir)/nagios" -type d \
248 -exec chmod 755 '{}' + || die 'failed to make nagios dirs traversable'
249
250 if use web; then
251 find "${D}/usr/$(get_libdir)/nagios/cgi-bin" -type f \
252 -exec chmod 755 '{}' + || die 'failed to make cgi-bins executable'
253 fi
254
255 keepdir /etc/nagios
256 keepdir /var/nagios
257 keepdir /var/nagios/archives
258 keepdir /var/nagios/rw
259 keepdir /var/nagios/spool/checkresults
260
261 if use !apache2 && use !lighttpd; then
262 chown -R nagios:nagios "${D}"/var/nagios/rw \
263 || die "failed chown of ${D}/var/nagios/rw"
264 else
265 if use apache2 ; then
266 chown -R nagios:apache "${D}"/var/nagios/rw \
267 || die "failed chown of ${D}/var/nagios/rw"
268 elif use lighttpd ; then
269 chown -R nagios:lighttpd "${D}"/var/nagios/rw \
270 || die "failed chown of ${D}/var/nagios/rw"
271 fi
272 fi
273
274 chmod ug+s "${D}"/var/nagios/rw || die "failed chmod of ${D}/var/nagios/rw"
275 chmod 0750 "${D}"/etc/nagios || die "failed chmod of ${D}/etc/nagios"
276 }
277
278 pkg_postinst() {
279
280 if use web; then
281 elog "Note that your web server user requires read-only access to"
282 elog "${ROOT}etc/nagios."
283
284 if use apache2 || use lighttpd ; then
285 elog
286 elog "To that end, we have changed the group of ${ROOT}etc/nagios"
287 elog "to that of your web server user."
288 elog
289 if use apache2; then
290 chown nagios:apache "${ROOT}etc/nagios" \
291 || die "failed to change group of ${ROOT}etc/nagios"
292
293 elog "To enable the Nagios web front-end, please edit"
294 elog "${ROOT}etc/conf.d/apache2 and add \"-D NAGIOS -D PHP5\""
295 elog "to APACHE2_OPTS. Then Nagios will be available at,"
296 elog
297 elif use lighttpd; then
298 chown nagios:lighttpd "${ROOT}etc/nagios" \
299 || die "failed to change group of ${ROOT}etc/nagios"
300 elog "To enable the Nagios web front-end, please add"
301 elog "'include \"nagios.conf\"' to the lighttpd configuration"
302 elog "file at ${ROOT}etc/lighttpd/lighttpd.conf. Then Nagios"
303 elog "will be available at,"
304 elog
305 fi
306
307 elog " http://localhost/nagios/"
308 else
309 elog "Since you're not using either Apache or Lighttpd, you"
310 elog "will have to grant the necessary permissions yourself."
311 fi
312 fi
313
314 elog
315 elog "If your kernel has /proc protection, nagios"
316 elog "will not be happy as it relies on accessing the proc"
317 elog "filesystem. You can fix this by adding nagios into"
318 elog "the group wheel, but this is not recomended."
319 elog
320 }