]> git.pld-linux.org Git - packages/nagios.git/blobdiff - nagios.spec
package /etc/nagios/nrpe.d to nagios-common
[packages/nagios.git] / nagios.spec
index f00d8b07555e9e25798ab24b0e9746dc0b0fff49..02314bf698552122e73cca6cd69a0cfd7eea1fe4 100644 (file)
@@ -1,27 +1,29 @@
 # TODO
 # - /var/log/nagios/archives -> /var/log/archive/nagios
+# - bundled jquery in themes
 #
 # Conditional build:
 %bcond_without gd      # without statusmap and trends, which require gd library
-%bcond_with    epn     # with Embedded Perl
+%bcond_without doc     # don't build html docs
 # reeenable when http://tracker.nagios.org/view.php?id=51 is fixed
 %bcond_with    tests
 
-Summary:       Host/service/network monitoring program
+Summary:       Open Source host, service and network monitoring program
 Summary(pl.UTF-8):     Program do monitorowania serwerów/usług/sieci
 Summary(pt_BR.UTF-8):  Programa para monitoração de máquinas e serviços
 Name:          nagios
-Version:       4.0.0
-Release:       1
+Version:       4.3.3
+Release:       2
 License:       GPL v2+
 Group:         Networking
-Source0:       http://downloads.sourceforge.net/nagios/nagios-4.x/%{name}-%{version}/%{name}-%{version}.tar.gz
-# Source0-md5: bfe64774766e32b6f6130493c52ed7f6
+Source0:       https://assets.nagios.com/downloads/nagioscore/releases/%{name}-%{version}.tar.gz
+# Source0-md5: b733310c87b8eb6ce0f7a5768829c94c
 Source1:       %{name}-apache.conf
 Source2:       %{name}.init
 Source3:       %{name}.sysconfig
-Source4:       %{name}-config-20090914.tar.bz2
-# Source4-md5: 605f1cd28c00db961dad6f529d849f16
+# http://git.pld-linux.org/projects/nagios-config/
+Source4:       %{name}-config-20150805.tar.xz
+# Source4-md5: 16683172c72cc2c09662261c82abef40
 Source5:       %{name}-lighttpd.conf
 Source6:       http://www.google.com/mapfiles/shadow50.png
 # Source6-md5: eff99f302f21b95a900d321743fce72b
@@ -29,24 +31,26 @@ Source7:    http://www.google.com/mapfiles/marker.png
 # Source7-md5: edefef4bdfc29e1c953694651f05b466
 Source8:       googlemap.js
 Source9:       %{name}wall.php
-Source10:      %{name}-httpd.conf
 Patch0:                %{name}-resources.patch
 Patch1:                %{name}-iconv-in-libc.patch
 Patch2:                %{name}-webapps.patch
-Patch3:                %{name}-cgi-http_charset.patch
+
 Patch4:                %{name}-cmd-typo.patch
 Patch5:                config.patch
 Patch6:                %{name}-googlemap.patch
 Patch7:                %{name}-doc-usermacros.patch
 Patch8:                archivelog-timeformat.patch
-Patch9:                system-magpierss.patch
+
 Patch10:       system-jquery.patch
 Patch11:       do-not-fetch-rss.patch
-URL:           http://www.nagios.org/
+URL:           https://www.nagios.org/projects/nagios-core/
 BuildRequires: autoconf
 BuildRequires: automake
+%{?with_doc:BuildRequires:     doxygen}
 BuildRequires: rpmbuild(macros) >= 1.268
 BuildRequires: sed >= 4.0
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
 %if %{with gd}
 BuildRequires: gd-devel
 BuildRequires: libjpeg-devel
@@ -73,6 +77,7 @@ BuildRoot:    %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define                cgidir          %{_libdir}/%{name}/cgi
 %define                htmldir         %{_prefix}/share/%{name}
 %define                _localstatedir  /var/lib/%{name}
+%define                nagioshome      %{_localstatedir}
 %define                _webapps        /etc/webapps
 %define                _webapp         %{name}
 
