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