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