@@ -152,8 +157,6 @@ Requires:   webserver(auth)
 Requires:      webserver(cgi)
 Requires:      webserver(indexfile)
 Suggests:      %{name}-doc
-Suggests:      php-magpierss >= 0.72
-Conflicts:     apache-base < 2.4.0-1
 
 %description cgi
 CGI webinterface for Nagios.
@@ -166,6 +169,9 @@ Summary:    MRTG Graphs: Nagios Statistics
 Group:         Applications/Networking
 Requires:      %{name} = %{version}-%{release}
 Provides:      mrtg-start
+%if "%{_rpmversion}" >= "5"
+BuildArch:     noarch
+%endif
 
 %description mrtggraphs
 This pacakge graphs several Nagios statistics which can be useful for
@@ -175,6 +181,9 @@ generate the data.
 %package doc
 Summary:       HTML Documentation for Nagios
 Group:         Documentation
+%if "%{_rpmversion}" >= "5"
+BuildArch:     noarch
+%endif
 # does not require base
 
 %description doc
@@ -187,6 +196,9 @@ Requires:   %{name}-cgi = %{version}-%{release}
 Requires:      webserver(php)
 Provides:      nagios-theme
 Obsoletes:     nagios-theme
+%if "%{_rpmversion}" >= "5"
+BuildArch:     noarch
+%endif
 
 %description theme-classicui
 Original theme from Nagios.
@@ -202,6 +214,9 @@ Suggests:   nagios-theme-classicui
 Suggests:      nagios-theme-exfoliation
 Suggests:      nagios-theme-nuvola
 Obsoletes:     nagios-theme-default < 3.3.1-1.4
+%if "%{_rpmversion}" >= "5"
+BuildArch:     noarch
+%endif
 
 %description theme-default
 Virtual package to handle Nagios theme migration
@@ -229,21 +244,21 @@ aplicativos para o Nagios.
 
 %prep
 %setup -qc -a4
