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