diff options
author | Tobias Scherbaum <dertobi123@gentoo.org> | 2008-02-27 20:30:12 +0000 |
---|---|---|
committer | Tobias Scherbaum <dertobi123@gentoo.org> | 2008-02-27 20:30:12 +0000 |
commit | 6a6ab7cd1a8a7861cf332848b1854cf2294b8ddf (patch) | |
tree | a9012b96ee36822557c92989883674a492d23531 /net-analyzer/nagios-core | |
parent | Moved check for mpich2 useflag into its proper place. (diff) | |
download | historical-6a6ab7cd1a8a7861cf332848b1854cf2294b8ddf.tar.gz historical-6a6ab7cd1a8a7861cf332848b1854cf2294b8ddf.tar.bz2 historical-6a6ab7cd1a8a7861cf332848b1854cf2294b8ddf.zip |
Fix apache eclass handling, patch by Jakub Moc in #209655
Package-Manager: portage-2.1.4.4
Diffstat (limited to 'net-analyzer/nagios-core')
-rw-r--r-- | net-analyzer/nagios-core/ChangeLog | 8 | ||||
-rw-r--r-- | net-analyzer/nagios-core/Manifest | 13 | ||||
-rw-r--r-- | net-analyzer/nagios-core/nagios-core-2.10-r2.ebuild | 244 |
3 files changed, 253 insertions, 12 deletions
diff --git a/net-analyzer/nagios-core/ChangeLog b/net-analyzer/nagios-core/ChangeLog index d612d69d5361..d83922779bc7 100644 --- a/net-analyzer/nagios-core/ChangeLog +++ b/net-analyzer/nagios-core/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-analyzer/nagios-core # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/ChangeLog,v 1.110 2008/01/31 19:55:36 hollow Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-core/ChangeLog,v 1.111 2008/02/27 20:30:12 dertobi123 Exp $ + +*nagios-core-2.10-r2 (27 Feb 2008) + + 27 Feb 2008; Tobias Scherbaum <dertobi123@gentoo.org> + +nagios-core-2.10-r2.ebuild: + Fix apache eclass handling, patch by Jakub Moc in #209655 31 Jan 2008; Benedikt Böhm <hollow@gentoo.org> nagios-core-1.4.1.ebuild, nagios-core-1.4.1-r1.ebuild, nagios-core-2.10-r1.ebuild: diff --git a/net-analyzer/nagios-core/Manifest b/net-analyzer/nagios-core/Manifest index 34645542f9ab..a228f7c06520 100644 --- a/net-analyzer/nagios-core/Manifest +++ b/net-analyzer/nagios-core/Manifest @@ -1,6 +1,3 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - AUX 2.x-series-nsca.patch 767 RMD160 69c3916842953666037dcf258906c15a9ce0047a SHA1 5f376bd65bf74eeb3cc00efde4fadf7f8962d06c SHA256 04ecb77abfe7618d036a2b598ea30df6704a82285b2210055eda4dd6414c94d3 AUX 99_nagios.conf 350 RMD160 d9818e29cd119b2cc185c75dcd374b3851eaa739 SHA1 fa4b438c1d06f2d00cd2bff4fefc448a59d1cdec SHA256 2e8448d5e38969f0eee4306611e9592e9cec93506ad055cd27ef8e211cfe9f71 AUX conf.d 409 RMD160 8b08c01284fc590a2291164589da42515d1a0586 SHA1 dd7bf46facd6a3069794ad9623cddd854198520e SHA256 a5122b19248c375b7b7c80bb5568fcaf334de316c611a85795960c2b9f6a6d5a @@ -15,12 +12,6 @@ DIST nagios-2.10.tar.gz 1740558 RMD160 87086848911072a5504dd61f11ece8f0cf39db5e EBUILD nagios-core-1.4.1-r1.ebuild 7232 RMD160 959cc561d97e64ef1665471b6d9039e5df0203c4 SHA1 71717c81b199262723829aac615c646b6f4c101b SHA256 5a89679e169881c1b73015f982bc3c0d0d3fec9edfeae1c53671f1f90b140741 EBUILD nagios-core-1.4.1.ebuild 7227 RMD160 6a92a4e40edca8390e6b725e563aafd1c7672579 SHA1 2ec3c4775cf6bbde6022c8d3f7fc4b8a08717dae SHA256 faac722b77572c538cd222894779cc2c9c3957d7c89bce51eeaa14840d6e9a0a EBUILD nagios-core-2.10-r1.ebuild 6365 RMD160 415694b502271d58d1dadbfbcfa3b652f0246fdb SHA1 1ea0142b08e0ad0b75ca746619f01bbf24585ad3 SHA256 3a832bc85c44541ae11151bed3ac5f06e290c43fe9a6afea5120b45402e111c6 -MISC ChangeLog 19697 RMD160 82e5ce44873af7edef8d41d86fca44aae8355afe SHA1 0fd10f5f08764bcf2b313a481e866869f92bb418 SHA256 cc56584b290c730edbde6cf742d17127295af9d2a9181c42ff0e070ef006ed96 +EBUILD nagios-core-2.10-r2.ebuild 6768 RMD160 398820497ae8656d529fcc9d69d371efaca28e2b SHA1 1da3d477ab68202e034151f54d3459eb0494ec84 SHA256 35e74208362b94dbed01f1b4f2b316f380b3cc4cf6bb357bb1140884d6b45d1b +MISC ChangeLog 19885 RMD160 bb5a34eb4a69afb5f23d20c74ebdc141d8727bc0 SHA1 9feb6bc5f0379cceb90b405777c1590e22b0d7df SHA256 0c1b88b68bae953c22956ee40123d7f98c44a3c7a452d7f28dd9e5d088788b8a MISC metadata.xml 963 RMD160 34a65fa482244335865f889d4ff500d6eaff4652 SHA1 b63ecd87d1a48ec89bb8d1b571af2990e5c4a46d SHA256 1caad75fb2c860e761a2ef082cae698e6d34499b68af04c6bc214ca019bdab3d ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.8 (GNU/Linux) - -iEYEARECAAYFAkeiJ8cACgkQmPFBzbX68WFBJwCggoNFdUR04+M2lZu2596TkQsb -h8YAn1Ro6xTsmzv0e+0RhFsuXmMknEu5 -=ibNs ------END PGP SIGNATURE----- diff --git a/net-analyzer/nagios-core/nagios-core-2.10-r2.ebuild b/net-analyzer/nagios-core/nagios-core-2.10-r2.ebuild new file mode 100644 index 000000000000..16318de568e2 --- /dev/null +++ b/net-analyzer/nagios-core/nagios-core-2.10-r2.ebuild @@ -0,0 +1,244 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $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 $ + +EAPI="1" + +inherit eutils depend.apache toolchain-funcs + +MY_P=${PN/-core}-${PV/_} +DESCRIPTION="Nagios Core - Check daemon, CGIs, docs" +HOMEPAGE="http://www.nagios.org/" +SRC_URI="mirror://sourceforge/nagios/${MY_P}.tar.gz + mirror://gentoo/nagios-2.0b.cfg-sample.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="debug perl +web vim-syntax" +DEPEND="virtual/mailx + web? ( + >=media-libs/jpeg-6b-r3 + >=media-libs/libpng-1.2.5-r4 + >=media-libs/gd-1.8.3-r5 + perl? ( net-analyzer/traceroute ) + ) + perl? ( >=dev-lang/perl-5.6.1-r7 )" +RDEPEND="${DEPEND} + vim-syntax? ( app-vim/nagios-syntax )" + +want_apache2 + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + # Check if gd has been compiled with jpeg and png support + if use web; then + if ! built_with_use media-libs/gd jpeg png; then + eerror "Your gd has been compiled without jpeg and/or png support." + eerror "Please re-emerge gd:" + eerror "# USE="jpeg png" emerge gd" + die "pkg_setup failed" + fi + fi + + enewgroup nagios + enewuser nagios -1 /bin/bash /var/nagios/home nagios +} + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}"/2.x-series-nsca.patch + + local strip="$(echo '$(MAKE) strip-post-install')" + sed -i -e "s:${strip}::" {cgi,base}/Makefile.in || die "sed failed in Makefile.in" +} + +src_compile() { + local myconf + + if use perl + then + myconf="${myconf} --enable-embedded-perl --with-perlcache" + fi + + if use debug; then + myconf="${myconf} --enable-DEBUG0" + myconf="${myconf} --enable-DEBUG1" + myconf="${myconf} --enable-DEBUG2" + myconf="${myconf} --enable-DEBUG3" + myconf="${myconf} --enable-DEBUG4" + myconf="${myconf} --enable-DEBUG5" + fi + + if use apache2 ; then + myconf="${myconf} --with-command-grp=apache" + else + myconf="${myconf} --with-command-grp=nagios" + fi + + econf ${myconf} \ + --prefix=/usr/nagios \ + --localstatedir=/var/nagios \ + --sysconfdir=/etc/nagios \ + --datadir=/usr/nagios/share \ + || die "./configure failed" + + emake CC=$(tc-getCC) nagios || die "make failed" + + if use web ; then + # Only compile the CGI's if "web" useflag is set. + make CC=$(tc-getCC) DESTDIR="${D}" cgis || die + fi + + emake -C contrib all || "contrib make filed" + +} + +src_install() { + dodoc Changelog INSTALLING LEGAL README UPGRADING + docinto contrib + dodoc contrib/README + + if ! use web; then + sed -i -e 's/cd $(SRC_CGI) && $(MAKE) $@/# line removed due missing web use flag/' \ + -e 's/cd $(SRC_HTM) && $(MAKE) $@/# line removed due missing web use flag/' \ + Makefile + fi + + sed -i -e 's/^contactgroups$//g' Makefile + + make DESTDIR="${D}" install + make DESTDIR="${D}" install-config + make DESTDIR="${D}" install-commandmode + + docinto sample-configs + dodoc "${D}"/etc/nagios/* + rm "${D}"/etc/nagios/* + + newdoc "${WORKDIR}"/nagios-2.0b.cfg-sample nagios.cfg-sample + + #contribs are not configured by the configure script, we'll configure them overselves... + find "${S}"/contrib/ -type f | xargs sed -e 's:/usr/local/nagios/var/rw:/var/nagios/rw:; + s:/usr/local/nagios/libexec:/usr/nagios/libexec:; + s:/usr/local/nagios/etc:/etc/nagios:; + s:/usr/local/nagios/sbin:/usr/nagios/sbin:;' -i + + insinto /usr/share/doc/${PF}/contrib + doins -r contrib/eventhandlers + + doinitd "${FILESDIR}"/nagios + newconfd "${FILESDIR}"/conf.d nagios + + chmod 644 "${S}"/contrib/*.cgi + into /usr/nagios + for bin in `find contrib/ -type f -perm 0755 -maxdepth 1` ; do + dobin "$bin" + done + + # Apache Module + if use web ; then + if use apache2 ; then + insinto "${APACHE_MODULES_CONFDIR}" + doins "${FILESDIR}"/99_nagios.conf + else + ewarn "${CATEGORY}/${PF} only supports apache-2.x webserver" + ewarn "out-of-the-box. Since you are not using apache, you" + ewarn "have to configure your webserver accordingly yourself." + fi + + if use perl; then + into /usr/nagios ; dosbin contrib/traceroute.cgi + fi + fi + + for dir in etc/nagios var/nagios ; do + chown -R nagios:nagios "${D}/${dir}" || die "Failed chown of ${D}/${dir}" + done + + chown -R root:root "${D}"/usr/nagios + find "${D}"/usr/nagios -type d -print0 | xargs -0 chmod 755 + find "${D}"/usr/nagios/*bin -type f -print0 | xargs -0 chmod 755 + find "${D}"/usr/nagios/share -type f -print0 | xargs -0 chmod 644 + + keepdir /etc/nagios + keepdir /var/nagios + keepdir /var/nagios/archives + keepdir /usr/nagios/share/ssi + keepdir /var/nagios/rw + + if use apache2 ; then + chown -R nagios:apache "${D}"/var/nagios/rw || die "Failed Chown of ${D}/var/nagios/rw" + else + chown -R nagios:nagios "${D}"/var/nagios/rw || die "Failed Chown of ${D}/var/nagios/rw" + fi + + chmod ug+s "${D}"/var/nagios/rw || die "Failed Chmod of ${D}/var/nagios/rw" + chmod 0750 "${D}"/etc/nagios || die "Failed chmod of ${D}/etc/nagios" + + cat << EOF > "${T}"/55-nagios-core-revdep +SEARCH_DIRS="/usr/nagios/bin /usr/nagios/libexec" +EOF + + insinto /etc/revdep-rebuild + doins "${T}"/55-nagios-core-revdep +} + +pkg_postinst() { + elog + elog "The example config files are located at /usr/share/doc/${PF}/sample-configs/." + elog + elog "Also, if you want nagios to start at boot time" + elog "remember to execute:" + elog " rc-update add nagios default" + elog + + if use web; then + elog "This does not include cgis that are perl-dependent" + elog "Currently traceroute.cgi is perl-dependent" + elog "To have ministatus.cgi requires copying of ministatus.c" + elog "to cgi directory for compiling." + + elog "Note that the user your webserver is running at needs" + elog "read-access to /etc/nagios." + elog + + if use apache2 ; then + elog "There are several possible solutions to accomplish this," + elog "choose the one you are most comfortable with:" + elog " usermod -G nagios apache" + elog "or" + elog " chown nagios:apache /etc/nagios" + elog + elog "Also edit /etc/conf.d/apache2 and add \"-D NAGIOS\"" + elog + elog "That will make nagios's web front end visable via" + elog "http://localhost/nagios/" + elog + else + elog "IMPORTANT: Do not forget to add the user your webserver" + elog "is running as to the nagios group!" + fi + + else + elog "Please note that you have installed Nagios without web interface." + elog "Please don't file any bugs about having no web interface when you do this." + elog "Thank you!" + fi + + elog + elog "If your kernel has /proc protection, nagios" + elog "will not be happy as it relies on accessing the proc" + elog "filesystem. You can fix this by adding nagios into" + elog "the group wheel, but this is not recomended." + elog + + elog + ewarn "Use /usr/nagios/bin/convertcfg for configuration file conversion" +} + +pkg_prerm() { + [[ "${ROOT}" == "/" ]] && /etc/init.d/nagios stop +} |