-mv %{name}/* .
+mv %{name}-%{version}/* .
 %undos cgi/*.c
 %undos include/*.h
 %undos base/*
 %patch0 -p0
 %patch1 -p1
 %patch2 -p1
-%patch3 -p1
+
 #fixed
 #%patch4 -p1
 %patch5 -p1
 %patch6 -p1
 %patch7 -p1
 %patch8 -p1
-%patch9 -p1
+
 %patch10 -p1
 %patch11 -p1
 
@@ -261,7 +276,6 @@ sed -i -e '
 ' $(find contrib/eventhandlers -type f)
 
 sed -e 's,%{_prefix}/lib/,%{_libdir}/,' %{SOURCE1} > apache.conf
-sed -e 's,%{_prefix}/lib/,%{_libdir}/,' %{SOURCE10} > httpd.conf
 sed -e 's,%{_prefix}/lib/,%{_libdir}/,' %{SOURCE5} > lighttpd.conf
 
 # fixup cgi config
@@ -274,11 +288,6 @@ sed -e 's,%{_prefix}/lib/,%{_libdir}/,' %{SOURCE5} > lighttpd.conf
        s,=nagiosadmin,=*,g
 ' sample-config/*.cfg.in
 
-# fixup paths in doc
-#%{__sed} -i -e '
-#      s,/usr/local/%{name}/var/archives/,/var/log/%{name}/archives/,
-#' html/docs/configmain.html
-
 #rm t/611cgistatus-hosturgencies.t
 
 %build
@@ -305,15 +314,12 @@ cd ..
        --with-checkresult-dir=%{_var}/spool/%{name}/checkresults \
        --with-ping_command='/bin/ping -n %%s -c %%d' \
        %{!?with_gd:--disable-statusmap --disable-trends} \
-       %{?with_epn:--enable-embedded-perl --with-perlcache} \
        %{?with_tests:--enable-libtap} \
        --enable-event-broker
 
 %{__make} all
 
-%if %{with epn}
-%{__make} -C contrib mini_epn
-%endif
+%{?with_doc:%{__make} dox}
 
 %{?with_tests:%{__make} test}
 
@@ -321,7 +327,7 @@ cd ..
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_webapps}/%{_webapp}} \
        $RPM_BUILD_ROOT{%{_var}/log/%{name}/archives,%{_localstatedir}/rw} \
-       $RPM_BUILD_ROOT%{_sysconfdir}/{plugins,objects} \
+       $RPM_BUILD_ROOT%{_sysconfdir}/{plugins,objects,nrpe.d} \
        $RPM_BUILD_ROOT%{_libdir}/%{name}/{eventhandlers,plugins,brokers} \
 %if "%{_lib}" != "lib"
        $RPM_BUILD_ROOT%{_prefix}/lib/%{name}/{eventhandlers,plugins} \
@@ -333,11 +339,6 @@ install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_webapps}/%{_webapp}}
        INIT_OPTS="" \
        COMMAND_OPTS=""
 
-%if %{with epn}
-install -d $RPM_BUILD_ROOT%{_bindir}
-install -p contrib/mini_epn $RPM_BUILD_ROOT%{_bindir}
-%endif
-
 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
 
@@ -348,7 +349,7 @@ done
 
 # webserver files
 cp -p apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
-cp -p httpd.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
+cp -p apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
 cp -p lighttpd.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/lighttpd.conf
 cp -p sample-config/cgi.cfg $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{htmldir}/images
@@ -366,16 +367,17 @@ find $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} -name '*.in' | xargs rm
 
 # mrtg script
 install -d $RPM_BUILD_ROOT/etc/mrtg/conf.d
-cp -a sample-config/mrtg.cfg $RPM_BUILD_ROOT/etc/mrtg/conf.d/%{name}.cfg
+cp -p sample-config/mrtg.cfg $RPM_BUILD_ROOT/etc/mrtg/conf.d/%{name}.cfg
 
 # Object data/cache files
 for i in {objects.{cache,precache},{retention,status}.dat,%{name}.{tmp,pid}}; do
        > $RPM_BUILD_ROOT%{_localstatedir}/$i
 done
 > $RPM_BUILD_ROOT%{_localstatedir}/rw/%{name}.cmd
+> $RPM_BUILD_ROOT%{_localstatedir}/rw/%{name}.qh
 
 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}
-mv $RPM_BUILD_ROOT{%{htmldir}/docs/*,%{_docdir}/%{name}}
+%{?with_doc:%{__cp} -a Documentation/html/* $RPM_BUILD_ROOT%{_docdir}/%{name}}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -408,9 +410,14 @@ fi
 %groupadd -g 72 nagios
 %groupadd -g 147 -f nagcmd
 if [ -n "$(id -u netsaint 2>/dev/null)" ] && [ "$(id -u netsaint)" = "72" ]; then
-       /usr/sbin/usermod -d %{_libdir}/%{name} -l nagios -c "Nagios Daemon" -G nagcmd netsaint
+       /usr/sbin/usermod -d %{nagioshome} -l nagios -c "Nagios Daemon" -G nagcmd netsaint
+fi
+%useradd -u 72 -d %{nagioshome} -s /bin/false -c "Nagios Daemon" -g nagios -G nagcmd nagios
+# update nagios user home
+home=$(IFS=:; set -- $(getent passwd nagios); echo $6)
+if [ "$home" != %{nagioshome} ]; then
+       /usr/sbin/usermod -d %{nagioshome} nagios
 fi
-%useradd -u 72 -d %{_libdir}/%{name} -s /bin/false -c "Nagios Daemon" -g nagios -G nagcmd nagios
 
 %postun common
 if [ "$1" = "0" ]; then
@@ -436,11 +443,11 @@ fi
 %triggerun cgi -- apache1 < 1.3.37-3, apache1-base
 %webapp_unregister apache %{_webapp}
 
-%triggerin cgi -- apache-base
+%triggerin cgi -- apache < 2.2.0, apache-base
 %addusertogroup http nagcmd
 %webapp_register httpd %{_webapp}
 
-%triggerun cgi -- apache-base
+%triggerun cgi -- apache < 2.2.0, apache-base
 %webapp_unregister httpd %{_webapp}
 
 %triggerin cgi -- lighttpd
@@ -462,6 +469,14 @@ for a in dependencies.cfg services.cfg serviceextinfo.cfg hosts.cfg hostgroups.c
 done
 %{__sed} -i -e 's,^check_result_path=.*,check_result_path=%{_var}/spool/%{name}/checkresults,' %{_sysconfdir}/%{name}.cfg
 
+
+%triggerpostun -- nagios-common < 4.0.8-2.2
+%banner -e %{name}-common <<EOF
+
+IMPORTANT: nagios user home changed to %{nagioshome}, you may need to move files from previous location %{_libdir}/%{name}.
+
+EOF
+
 %files
 %defattr(644,root,root,755)
 %doc Changelog README* UPGRADING INSTALLING LICENSE
@@ -490,6 +505,7 @@ done
 %attr(770,root,nagcmd) %dir %{_localstatedir}
 %attr(2770,root,nagcmd) %dir %{_localstatedir}/rw
 %attr(660,nagios,nagcmd) %ghost %{_localstatedir}/rw/%{name}.cmd
+%attr(660,nagios,nagcmd) %ghost %{_localstatedir}/rw/%{name}.qh
 %attr(664,root,nagios) %ghost %{_localstatedir}/objects.cache
 %attr(664,root,nagios) %ghost %{_localstatedir}/objects.precache
 %attr(664,root,nagios) %ghost %{_localstatedir}/*.dat
@@ -500,15 +516,11 @@ done
 
 %{_examplesdir}/%{name}-%{version}
 
-# epn
-%if %{with epn}
-%attr(755,root,root) %{_bindir}/mini_epn
-%endif
-
 %files common
 %defattr(644,root,root,755)
 %attr(750,root,nagcmd) %dir %{_sysconfdir}
 %attr(750,root,nagios) %dir %{_sysconfdir}/plugins
+%attr(750,root,nagios) %dir %{_sysconfdir}/nrpe.d
 %dir %{_libdir}/%{name}
 %dir %{_libdir}/%{name}/plugins
 %dir %{_libdir}/%{name}/eventhandlers
@@ -525,9 +537,11 @@ done
 %defattr(644,root,root,755)
 %config(noreplace) %verify(not md5 mtime size) /etc/mrtg/conf.d/%{name}.cfg
 
+%if %{with doc}
 %files doc
 %defattr(644,root,root,755)
 %{_docdir}/%{name}
+%endif
 
 %files cgi
 %defattr(644,root,root,755)
@@ -547,6 +561,7 @@ done
 %dir %{htmldir}/stylesheets
 %{htmldir}/robots.txt
 %{htmldir}/contexthelp
+%{htmldir}/jsonquery.html
 %{htmldir}/media
 %{htmldir}/ssi
 %{htmldir}/images/favicon.ico
@@ -554,6 +569,27 @@ done
 %{htmldir}/images/shadow50.png
 %{htmldir}/nagioswall.php
 
+%{htmldir}/angularjs
+%{htmldir}/bootstrap-3.3.0
+%{htmldir}/d3
+%{htmldir}/spin
+%{htmldir}/graph-header.html
+%{htmldir}/histogram-form.html
+%{htmldir}/histogram-graph.html
+%{htmldir}/histogram-links.html
+%{htmldir}/histogram.html
+%{htmldir}/infobox.html
+%{htmldir}/map-directive.html
+%{htmldir}/map-form.html
+%{htmldir}/map-links.html
+%{htmldir}/map-popup.html
+%{htmldir}/trends-form.html
+%{htmldir}/trends-graph.html
+%{htmldir}/trends-host-yaxis.html
+%{htmldir}/trends-links.html
+%{htmldir}/trends-service-yaxis.html
+%{htmldir}/trends.html
+
 %files theme-classicui
 %defattr(644,root,root,755)
 %exclude %{htmldir}/nagioswall.php
This page took 0.123413 seconds and 4 git commands to generate.