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: ChangeLog nagios-core-2.10-r2.ebuild
Date: Wed, 27 Feb 2008 20:30:21
Message-Id: E1JUSur-0005eu-GX@stork.gentoo.org
1 dertobi123 08/02/27 20:30:13
2
3 Modified: ChangeLog
4 Added: nagios-core-2.10-r2.ebuild
5 Log:
6 Fix apache eclass handling, patch by Jakub Moc in #209655
7 (Portage version: 2.1.4.4)
8
9 Revision Changes Path
10 1.111 net-analyzer/nagios-core/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-core/ChangeLog?rev=1.111&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-core/ChangeLog?rev=1.111&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-core/ChangeLog?r1=1.110&r2=1.111
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/ChangeLog,v
19 retrieving revision 1.110
20 retrieving revision 1.111
21 diff -u -r1.110 -r1.111
22 --- ChangeLog 31 Jan 2008 19:55:36 -0000 1.110
23 +++ ChangeLog 27 Feb 2008 20:30:12 -0000 1.111
24 @@ -1,6 +1,12 @@
25 # ChangeLog for net-analyzer/nagios-core
26 # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/ChangeLog,v 1.110 2008/01/31 19:55:36 hollow Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/ChangeLog,v 1.111 2008/02/27 20:30:12 dertobi123 Exp $
29 +
30 +*nagios-core-2.10-r2 (27 Feb 2008)
31 +
32 + 27 Feb 2008; Tobias Scherbaum <dertobi123@g.o>
33 + +nagios-core-2.10-r2.ebuild:
34 + Fix apache eclass handling, patch by Jakub Moc in #209655
35
36 31 Jan 2008; Benedikt Böhm <hollow@g.o> nagios-core-1.4.1.ebuild,
37 nagios-core-1.4.1-r1.ebuild, nagios-core-2.10-r1.ebuild:
38
39
40
41 1.1 net-analyzer/nagios-core/nagios-core-2.10-r2.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-core/nagios-core-2.10-r2.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-core/nagios-core-2.10-r2.ebuild?rev=1.1&content-type=text/plain
45
46 Index: nagios-core-2.10-r2.ebuild
47 ===================================================================
48 # Copyright 1999-2008 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/nagios-core-2.10-r2.ebuild,v 1.1 2008/02/27 20:30:12 dertobi123 Exp $
51
52 EAPI="1"
53
54 inherit eutils depend.apache toolchain-funcs
55
56 MY_P=${PN/-core}-${PV/_}
57 DESCRIPTION="Nagios Core - Check daemon, CGIs, docs"
58 HOMEPAGE="http://www.nagios.org/"
59 SRC_URI="mirror://sourceforge/nagios/${MY_P}.tar.gz
60 mirror://gentoo/nagios-2.0b.cfg-sample.gz"
61
62 LICENSE="GPL-2"
63 SLOT="0"
64 KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
65 IUSE="debug perl +web vim-syntax"
66 DEPEND="virtual/mailx
67 web? (
68 >=media-libs/jpeg-6b-r3
69 >=media-libs/libpng-1.2.5-r4
70 >=media-libs/gd-1.8.3-r5
71 perl? ( net-analyzer/traceroute )
72 )
73 perl? ( >=dev-lang/perl-5.6.1-r7 )"
74 RDEPEND="${DEPEND}
75 vim-syntax? ( app-vim/nagios-syntax )"
76
77 want_apache2
78
79 S="${WORKDIR}/${MY_P}"
80
81 pkg_setup() {
82 # Check if gd has been compiled with jpeg and png support
83 if use web; then
84 if ! built_with_use media-libs/gd jpeg png; then
85 eerror "Your gd has been compiled without jpeg and/or png support."
86 eerror "Please re-emerge gd:"
87 eerror "# USE="jpeg png" emerge gd"
88 die "pkg_setup failed"
89 fi
90 fi
91
92 enewgroup nagios
93 enewuser nagios -1 /bin/bash /var/nagios/home nagios
94 }
95
96 src_unpack() {
97 unpack ${A}
98 cd "${S}"
99
100 epatch "${FILESDIR}"/2.x-series-nsca.patch
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
110 then
111 myconf="${myconf} --enable-embedded-perl --with-perlcache"
112 fi
113
114 if use debug; then
115 myconf="${myconf} --enable-DEBUG0"
116 myconf="${myconf} --enable-DEBUG1"
117 myconf="${myconf} --enable-DEBUG2"
118 myconf="${myconf} --enable-DEBUG3"
119 myconf="${myconf} --enable-DEBUG4"
120 myconf="${myconf} --enable-DEBUG5"
121 fi
122
123 if use apache2 ; then
124 myconf="${myconf} --with-command-grp=apache"
125 else
126 myconf="${myconf} --with-command-grp=nagios"
127 fi
128
129 econf ${myconf} \
130 --prefix=/usr/nagios \
131 --localstatedir=/var/nagios \
132 --sysconfdir=/etc/nagios \
133 --datadir=/usr/nagios/share \
134 || die "./configure failed"
135
136 emake CC=$(tc-getCC) nagios || die "make failed"
137
138 if use web ; then
139 # Only compile the CGI's if "web" useflag is set.
140 make CC=$(tc-getCC) DESTDIR="${D}" cgis || die
141 fi
142
143 emake -C contrib all || "contrib make filed"
144
145 }
146
147 src_install() {
148 dodoc Changelog INSTALLING LEGAL README UPGRADING
149 docinto contrib
150 dodoc contrib/README
151
152 if ! use web; then
153 sed -i -e 's/cd $(SRC_CGI) && $(MAKE) $@/# line removed due missing web use flag/' \
154 -e 's/cd $(SRC_HTM) && $(MAKE) $@/# line removed due missing web use flag/' \
155 Makefile
156 fi
157
158 sed -i -e 's/^contactgroups$//g' Makefile
159
160 make DESTDIR="${D}" install
161 make DESTDIR="${D}" install-config
162 make DESTDIR="${D}" install-commandmode
163
164 docinto sample-configs
165 dodoc "${D}"/etc/nagios/*
166 rm "${D}"/etc/nagios/*
167
168 newdoc "${WORKDIR}"/nagios-2.0b.cfg-sample nagios.cfg-sample
169
170 #contribs are not configured by the configure script, we'll configure them overselves...
171 find "${S}"/contrib/ -type f | xargs sed -e 's:/usr/local/nagios/var/rw:/var/nagios/rw:;
172 s:/usr/local/nagios/libexec:/usr/nagios/libexec:;
173 s:/usr/local/nagios/etc:/etc/nagios:;
174 s:/usr/local/nagios/sbin:/usr/nagios/sbin:;' -i
175
176 insinto /usr/share/doc/${PF}/contrib
177 doins -r contrib/eventhandlers
178
179 doinitd "${FILESDIR}"/nagios
180 newconfd "${FILESDIR}"/conf.d nagios
181
182 chmod 644 "${S}"/contrib/*.cgi
183 into /usr/nagios
184 for bin in `find contrib/ -type f -perm 0755 -maxdepth 1` ; do
185 dobin "$bin"
186 done
187
188 # Apache Module
189 if use web ; then
190 if use apache2 ; then
191 insinto "${APACHE_MODULES_CONFDIR}"
192 doins "${FILESDIR}"/99_nagios.conf
193 else
194 ewarn "${CATEGORY}/${PF} only supports apache-2.x webserver"
195 ewarn "out-of-the-box. Since you are not using apache, you"
196 ewarn "have to configure your webserver accordingly yourself."
197 fi
198
199 if use perl; then
200 into /usr/nagios ; dosbin contrib/traceroute.cgi
201 fi
202 fi
203
204 for dir in etc/nagios var/nagios ; do
205 chown -R nagios:nagios "${D}/${dir}" || die "Failed chown of ${D}/${dir}"
206 done
207
208 chown -R root:root "${D}"/usr/nagios
209 find "${D}"/usr/nagios -type d -print0 | xargs -0 chmod 755
210 find "${D}"/usr/nagios/*bin -type f -print0 | xargs -0 chmod 755
211 find "${D}"/usr/nagios/share -type f -print0 | xargs -0 chmod 644
212
213 keepdir /etc/nagios
214 keepdir /var/nagios
215 keepdir /var/nagios/archives
216 keepdir /usr/nagios/share/ssi
217 keepdir /var/nagios/rw
218
219 if use apache2 ; then
220 chown -R nagios:apache "${D}"/var/nagios/rw || die "Failed Chown of ${D}/var/nagios/rw"
221 else
222 chown -R nagios:nagios "${D}"/var/nagios/rw || die "Failed Chown of ${D}/var/nagios/rw"
223 fi
224
225 chmod ug+s "${D}"/var/nagios/rw || die "Failed Chmod of ${D}/var/nagios/rw"
226 chmod 0750 "${D}"/etc/nagios || die "Failed chmod of ${D}/etc/nagios"
227
228 cat << EOF > "${T}"/55-nagios-core-revdep
229 SEARCH_DIRS="/usr/nagios/bin /usr/nagios/libexec"
230 EOF
231
232 insinto /etc/revdep-rebuild
233 doins "${T}"/55-nagios-core-revdep
234 }
235
236 pkg_postinst() {
237 elog
238 elog "The example config files are located at /usr/share/doc/${PF}/sample-configs/."
239 elog
240 elog "Also, if you want nagios to start at boot time"
241 elog "remember to execute:"
242 elog " rc-update add nagios default"
243 elog
244
245 if use web; then
246 elog "This does not include cgis that are perl-dependent"
247 elog "Currently traceroute.cgi is perl-dependent"
248 elog "To have ministatus.cgi requires copying of ministatus.c"
249 elog "to cgi directory for compiling."
250
251 elog "Note that the user your webserver is running at needs"
252 elog "read-access to /etc/nagios."
253 elog
254
255 if use apache2 ; then
256 elog "There are several possible solutions to accomplish this,"
257 elog "choose the one you are most comfortable with:"
258 elog " usermod -G nagios apache"
259 elog "or"
260 elog " chown nagios:apache /etc/nagios"
261 elog
262 elog "Also edit /etc/conf.d/apache2 and add \"-D NAGIOS\""
263 elog
264 elog "That will make nagios's web front end visable via"
265 elog "http://localhost/nagios/"
266 elog
267 else
268 elog "IMPORTANT: Do not forget to add the user your webserver"
269 elog "is running as to the nagios group!"
270 fi
271
272 else
273 elog "Please note that you have installed Nagios without web interface."
274 elog "Please don't file any bugs about having no web interface when you do this."
275 elog "Thank you!"
276 fi
277
278 elog
279 elog "If your kernel has /proc protection, nagios"
280 elog "will not be happy as it relies on accessing the proc"
281 elog "filesystem. You can fix this by adding nagios into"
282 elog "the group wheel, but this is not recomended."
283 elog
284
285 elog
286 ewarn "Use /usr/nagios/bin/convertcfg for configuration file conversion"
287 }
288
289 pkg_prerm() {
290 [[ "${ROOT}" == "/" ]] && /etc/init.d/nagios stop
291 }
292
293
294
295 --
296 gentoo-commits@l.g.o mailing list