You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

201 lines
8.0 KiB

##
## nagios.spec -- OpenPKG RPM Specification
## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.com/>
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package information
Name: nagios
Summary: System and Network Monitoring
URL: http://www.nagios.org/
Vendor: Ethan Galstad
Packager: The OpenPKG Project
Distribution: OpenPKG [EVAL]
Group: Network
License: GNU
Version: 1.1
Release: 20030713
# package options
%option with_fsl yes
# list of sources
Source0: http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-%{version}.tar.gz
Source1: rc.nagios
Source2: fsl.nagios
Patch0: nagios.patch
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20030710, traceroute, gcc
PreReq: OpenPKG, openpkg >= 20030710, traceroute, apache
BuildPreReq: gd, jpeg, png, zlib
PreReq: gd, jpeg, png, zlib
%if "%{with_fsl}" == "yes"
BuildPreReq: fsl
PreReq: fsl
%endif
AutoReq: no
AutoReqProv: no
%description
Nagios is a system and network monitoring application. It watches
hosts and services that you specify, alerting you when things go bad
and when they get better.
%prep
%setup -q
%patch -p0
%build
%{l_shtool} subst \
-e 's;localstatedir=.\${prefix}/var.;localstatedir="'%{l_prefix}'/var/nagios";g' \
-e 's;datadir=.\${prefix}/share.;datadir="'%{l_prefix}'/share/nagios";g' \
-e 's;sysconfdir=.\${prefix}/etc.;sysconfdir="'%{l_prefix}'/etc/nagios";g' \
-e 's;libexecdir=.\${prefix}/libexec.;libexecdir="'%{l_prefix}'/libexec/nagios";g' \
configure
%{l_shtool} subst \
-e 's;log_file=.*;log_file=/dev/null;' \
sample-config/nagios.cfg.in
echo "ac_cv_path_PATH_TO_TRACEROUTE=%{l_prefix}/sbin/traceroute}" >config.cache
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
PERLLIBS="%{l_fsl_libs}" \
./configure \
--prefix=%{l_prefix} \
--with-cgiurl=%{l_prefix}/cgi/nagios \
--with-htmurl=%{l_prefix}/share/nagios \
--with-nagios-user=%{l_musr} \
--with-nagios-grp=%{l_mgrp} \
--with-gd-lib=%{l_prefix}/lib \
--with-gd-inc=%{l_prefix}/include \
--with-lockfile=%{l_prefix}/var/nagios/nagios.lock
%{l_make} all %{l_mflags} \
GDLIBS="-lgd -lm -lpng -lz -ljpeg" \
LOGDIR=%{l_prefix}/var/nagios \
CFGDIR=%{l_prefix}/etc/nagios \
BINDIR=%{l__prefix}/bin \
CGIDIR=%{l_prefix}/cgi/nagios \
HTMLDIR=%{l_prefix}/share/nagios
%install
rm -rf $RPM_BUILD_ROOT
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/etc/nagios \
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
$RPM_BUILD_ROOT%{l_prefix}/sbin \
$RPM_BUILD_ROOT%{l_prefix}/var/nagios/rw \
$RPM_BUILD_ROOT%{l_prefix}/libexec/nagios \
$RPM_BUILD_ROOT%{l_prefix}/cgi/nagios \
$RPM_BUILD_ROOT%{l_prefix}/share/nagios/media \
$RPM_BUILD_ROOT%{l_prefix}/share/nagios/stylesheets \
$RPM_BUILD_ROOT%{l_prefix}/share/nagios/contexthelp \
$RPM_BUILD_ROOT%{l_prefix}/share/nagios/docs/images \
$RPM_BUILD_ROOT%{l_prefix}/share/nagios/images/logos \
$RPM_BUILD_ROOT%{l_prefix}/share/nagios/ssi
# install nagios
%{l_shtool} install -c -s -m 755 \
base/nagios $RPM_BUILD_ROOT%{l_prefix}/sbin/
# install html
%{l_shtool} install -c -m 644 \
html/robots.txt $RPM_BUILD_ROOT%{l_prefix}/share/nagios/
%{l_shtool} install -c -m 644 \
html/docs/robots.txt $RPM_BUILD_ROOT%{l_prefix}/share/nagios/docs/
%{l_shtool} install -c -m 644 \
html/media/*.wav $RPM_BUILD_ROOT%{l_prefix}/share/nagios/media/
%{l_shtool} install -c -m 644 \
html/stylesheets/*.css $RPM_BUILD_ROOT%{l_prefix}/share/nagios/stylesheets/
%{l_shtool} install -c -m 644 \
html/contexthelp/*.html $RPM_BUILD_ROOT%{l_prefix}/share/nagios/contexthelp/
%{l_shtool} install -c -m 644 \
html/docs/*.html $RPM_BUILD_ROOT%{l_prefix}/share/nagios/docs/
%{l_shtool} install -c -m 644 \
html/docs/images/*.* $RPM_BUILD_ROOT%{l_prefix}/share/nagios/docs/images/
%{l_shtool} install -c -m 644 \
html/images/*.gif html/images/*.jpg html/images/*.png \
$RPM_BUILD_ROOT%{l_prefix}/share/nagios/images/
%{l_shtool} install -c -m 644 \
html/images/logos/*.* $RPM_BUILD_ROOT%{l_prefix}/share/nagios/images/logos/
# install cgis
%{l_shtool} install -c -s -m 755 \
cgi/*.cgi $RPM_BUILD_ROOT%{l_prefix}/cgi/nagios/
# install sample config
%{l_shtool} install -c -m 644 \
sample-config/nagios.cfg $RPM_BUILD_ROOT%{l_prefix}/etc/nagios/
%{l_shtool} install -c -m 644 \
sample-config/cgi.cfg $RPM_BUILD_ROOT%{l_prefix}/etc/nagios/
%{l_shtool} install -c -m 644 \
sample-config/resource.cfg $RPM_BUILD_ROOT%{l_prefix}/etc/nagios/
%{l_shtool} install -c -m 644 \
sample-config/template-object/checkcommands.cfg $RPM_BUILD_ROOT%{l_prefix}/etc/nagios/
%{l_shtool} install -c -m 644 \
sample-config/template-object/contactgroups.cfg $RPM_BUILD_ROOT%{l_prefix}/etc/nagios/
%{l_shtool} install -c -m 644 \
sample-config/template-object/contacts.cfg $RPM_BUILD_ROOT%{l_prefix}/etc/nagios/
%{l_shtool} install -c -m 644 \
/dev/null $RPM_BUILD_ROOT%{l_prefix}/etc/nagios/dependencies.cfg
%{l_shtool} install -c -m 644 \
sample-config/template-object/escalations.cfg $RPM_BUILD_ROOT%{l_prefix}/etc/nagios/
%{l_shtool} install -c -m 644 \
sample-config/template-object/hostgroups.cfg $RPM_BUILD_ROOT%{l_prefix}/etc/nagios/
%{l_shtool} install -c -m 644 \
sample-config/template-object/hosts.cfg $RPM_BUILD_ROOT%{l_prefix}/etc/nagios/
%{l_shtool} install -c -m 644 \
sample-config/template-object/misccommands.cfg $RPM_BUILD_ROOT%{l_prefix}/etc/nagios/
%{l_shtool} install -c -m 644 \
sample-config/template-object/services.cfg $RPM_BUILD_ROOT%{l_prefix}/etc/nagios/
%{l_shtool} install -c -m 644 \
sample-config/template-object/timeperiods.cfg $RPM_BUILD_ROOT%{l_prefix}/etc/nagios/
# install start script
%{l_shtool} install -c -m 755 \
-e 's;@l_prefix@;%{l_prefix};g' \
-e 's;@l_susr@;%{l_susr};g' \
-e 's;@l_rusr@;%{l_rusr};g' \
-e 's;@l_rgrp@;%{l_rgrp};g' \
%{SOURCE rc.nagios} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
# install OSSP fsl configuration
%{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
%{l_shtool} install -c -m 644 \
-e 's;@l_prefix@;%{l_prefix};g' \
%{SOURCE fsl.nagios} \
$RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} \
'%not %dir %{l_prefix}/etc/fsl' \
'%config %{l_prefix}/etc/fsl/fsl.nagios'
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT