Gentoo Archives: gentoo-commits

From: "Tobias Scherbaum (dertobi123)" <dertobi123@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-analyzer/nagios-core: nagios-core-3.0.6-r1.ebuild ChangeLog nagios-core-3.0.6.ebuild
Date: Thu, 22 Jan 2009 17:01:03
Message-Id: E1LQ2vL-0001j2-Bg@stork.gentoo.org
1 dertobi123 09/01/22 17:00:59
2
3 Modified: ChangeLog
4 Added: nagios-core-3.0.6-r1.ebuild
5 Removed: nagios-core-3.0.6.ebuild
6 Log:
7 Require mod_alias in lighttpd config, #191675
8 (Portage version: 2.2_rc23/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.136 net-analyzer/nagios-core/ChangeLog
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-core/ChangeLog?rev=1.136&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-core/ChangeLog?rev=1.136&content-type=text/plain
15 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-core/ChangeLog?r1=1.135&r2=1.136
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/ChangeLog,v
20 retrieving revision 1.135
21 retrieving revision 1.136
22 diff -u -r1.135 -r1.136
23 --- ChangeLog 2 Dec 2008 17:48:30 -0000 1.135
24 +++ ChangeLog 22 Jan 2009 17:00:59 -0000 1.136
25 @@ -1,6 +1,13 @@
26 # ChangeLog for net-analyzer/nagios-core
27 -# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/ChangeLog,v 1.135 2008/12/02 17:48:30 dertobi123 Exp $
29 +# Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2
30 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/ChangeLog,v 1.136 2009/01/22 17:00:59 dertobi123 Exp $
31 +
32 +*nagios-core-3.0.6-r1 (22 Jan 2009)
33 +
34 + 22 Jan 2009; Tobias Scherbaum <dertobi123@g.o>
35 + +files/lighttpd_nagios3-r1.conf, -nagios-core-3.0.6.ebuild,
36 + +nagios-core-3.0.6-r1.ebuild:
37 + Require mod_alias in lighttpd config, #191675
38
39 *nagios-core-3.0.6 (02 Dec 2008)
40
41
42
43
44 1.1 net-analyzer/nagios-core/nagios-core-3.0.6-r1.ebuild
45
46 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-core/nagios-core-3.0.6-r1.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-core/nagios-core-3.0.6-r1.ebuild?rev=1.1&content-type=text/plain
48
49 Index: nagios-core-3.0.6-r1.ebuild
50 ===================================================================
51 # Copyright 1999-2009 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-3.0.6-r1.ebuild,v 1.1 2009/01/22 17:00:59 dertobi123 Exp $
54
55 EAPI="1"
56
57 inherit eutils depend.apache toolchain-funcs
58
59 MY_P=${PN/-core}-${PV}
60 DESCRIPTION="Nagios Core - Check daemon, CGIs, docs"
61 HOMEPAGE="http://www.nagios.org/"
62 SRC_URI="mirror://sourceforge/nagios/${MY_P}.tar.gz"
63
64 LICENSE="GPL-2"
65 SLOT="0"
66 KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
67 IUSE="debug lighttpd perl +web vim-syntax"
68 DEPEND="virtual/mailx
69 web? (
70 >=media-libs/jpeg-6b-r3
71 >=media-libs/libpng-1.2.5-r4
72 >=media-libs/gd-1.8.3-r5
73 lighttpd? ( www-servers/lighttpd )
74 )
75 perl? ( >=dev-lang/perl-5.6.1-r7 )"
76 RDEPEND="${DEPEND}
77 vim-syntax? ( app-vim/nagios-syntax )"
78
79 want_apache2
80
81 S="${WORKDIR}/${MY_P}"
82
83 pkg_setup() {
84 # Check if gd has been compiled with jpeg and png support
85 if use web; then
86 if ! built_with_use media-libs/gd jpeg png; then
87 eerror "Your gd has been compiled without jpeg and/or png support."
88 eerror "Please re-emerge gd:"
89 eerror "# USE="jpeg png" emerge gd"
90 die "pkg_setup failed"
91 fi
92 fi
93
94 enewgroup nagios
95 enewuser nagios -1 /bin/bash /var/nagios/home nagios
96 }
97
98 src_unpack() {
99 unpack ${A}
100 cd "${S}"
101
102 local strip="$(echo '$(MAKE) strip-post-install')"
103 sed -i -e "s:${strip}::" {cgi,base}/Makefile.in || die "sed failed in Makefile.in"
104 }
105
106 src_compile() {
107 local myconf
108
109 if use perl ; then
110 myconf="${myconf} --enable-embedded-perl --with-perlcache"
111 fi
112
113 if use debug; then
114 myconf="${myconf} --enable-DEBUG0"
115 myconf="${myconf} --enable-DEBUG1"
116 myconf="${myconf} --enable-DEBUG2"
117 myconf="${myconf} --enable-DEBUG3"
118 myconf="${myconf} --enable-DEBUG4"
119 myconf="${myconf} --enable-DEBUG5"
120 fi
121
122 if use !apache2 && use !lighttpd ; then
123 myconf="${myconf} --with-command-grp=nagios"
124 else
125 if use apache2 ; then
126 myconf="${myconf} --with-command-grp=apache"
127 myconf="${myconf} --with-httpd-conf=/etc/apache2/conf.d"
128 elif use lighttpd ; then
129 myconf="${myconf} --with-command-grp=lighttpd"
130 fi
131 fi
132
133 econf ${myconf} \
134 --prefix=/usr \
135 --bindir=/usr/sbin \
136 --sbindir=/usr/$(get_libdir)/nagios/cgi-bin \
137 --datadir=/usr/share/nagios/htdocs \
138 --localstatedir=/var/nagios \
139 --sysconfdir=/etc/nagios \
140 --libexecdir=/usr/$(get_libdir)/nagios/plugins \
141 || die "./configure failed"
142
143 emake CC=$(tc-getCC) nagios || die "make failed"
144
145 if use web ; then
146 # Only compile the CGI's if "web" useflag is set.
147 emake CC=$(tc-getCC) DESTDIR="${D}" cgis || die
148 fi
149 }
150
151 src_install() {
152 dodoc Changelog INSTALLING LEGAL README UPGRADING
153
154 if ! use web ; then
155 sed -i -e 's/cd $(SRC_CGI) && $(MAKE) $@/# line removed due missing web use flag/' \
156 -e 's/cd $(SRC_HTM) && $(MAKE) $@/# line removed due missing web use flag/' \
157 Makefile
158 fi
159
160 sed -i -e 's/^contactgroups$//g' Makefile
161
162 emake DESTDIR="${D}" install
163 emake DESTDIR="${D}" install-config
164 emake DESTDIR="${D}" install-commandmode
165
166 newinitd "${FILESDIR}"/nagios3 nagios
167 newconfd "${FILESDIR}"/conf.d nagios
168
169 # Apache Module
170 if use web ; then
171 if use apache2 ; then
172 insinto "${APACHE_MODULES_CONFDIR}"
173 doins "${FILESDIR}"/99_nagios3.conf
174 elif use lighttpd ; then
175 insinto /etc/lighttpd
176 newins "${FILESDIR}/lighttpd_nagios3-r1.conf" nagios.conf
177 else
178 ewarn "${CATEGORY}/${PF} only supports Apache-2.x or Lighttpd webserver"
179 ewarn "out-of-the-box. Since you are not using one of them, you"
180 ewarn "have to configure your webserver accordingly yourself."
181 fi
182
183 fi
184
185 for dir in etc/nagios var/nagios ; do
186 chown -R nagios:nagios "${D}/${dir}" || die "Failed chown of ${D}/${dir}"
187 done
188
189 chown -R root:root "${D}"/usr/$(get_libdir)/nagios
190 find "${D}"/usr/$(get_libdir)/nagios -type d -print0 | xargs -0 chmod 755
191 find "${D}"/usr/$(get_libdir)/nagios/cgi-bin -type f -print0 | xargs -0 chmod 755
192
193 keepdir /etc/nagios
194 keepdir /var/nagios
195 keepdir /var/nagios/archives
196 keepdir /var/nagios/rw
197 keepdir /var/nagios/spool/checkresults
198
199 if use !apache2 && use !lighttpd; then
200 chown -R nagios:nagios "${D}"/var/nagios/rw || die "Failed chown of ${D}/var/nagios/rw"
201 else
202 if use apache2 ; then
203 chown -R nagios:apache "${D}"/var/nagios/rw || die "Failed chown of ${D}/var/nagios/rw"
204 elif use lighttpd ; then
205 chown -R nagios:lighttpd "${D}"/var/nagios/rw || die "Failed chown of ${D}/var/nagios/rw"
206 fi
207 fi
208
209 chmod ug+s "${D}"/var/nagios/rw || die "Failed Chmod of ${D}/var/nagios/rw"
210 chmod 0750 "${D}"/etc/nagios || die "Failed chmod of ${D}/etc/nagios"
211 }
212
213 pkg_postinst() {
214 elog "If you want nagios to start at boot time"
215 elog "remember to execute:"
216 elog " rc-update add nagios default"
217 elog
218
219 if use web ; then
220 elog "This does not include cgis that are perl-dependent"
221 elog "Currently traceroute.cgi is perl-dependent"
222 elog "To have ministatus.cgi requires copying of ministatus.c"
223 elog "to cgi directory for compiling."
224
225 elog "Note that the user your webserver is running at needs"
226 elog "read-access to /etc/nagios."
227 elog
228
229 if use apache2 || use lighttpd ; then
230 elog "There are several possible solutions to accomplish this,"
231 elog "choose the one you are most comfortable with:"
232 elog
233 if use apache2 ; then
234 elog " usermod -G nagios apache"
235 elog "or"
236 elog " chown nagios:apache /etc/nagios"
237 elog
238 elog "Also edit /etc/conf.d/apache2 and add \"-D NAGIOS\""
239 elif use lighttpd ; then
240 elog " usermod -G nagios lighttpd "
241 elog "or"
242 elog " chown nagios:lighttpd /etc/nagios"
243 fi
244 elog
245 elog "That will make nagios's web front end visable via"
246 elog "http://localhost/nagios/"
247 elog
248 else
249 elog "IMPORTANT: Do not forget to add the user your webserver"
250 elog "is running as to the nagios group!"
251 fi
252
253 else
254 elog "Please note that you have installed Nagios without web interface."
255 elog "Please don't file any bugs about having no web interface when you do this."
256 elog "Thank you!"
257 fi
258
259 elog
260 elog "If your kernel has /proc protection, nagios"
261 elog "will not be happy as it relies on accessing the proc"
262 elog "filesystem. You can fix this by adding nagios into"
263 elog "the group wheel, but this is not recomended."
264 elog
265 }
266
267 pkg_postinst() {
268 einfo "Fixing permissions"
269 chown nagios:nagios "${ROOT}"var/nagios
270 }