/[smecontribs]/rpms/smeserver-nagiosgrapher/contribs7/smeserver-nagiosgrapher.spec
ViewVC logotype

Annotation of /rpms/smeserver-nagiosgrapher/contribs7/smeserver-nagiosgrapher.spec

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Wed Feb 27 17:53:47 2008 UTC (16 years, 9 months ago) by slords
Branch: MAIN
Remove version from spec

1 slords 1.1 Summary: NagiosGrapher collects the output of NagiosPlugins and generates graphs.
2     %define name smeserver-nagiosgrapher
3     %define NagiosGrapher NagiosGrapher-1.6.1-rc5-0.3
4     Name: %{name}
5     %define version 1.0.1
6     %define release 0
7     Version: %{version}
8     Release: %{release}
9     License: GPL
10     Group: Applications/System
11     URL: http://www.nagiosexchange.org/NagiosGrapher.84.0.html
12     Source: %{name}-%{version}.tar.gz
13     Source1: %{NagiosGrapher}.tar.gz
14     Packager: Michael Weinberger <mweinber@neddix.de>
15     BuildRoot: /var/tmp/%{name}-buildroot/
16     BuildArch: noarch
17     Requires: nagios
18     Requires: smeserver-release >= 7.1.2
19     Requires: perl-Calendar-Simple
20     Requires: ImageMagick-perl
21     Requires: perl-GD
22     Requires: perl-rrdtool
23     AutoReq: no
24    
25     %changelog
26     * Mon Dec 03 2007 Michael Weinberger <mweinber@neddix.de>
27     Version 1.0.1
28     fixed icon_image_tag definition ngraph.ncfg
29     * Tue Nov 20 2007 Michael Weinberger <mweinber@neddix.de>
30     - Initial release
31    
32     %description
33     NagiosGrapher collects the output of NagiosPlugins and generates graphs.
34    
35     %prep
36     %setup -q -n %{name}-%{version}
37    
38     %build
39     tar xzf %{SOURCE1}
40     cd %{NagiosGrapher}
41     autoconf
42     cat >> config.layout <<EOF
43     <Layout sme_server>
44     prefix: /usr/lib/nagios
45     datadir: /usr/share
46     libdir: /usr/lib
47     nagios_config: /etc/nagios/nagios
48     nagios_config_cgi: /etc/nagios/cgi.cfg
49     nagios_images: \${datadir}/nagios/images
50     nagios_images_logos: \${datadir}/nagios/images/logos
51     nagios_folder_cgi: \${libdir}/nagios/cgi
52     perl_inc: /usr/lib/perl5/site_perl/
53     ng_config: /etc/nagios
54     ng_config_sub: \${ng_config}/ngraph.d
55     ng_daemon: /var/lib/nagios/nagios_grapher
56     ng_srvext_file: /etc/nagios/serviceextinfo.cfg
57     ng_srvext_dir: /etc/nagios/serviceext
58     ng_interface_pipe: /var/log/nagios/rw/
59     ng_logfile: /var/log/nagios/ngraph.log
60     ng_rrd: /var/lib/nagios/rrd
61     ng_rrd_font: /usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf
62     ng_cgi: /nagios/cgi-bin
63     ng_logos: /nagios/images/logos
64     ng_pid_file: \${ng_daemon}/nagios_grapher.pid
65     init_script_dir: /etc/init.d
66     logrotate_conf_dir: /etc/logrotate.d
67     </Layout>
68     EOF
69    
70     ./configure --with-layout=sme_server
71     #%{__make} testdeps
72    
73     %install
74     %{__rm} -rf $RPM_BUILD_ROOT
75     %{__mkdir} -p $RPM_BUILD_ROOT
76     (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
77    
78     cp %{NagiosGrapher}/sbin/rrd2-graph.cgi $RPM_BUILD_ROOT/usr/lib/nagios/cgi
79     cp %{NagiosGrapher}/sbin/rrd2-system.cgi $RPM_BUILD_ROOT/usr/lib/nagios/cgi
80     sed -e 's#NETWAYS GmbH"),#NETWAYS GmbH")," (SME Server ",$q->a({-href=>"http://wiki.contribs.org/NagiosGrapher/", -target=>"_blank"}, "contrib")," by Michael Weinberger)",#' < %{NagiosGrapher}/sbin/graphs.cgi > $RPM_BUILD_ROOT/usr/lib/nagios/cgi/graphs.cgi
81     cp %{NagiosGrapher}/bin/fifo_write.pl %{NagiosGrapher}/bin/collect2.pl $RPM_BUILD_ROOT/usr/share/nagios/
82     cp %{NagiosGrapher}/doc/* ${RPM_BUILD_ROOT}/usr/share/nagios/nagiosgrapher/doc/
83     cp %{NagiosGrapher}/graph.png $RPM_BUILD_ROOT/usr/share/nagios/images/logos/
84     cp %{NagiosGrapher}/dot.png $RPM_BUILD_ROOT/usr/share/nagios/images/logos/
85     cp %{NagiosGrapher}/lib/NagiosGrapher/HTML.pm $RPM_BUILD_ROOT/usr/lib/perl5/site_perl/NagiosGrapher/
86     cp %{NagiosGrapher}/lib/NagiosGrapher/Hooks/*.pm $RPM_BUILD_ROOT/usr/lib/perl5/site_perl/NagiosGrapher/Hooks/
87     cp %{NagiosGrapher}/lib/NagiosGrapher.pm $RPM_BUILD_ROOT/usr/lib/perl5/site_perl/
88     ln -fs /usr/lib/perl5/site_perl/NagiosGrapher.pm $RPM_BUILD_ROOT/usr/lib/nagios/cgi
89     cp -r %{NagiosGrapher}/cfg/templates/* $RPM_BUILD_ROOT/etc/nagios/ngraph.d/samples
90    
91    
92    
93     rm -f %{name}-%{version}-filelist
94     find $RPM_BUILD_ROOT -depth -type f -print |\
95     sed -e "s@^$RPM_BUILD_ROOT@@g" \
96     -e "s@^/etc/rc.d/@%attr(0755,root,root) &@"\
97     -e "s@^/usr/lib/perl5/site_perl/@%attr(0755,root,root) &@"\
98     -e "s@^/etc/nagios/ngraph.ncfg@%attr(0644,nagios,root) %config(noreplace)&@"\
99     -e "s@^/etc/nagios/nmgraph.ncfg@%attr(0644,nagios,root) %config(noreplace)&@"\
100     -e "s@^/etc/nagios/ngraph.d/@%attr(0755,nagios,root) &@"\
101     -e "s@^/usr/share/nagios/images/@%attr(0644,nagios,www) &@"\
102     -e "s@^/usr/share/nagios/@%attr(0755,root,root) &@"\
103     -e "s@^/usr/lib/nagios/cgi/@%attr(0755,nagios,root) &@"\
104     -e "s@^/etc/logrotate.d/nagiosgrapher@%attr(0644,root,root) &@"\
105     >> %{name}-%{version}-filelist
106    
107     find $RPM_BUILD_ROOT -depth -type l -print |\
108     sed "s@^$RPM_BUILD_ROOT@@g" >> %{name}-%{version}-filelist
109    
110     echo "%dir %attr(0755,nagios,root) /etc/nagios/serviceext/" >> %{name}-%{version}-filelist
111     echo "%dir %attr(0755,nagios,root) /var/lib/nagios/nagios_grapher/" >> %{name}-%{version}-filelist
112     echo "%dir %attr(0755,nagios,root) /var/lib/nagios/rrd/" >> %{name}-%{version}-filelist
113    
114     %clean
115     rm -rf $RPM_BUILD_ROOT
116    
117     %pre
118     NAGIOSUSER=`id -u nagios `
119     if [ -z "$NAGIOSUSER" ] ; then
120     echo "Error: User 'nagios' does not exist."
121     exit -1
122     fi
123    
124     %post
125     if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then
126     /sbin/e-smith/service nagiosgrapher restart
127     fi
128    
129     %preun
130     if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then
131     if [ $1 = 0 ] ; then # uninstall
132     /sbin/e-smith/service nagiosgrapher stop
133     fi
134     fi
135    
136     %postun
137    
138     %files -f %{name}-%{version}-filelist
139     %defattr(-,root,root)

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed