/[nagraffiti]/nagraffiti.spec
ViewVC logotype

Contents of /nagraffiti.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 46 - (hide annotations) (download)
Wed Apr 24 10:31:34 2013 UTC (6 years, 4 months ago) by racvision
File size: 5269 byte(s)
v2.2
1 racvision 1 # release number:
2     %define rel %(date '+%Y%m%d%H%M')
3    
4 racvision 46 %define wwwpath /var/www/html
5 racvision 1 %define nagraffiti_user nagraffiti
6    
7     Summary: Nagios grapher
8     Name: nagraffiti
9 racvision 46 Version: 2.2
10 racvision 1 Release: %{rel}
11     Source0: %{name}-www.tar.bz2
12     Source1: %{name}-backend.tar.bz2
13     Source2: %{name}-po.tar.bz2
14     License: GPL
15     Group: Applications/System
16 racvision 46 Requires: rrdtool-perl, check_mk-livestatus, dejavu-sans-mono-fonts, perl-JSON-XS
17 racvision 1 Provides: perl(Nagraffiti::Nagraph)
18     BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
19 racvision 17 BuildArch: noarch
20 racvision 1
21     # mysql password path :
22     %define mysql_passwd_path %{_sysconfdir}/racvision/mysql/passwords
23    
24    
25     %description
26 racvision 46 Nagraffiti is a performance data grapher for Nagios. It use Livestatus to collect data.
27 racvision 1
28    
29     %description -l fr
30 racvision 17 Nagraffiti est un traceur de donnée de performance issues de Nagios. Il peut utiliser NDO utils ou Livestatus pour collecter les données.
31 racvision 1
32     %prep
33    
34     #%setup
35     %{__tar} --overwrite -xjf %{SOURCE0}
36     %{__tar} --overwrite -xjf %{SOURCE1}
37     %{__tar} --overwrite -xjf %{SOURCE2}
38    
39     %build
40    
41     %install
42     [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && %{__rm} -rf $RPM_BUILD_ROOT;
43    
44    
45 racvision 17 # Racvision index info
46 racvision 46 %{__install} -d $RPM_BUILD_ROOT/%{wwwpath}/racvision/
47     %{__install} -p -m0644 www/nagraffiti.php $RPM_BUILD_ROOT/%{wwwpath}/racvision/
48 racvision 17
49     # www files
50 racvision 46 %{__install} -d $RPM_BUILD_ROOT/%{wwwpath}/%{name}/classes
51     %{__install} -p -m0644 www/classes/*.php $RPM_BUILD_ROOT/%{wwwpath}/%{name}/classes/
52 racvision 1
53 racvision 46 %{__install} -d $RPM_BUILD_ROOT/%{wwwpath}/%{name}/css
54     %{__install} -p -m0644 www/css/*.css $RPM_BUILD_ROOT/%{wwwpath}/%{name}/css/
55 racvision 1
56 racvision 46 %{__install} -d $RPM_BUILD_ROOT/%{wwwpath}/%{name}/img
57     %{__install} -p -m0644 www/img/* $RPM_BUILD_ROOT/%{wwwpath}/%{name}/img/
58 racvision 1
59 racvision 46 %{__install} -d $RPM_BUILD_ROOT/%{wwwpath}/%{name}/js
60     %{__install} -p -m0644 www/js/*.js $RPM_BUILD_ROOT/%{wwwpath}/%{name}/js/
61 racvision 1
62 racvision 46 %{__install} -d $RPM_BUILD_ROOT/%{wwwpath}/%{name}/%{name}
63     %{__install} -p -m0644 www/%{name}/*.php $RPM_BUILD_ROOT/%{wwwpath}/%{name}/%{name}/
64 racvision 1
65 racvision 46 %{__install} -p -m0644 www/index.php $RPM_BUILD_ROOT/%{wwwpath}/%{name}/
66 racvision 1
67 racvision 5 # Templates
68 racvision 46 %{__install} -d $RPM_BUILD_ROOT/%{wwwpath}/%{name}/templates
69     %{__install} -p -m0644 www/templates/*.php $RPM_BUILD_ROOT/%{wwwpath}/%{name}/templates/
70 racvision 5
71 racvision 1 # backend
72 racvision 46 %{__install} -d $RPM_BUILD_ROOT/%{perl_vendorlib}/Nagraffiti
73     %{__install} -p -m0755 backend/lib/*.pm $RPM_BUILD_ROOT/%{perl_vendorlib}/Nagraffiti/
74     %{__install} -d $RPM_BUILD_ROOT/%{perl_vendorlib}/Nagraffiti/Input
75     %{__install} -p -m0755 backend/lib/Input/*.pm $RPM_BUILD_ROOT/%{perl_vendorlib}/Nagraffiti/Input
76 racvision 1
77     %{__install} -d $RPM_BUILD_ROOT/%{_sbindir}
78 racvision 46 #%{__install} -p -m0755 backend/nagraffiti-ndo-daemon.pl $RPM_BUILD_ROOT/%{_sbindir}/
79     %{__install} -p -m0755 backend/nagraffiti-daemon.pl $RPM_BUILD_ROOT/%{_sbindir}/
80 racvision 1
81     # Configs files:
82     %{__install} -d $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}
83     %{__install} -p -m0640 backend/config.ini $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/
84     %{__install} -p -m0644 backend/rra.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/
85 racvision 46 %{__install} -p -m0644 backend/log4p.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/
86 racvision 1
87     # Logs files:
88     %{__install} -d $RPM_BUILD_ROOT/%{_localstatedir}/log/%{name}
89    
90     # Rrd repository:
91     %{__install} -d $RPM_BUILD_ROOT/%{_localstatedir}/lib/%{name}
92    
93 racvision 14 # Pid
94     %{__install} -d $RPM_BUILD_ROOT/%{_localstatedir}/run/%{name}
95    
96    
97 racvision 1 # Init script
98     %{__install} -d $RPM_BUILD_ROOT/%{_initrddir}
99     %{__install} -p -m0755 backend/%{name}.init $RPM_BUILD_ROOT/%{_initrddir}/%{name}
100    
101    
102     # I18n files
103 racvision 14 for lang in fr; do
104 racvision 1 %{__install} -d $RPM_BUILD_ROOT/%{_datadir}/locale/$lang/LC_MESSAGES/
105     %{__install} -m0644 po/init-$lang.mo $RPM_BUILD_ROOT/%{_datadir}/locale/$lang/LC_MESSAGES/%{name}_init.mo
106     %{__install} -m0644 po/php-$lang.mo $RPM_BUILD_ROOT/%{_datadir}/locale/$lang/LC_MESSAGES/%{name}_php.mo
107     done
108    
109     %{find_lang} %{name}_init %{name}_lang --all-name
110    
111     #====[ pre installation scripts:
112     %pre
113    
114     # Add user/group:
115     echo Adding %{nagraffiti_user} user ...
116     /usr/sbin/useradd -M -o -r -d %{_localstatedir}/log/%{name} -s /sbin/nologin -c "Application Nagraffiti" -u 407 %{nagraffiti_user} > /dev/null 2>&1 || :
117    
118     # Add apache in nagraffiti group
119     if ! id -Gn apache | grep -q nagraffiti ; then
120     echo "Adding user 'apache' to 'nagraffiti' group."
121     usermod -aG nagraffiti apache
122     fi
123    
124     #====[ post installation scripts:
125     %post
126    
127     # Configure database password :
128 racvision 46 #/usr/bin/mkpasswd -l 10 -s 0 > %{mysql_passwd_path}/%{name}
129     #%{__chmod} 640 %{mysql_passwd_path}/%{name}
130 racvision 1
131     # Add initscript to system V start :
132     if test -x /sbin/chkconfig; then
133     /sbin/chkconfig --add %{name}
134     /sbin/chkconfig %{name} on
135     fi
136    
137    
138     #====[ pre uninstall scripts
139     %preun
140    
141     %postun
142    
143     %files -f %{name}_lang
144 racvision 17 %doc backend/README
145 racvision 14 %defattr(-,%{nagraffiti_user},%{nagraffiti_user})
146     %config %{_sysconfdir}/%{name}/rra.cfg
147 racvision 46 %config %{_sysconfdir}/%{name}/log4p.cfg
148     %attr(-,%{nagraffiti_user} ,apache) %config %{_sysconfdir}/%{name}/config.ini
149 racvision 14
150 racvision 1 %defattr(-,root,root)
151    
152     %{_initrddir}/%{name}
153 racvision 46 #%{_sbindir}/nagraffiti-ndo-daemon.pl
154     %{_sbindir}/nagraffiti-daemon.pl
155 racvision 1 %{wwwpath}
156    
157 racvision 46 #%dir %{perl_vendorlib}/Nagraffiti
158     %{perl_vendorlib}/Nagraffiti/
159 racvision 1
160     %attr(-,%{nagraffiti_user} ,%{nagraffiti_user}) %dir %{_localstatedir}/log/%{name}
161     %attr(-,%{nagraffiti_user} ,%{nagraffiti_user}) %dir %{_localstatedir}/lib/%{name}
162 racvision 14 %attr(-,%{nagraffiti_user} ,%{nagraffiti_user}) %dir %{_localstatedir}/run/%{name}

  ViewVC Help
Powered by ViewVC 1.1.8