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