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: Mon, 28 Mar 2022 12:11:24
Message-Id: 1648469349.acf9105710f193abfdc1d98025bb6bf27e9f9eab.mjo@gentoo
1 commit: acf9105710f193abfdc1d98025bb6bf27e9f9eab
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 28 12:08:55 2022 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 28 12:09:09 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=acf91057
7
8 net-analyzer/nagios-core: remove old EAPI=7 ebuild.
9
10 Closes: https://bugs.gentoo.org/836082
11 Package-Manager: Portage-3.0.30, Repoman-3.0.3
12 Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
13
14 .../nagios-core/nagios-core-4.4.6-r2.ebuild | 270 ---------------------
15 1 file changed, 270 deletions(-)
16
17 diff --git a/net-analyzer/nagios-core/nagios-core-4.4.6-r2.ebuild b/net-analyzer/nagios-core/nagios-core-4.4.6-r2.ebuild
18 deleted file mode 100644
19 index da7044dcdd6a..000000000000
20 --- a/net-analyzer/nagios-core/nagios-core-4.4.6-r2.ebuild
21 +++ /dev/null
22 @@ -1,270 +0,0 @@
23 -# Copyright 1999-2022 Gentoo Authors
24 -# Distributed under the terms of the GNU General Public License v2
25 -
26 -EAPI=7
27 -
28 -inherit systemd toolchain-funcs
29 -
30 -MY_P="${PN/-core}-${PV}"
31 -DESCRIPTION="Nagios core - monitoring daemon, web GUI, and documentation"
32 -HOMEPAGE="https://www.nagios.org/"
33 -
34 -# The name of the directory into which our Gentoo icons will be
35 -# extracted, and also the basename of the archive containing it.
36 -GENTOO_ICONS="${PN}-gentoo-icons-20141125"
37 -SRC_URI="mirror://sourceforge/nagios/${MY_P}.tar.gz
38 - web? ( https://dev.gentoo.org/~mjo/distfiles/${GENTOO_ICONS}.tar )"
39 -
40 -LICENSE="GPL-2"
41 -SLOT="0"
42 -KEYWORDS="~alpha amd64 ~arm ~arm64 ~ppc ppc64 sparc x86"
43 -IUSE="apache2 classicui lighttpd perl +web vim-syntax"
44 -
45 -# In pkg_postinst(), we change the group of the Nagios configuration
46 -# directory to that of the web server user. It can't belong to both
47 -# apache/lighttpd groups at the same time, so we block this combination
48 -# for our own sanity.
49 -#
50 -# This could be made to work, but we would need a better way to allow
51 -# the web user read-only access to Nagios's configuration directory.
52 -#
53 -REQUIRED_USE="apache2? ( !lighttpd )"
54 -
55 -#
56 -# Note, we require one of the apache2 CGI modules:
57 -#
58 -# * mod_cgi (USE=apache2_modules_cgi)
59 -# * mod_cgid (USE=apache2_modules_cgid)
60 -# * mod_fcgid (www-apache/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 -# Another annoyance is that the upstream Makefile uses app-arch/unzip to
69 -# extract a snapshot of AngularJS, but that's only needed when USE=web.
70 -#
71 -MOD_ALIAS=apache2_modules_alias
72 -
73 -# The dependencies checked by the configure script. All of these are
74 -# also runtime dependencies; that's why ./configure checks for them.
75 -CONFIGURE_DEPEND="acct-group/nagios
76 - acct-user/nagios
77 - virtual/mailx
78 - perl? ( dev-lang/perl:= )"
79 -
80 -# In addition to the things that the ./configure script checks for,
81 -# we also need to be able to unzip stuff on the build host.
82 -#
83 -# We need the apache/lighttpd groups in src_install() for the things
84 -# installed as the --with-command-group argument, so they go here too.
85 -# The groups are also needed at runtime, but that is ensured by apache
86 -# and lighttpd themselves being in RDEPEND.
87 -BDEPEND="${CONFIGURE_DEPEND}
88 - apache2? ( acct-group/apache )
89 - lighttpd? ( acct-group/lighttpd )
90 - web? ( app-arch/unzip )"
91 -
92 -# This is linked into /usr/bin/nagios{,tats}
93 -DEPEND="dev-libs/libltdl:0"
94 -
95 -RDEPEND="${CONFIGURE_DEPEND}
96 - ${DEPEND}
97 - web? (
98 - media-libs/gd[jpeg,png]
99 - lighttpd? ( www-servers/lighttpd[php] )
100 - apache2? (
101 - || (
102 - www-servers/apache[${MOD_ALIAS},apache2_modules_cgi]
103 - www-servers/apache[${MOD_ALIAS},apache2_modules_cgid]
104 - ( www-servers/apache[${MOD_ALIAS}] www-apache/mod_fcgid ) )
105 - || (
106 - dev-lang/php:*[apache2]
107 - dev-lang/php:*[cgi]
108 - dev-lang/php:*[fpm] )
109 - )
110 - )
111 - vim-syntax? ( app-vim/nagios-syntax )"
112 -
113 -S="${WORKDIR}/${MY_P}"
114 -
115 -src_configure() {
116 - local myconf
117 -
118 - if use perl; then
119 - myconf="${myconf} --enable-embedded-perl --with-perlcache"
120 - fi
121 -
122 - if use !apache2 && use !lighttpd ; then
123 - myconf="${myconf} --with-command-group=nagios"
124 - else
125 - if use apache2 ; then
126 - myconf="${myconf} --with-command-group=apache"
127 - myconf="${myconf} --with-httpd-conf=/etc/apache2/conf.d"
128 - elif use lighttpd ; then
129 - myconf="${myconf} --with-command-group=lighttpd"
130 - fi
131 - fi
132 -
133 - # We pass "unknown" as the init type because we don't want it to
134 - # guess. Later on, we'll manually install both OpenRC and systemd
135 - # services.
136 - econf ${myconf} \
137 - --prefix="${EPREFIX}/usr" \
138 - --bindir="${EPREFIX}/usr/sbin" \
139 - --localstatedir="${EPREFIX}/var/lib/nagios" \
140 - --sysconfdir="${EPREFIX}/etc/nagios" \
141 - --libexecdir="${EPREFIX}/usr/$(get_libdir)/nagios/plugins" \
142 - --with-cgibindir="${EPREFIX}/usr/$(get_libdir)/nagios/cgi-bin" \
143 - --with-webdir="${EPREFIX}/usr/share/nagios/htdocs" \
144 - --with-init-type="unknown"
145 -
146 - # The paths in the web server configuration files need to match
147 - # those passed to econf above.
148 - cp "${FILESDIR}/99_nagios4-r1.conf" \
149 - "${FILESDIR}/lighttpd_nagios4-r1.conf" \
150 - "${T}/" || die "failed to create copies of web server conf files"
151 -
152 - sed -e "s|@CGIBINDIR@|${EPREFIX}/usr/$(get_libdir)/nagios/cgi-bin|g" \
153 - -e "s|@WEBDIR@|${EPREFIX}/usr/share/nagios/htdocs|" \
154 - -i "${T}/99_nagios4-r1.conf" \
155 - -i "${T}/lighttpd_nagios4-r1.conf" \
156 - || die "failed to substitute paths into web server conf files"
157 -
158 -}
159 -
160 -src_compile() {
161 - emake CC="$(tc-getCC)" nagios
162 -
163 - if use web; then
164 - # Only compile the CGIs/HTML when USE=web is set.
165 - emake CC="$(tc-getCC)" DESTDIR="${D}" cgis html
166 - fi
167 -}
168 -
169 -src_install() {
170 - dodoc Changelog CONTRIBUTING.md README.md THANKS UPGRADING
171 -
172 - # There is no way to install the CGIs unstripped from the top-level
173 - # makefile, so descend into base/ here. The empty INSTALL_OPTS
174 - # ensures that root:root: owns the nagios executables.
175 - cd "${S}/base" || die
176 - emake INSTALL_OPTS="" DESTDIR="${D}" install-unstripped
177 - cd "${S}" || die
178 -
179 - # Otherwise this gets installed as 770 and you get "access denied"
180 - # for some reason or other when starting nagios. The permissions
181 - # on nagiostats are just for consistency (these should both get
182 - # fixed upstream).
183 - fperms 775 /usr/sbin/nagios /usr/sbin/nagiostats
184 -
185 - # INSTALL_OPTS are needed for most of install-basic, but we don't
186 - # want them on the LIBEXECDIR, argh.
187 - emake DESTDIR="${D}" install-basic
188 - fowners root:root /usr/$(get_libdir)/nagios/plugins
189 -
190 - # Don't make the configuration owned by the nagios user, because
191 - # then he can edit nagios.cfg and trick nagios into running as root
192 - # and doing his bidding.
193 - emake INSTALL_OPTS="" DESTDIR="${D}" install-config
194 -
195 - # No INSTALL_OPTS used in install-commandmode, thankfully.
196 - emake DESTDIR="${D}" install-commandmode
197 -
198 - # The build system installs these directories, but portage assumes
199 - # that the build system doesn't know what it's doing so we have to
200 - # keepdir them, too. I guess you'll have to manually re-check the
201 - # upstream build system forever to see if this is still necessary.
202 - keepdir /var/lib/nagios{,/archives,/rw,/spool,/spool/checkresults}
203 -
204 - if use web; then
205 - # There is no way to install the CGIs unstripped from the
206 - # top-level makefile, so descend into cgi/ here. The empty
207 - # INSTALL_OPTS ensures that root:root: owns the CGI executables.
208 - cd "${S}/cgi" || die
209 - emake INSTALL_OPTS="" DESTDIR="${D}" install-unstripped
210 - cd "${S}" || die
211 -
212 - # install-html installs the new exfoliation theme
213 - emake INSTALL_OPTS="" DESTDIR="${D}" install-html
214 -
215 - if use classicui; then
216 - # This overwrites the already-installed exfoliation theme
217 - emake INSTALL_OPTS="" DESTDIR="${D}" install-classicui
218 - fi
219 -
220 - # Install cute Gentoo icons (bug #388323), setting their
221 - # owner, group, and mode to match those of the rest of Nagios's
222 - # images.
223 - insinto /usr/share/nagios/htdocs/images/logos
224 - doins "${WORKDIR}/${GENTOO_ICONS}"/*.*
225 - fi
226 -
227 - # The ./configure script for nagios detects the init system on the
228 - # build host, which is wrong for all sorts of reasons. We've gone
229 - # to great lengths above to avoid running "install-init" -- even
230 - # indirectly -- and so now we must install whatever service files
231 - # we need by hand.
232 - newinitd startup/openrc-init nagios
233 - systemd_newunit startup/default-service nagios.service
234 -
235 - if use web ; then
236 - if use apache2 ; then
237 - # Install the Nagios configuration file for Apache.
238 - insinto "/etc/apache2/modules.d"
239 - newins "${T}/99_nagios4-r1.conf" "99_nagios4.conf"
240 - elif use lighttpd ; then
241 - # Install the Nagios configuration file for Lighttpd.
242 - insinto /etc/lighttpd
243 - newins "${T}/lighttpd_nagios4-r1.conf" nagios.conf
244 - else
245 - ewarn "${CATEGORY}/${PF} only supports apache or lighttpd"
246 - ewarn "out of the box. Since you are not using one of them, you"
247 - ewarn "will have to configure your webserver yourself."
248 - fi
249 - fi
250 -}
251 -
252 -pkg_postinst() {
253 -
254 - if use web; then
255 - if use apache2 || use lighttpd ; then
256 - if use apache2; then
257 - elog "To enable the Nagios web front-end, please edit"
258 - elog "${ROOT}/etc/conf.d/apache2 and add \"-D NAGIOS -D PHP\""
259 - elog "to APACHE2_OPTS. Then Nagios will be available at,"
260 - elog
261 - elif use lighttpd; then
262 - elog "To enable the Nagios web front-end, please add"
263 - elog "'include \"nagios.conf\"' to the lighttpd configuration"
264 - elog "file at ${ROOT}/etc/lighttpd/lighttpd.conf. Then Nagios"
265 - elog "will be available at,"
266 - elog
267 - fi
268 -
269 - elog " http://localhost/nagios/"
270 - fi
271 - fi
272 -
273 - elog
274 - elog "If your kernel has /proc protection, nagios"
275 - elog "will not be happy as it relies on accessing the proc"
276 - elog "filesystem. You can fix this by adding nagios into"
277 - elog "the group wheel, but this is not recomended."
278 - elog
279 -
280 - if [ -n "${REPLACING_VERSIONS}" ]; then
281 - ewarn "The local state directory for nagios has changed in v4.4.5,"
282 - ewarn "from ${EROOT}/var/nagios to ${EROOT}/var/lib/nagios. If you"
283 - ewarn "wish to migrate your state to the new location, first stop"
284 - ewarn "nagios and then run"
285 - ewarn ""
286 - ewarn " diff --recursive --brief ${EROOT}/var/nagios ${EROOT}/var/lib/nagios"
287 - ewarn ""
288 - ewarn "to identify any files that should be moved to the new"
289 - ewarn "location. They can simply be moved with \"mv\" before"
290 - ewarn "restarting nagios."
291 - fi
292 -}