]> git.pld-linux.org Git - packages/nagios.git/blobdiff - nagios.spec
- release 4
[packages/nagios.git] / nagios.spec
index 9a857ce8666923e492c7e8f8aa2148671482d381..c0bb805b7b8a1fb7ff2056f034bb07709c88a0d5 100644 (file)
@@ -3,6 +3,7 @@
 #
 # Conditional build:
 %bcond_without gd      # without statusmap and trends, which require gd library
+%bcond_without epn     # without Embedded Perl
 # reeenable when http://tracker.nagios.org/view.php?id=51 is fixed
 %bcond_with    tests
 
@@ -11,7 +12,7 @@ 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:       3.3.1
-Release:       1
+Release:       4
 License:       GPL v2+
 Group:         Networking
 Source0:       http://downloads.sourceforge.net/nagios/%{name}-%{version}.tar.gz
@@ -40,13 +41,17 @@ Patch9:             %{name}-html-Makefile.in.patch
 URL:           http://www.nagios.org/
 BuildRequires: autoconf
 BuildRequires: automake
+BuildRequires: rpmbuild(macros) >= 1.268
+BuildRequires: sed >= 4.0
 %if %{with gd}
 BuildRequires: gd-devel
 BuildRequires: libjpeg-devel
 BuildRequires: libpng-devel
 %endif
-BuildRequires: rpmbuild(macros) >= 1.268
-BuildRequires: sed >= 4.0
+%if %{with tests}
+BuildRequires: perl-HTML-Lint
+BuildRequires: perl-Test-WWW-Mechanize-CGI
+%endif
 Requires(post,preun):  /sbin/chkconfig
 Requires:      %{name}-common = %{version}-%{release}
 Requires:      rc-scripts
@@ -168,21 +173,29 @@ Group:            Documentation
 %description doc
 HTML Documentation for Nagios.
 
-%package theme-default
-Summary:       Default Nagios theme
-Summary(pl.UTF-8):     Domyślny motyw Nagiosa
+%package theme-classicui
+Summary:       ClassicUI Nagios theme
 Group:         Applications/WWW
 Requires:      %{name}-cgi = %{version}-%{release}
 Requires:      webserver(php)
 Provides:      nagios-theme
 Obsoletes:     nagios-theme
 
-%description theme-default
+%description theme-classicui
 Original theme from Nagios.
 
-%description theme-default -l pl.UTF-8
+%description theme-classicui -l pl.UTF-8
 Oryginalny motyw z Nagiosa.
 
+%package theme-default
+Summary:       Virtual package to handle Nagios theme migration
+Group:         Applications/WWW
+Requires:      nagios-theme
+Obsoletes:     nagios-theme-default < 3.3.1-1.4
+
+%description theme-default
+Virtual package to handle Nagios theme migration
+
 %package devel
 Summary:       Include files that Nagios-related applications may compile against
 Summary(pl.UTF-8):     Pliki nagłówkowe, wykorzystywane przez aplikacje nagiosa
@@ -203,15 +216,17 @@ Este pacote contém arquivos de cabeçalho usados no desenvolvimento de
 aplicativos para o Nagios.
 
 %prep
-%setup -q -a4 -n %{name}
+%setup -qc -a4
+mv %{name}/* .
 %undos cgi/*.c
 %undos include/*.h
 %undos base/*
+%undos p1.pl
 %patch0 -p0
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
-#fixed 
+#fixed
 #%patch4 -p1
 %patch5 -p1
 %patch6 -p1
@@ -232,6 +247,10 @@ sed -i -e '
        s,".*/libexec/eventhandlers,"%{_libdir}/%{name}/eventhandlers,
 ' $(find contrib/eventhandlers -type f)
 
+%{__sed} -i -e '
+       s,/usr/local/nagios/var/,/var/log/%{name}/,g
+' p1.pl
+
 sed -e 's,%{_prefix}/lib/,%{_libdir}/,' %{SOURCE1} > apache.conf
 sed -e 's,%{_prefix}/lib/,%{_libdir}/,' %{SOURCE5} > lighttpd.conf
 
@@ -250,10 +269,19 @@ sed -e 's,%{_prefix}/lib/,%{_libdir}/,' %{SOURCE5} > lighttpd.conf
 #      s,/usr/local/%{name}/var/archives/,/var/log/%{name}/archives/,
 #' html/docs/configmain.html
 
+#rm t/611cgistatus-hosturgencies.t
+
 %build
 cp -f /usr/share/automake/config.sub .
 %{__aclocal}
 %{__autoconf}
+%if %{with tests}
+cd tap
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+cd ..
+%endif
 %configure \
        CFLAGS="%{rpmcflags} %{rpmcppflags}" \
        --bindir=%{_sbindir} \
@@ -267,11 +295,16 @@ cp -f /usr/share/automake/config.sub .
        --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_tests:%{__make} test}
 
 %install
@@ -293,22 +326,28 @@ cp -p include/*.h $RPM_BUILD_ROOT%{_includedir}/%{name}
        INIT_OPTS="" \
        COMMAND_OPTS=""
 
+%if %{with epn}
+mv $RPM_BUILD_ROOT{%{_sbindir},%{_libdir}/%{name}}/p1.pl
+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 -a %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
+cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
 
 # install templated configuration files
 for a in %{name}.cfg resource.cfg commands.cfg contactgroups.cfg contacts.cfg templates.cfg timeperiods.cfg; do
-       cp -a sample-config/$a $RPM_BUILD_ROOT%{_sysconfdir}
+       cp -p sample-config/$a $RPM_BUILD_ROOT%{_sysconfdir}
 done
 
 # webserver files
-cp -a apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
-cp -a apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
-cp -a lighttpd.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/lighttpd.conf
-cp -a sample-config/cgi.cfg $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
-cp -a %{SOURCE6} $RPM_BUILD_ROOT%{htmldir}/images
-cp -a %{SOURCE7} $RPM_BUILD_ROOT%{htmldir}/images
-cp -a %{SOURCE8} $RPM_BUILD_ROOT%{htmldir}/images
+cp -p apache.conf $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.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
+cp -p %{SOURCE7} $RPM_BUILD_ROOT%{htmldir}/images
+cp -p %{SOURCE8} $RPM_BUILD_ROOT%{htmldir}/images
 > $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/passwd
 echo 'nagios:' > $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/group
 
@@ -450,10 +489,16 @@ done
 %attr(664,root,nagios) %ghost %{_localstatedir}/%{name}.tmp
 %attr(664,root,nagios) %ghost %{_localstatedir}/%{name}.pid
 
-%attr(770,root,nagios) %dir %{_var}/spool/%{name}/checkresults
+%attr(770,root,nagcmd) %dir %{_var}/spool/%{name}/checkresults
 
 %{_examplesdir}/%{name}-%{version}
 
+# epn
+%if %{with epn}
+%attr(755,root,root) %{_libdir}/%{name}/p1.pl
+%attr(755,root,root) %{_bindir}/mini_epn
+%endif
+
 %files common
 %defattr(644,root,root,755)
 %attr(750,root,nagcmd) %dir %{_sysconfdir}
@@ -468,7 +513,7 @@ done
 %dir %{_prefix}/lib/%{name}/eventhandlers
 %endif
 
-%attr(770,root,nagios) %dir %{_var}/spool/%{name}
+%attr(770,root,nagcmd) %dir %{_var}/spool/%{name}
 
 %files mrtggraphs
 %defattr(644,root,root,755)
@@ -502,7 +547,7 @@ done
 %{htmldir}/images/marker.png
 %{htmldir}/images/shadow50.png
 
-%files theme-default
+%files theme-classicui
 %defattr(644,root,root,755)
 %{htmldir}/*.php
 %{htmldir}/includes/*
@@ -512,6 +557,9 @@ done
 %exclude %{htmldir}/images/shadow50.png
 %{htmldir}/stylesheets/*
 
+%files theme-default
+%defattr(644,root,root,755)
+
 %files devel
 %defattr(644,root,root,755)
 %dir %{_includedir}/%{name}
This page took 0.042221 seconds and 4 git commands to generate.