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