]> TLD Linux GIT Repositories - packages/munin.git/blob - munin.spec
- updated to 2.0.25
[packages/munin.git] / munin.spec
1 # TODO
2 # - R: perl* should be autogenerated?
3 # - add plugins-java package and proper BRs
4 #
5 # Condtional build:
6 %bcond_with     sybase          # add Sybase support to munin-node
7
8 %include        /usr/lib/rpm/macros.perl
9 Summary:        Munin - the Linpro RRD data agent
10 Summary(pl.UTF-8):      Munin - agent danych RRD Linpro
11 Name:           munin
12 Version:        2.0.25
13 Release:        1
14 License:        GPL
15 Group:          Applications/WWW
16 Source0:        http://downloads.sourceforge.net/munin/%{name}-%{version}.tar.gz
17 # Source0-md5:  b418a667ce42665557329a7ac3bd1b93
18 Source1:        %{name}-node.init
19 Source2:        %{name}.cron
20 Source3:        %{name}-apache.conf
21 Source4:        %{name}.logrotate
22 Source5:        %{name}-node.logrotate
23 Source6:        %{name}-lighttpd.conf
24 Source8:        %{name}-httpd.conf
25 Source11:       %{name}-asyncd.init
26 Patch0:         %{name}-Makefile.patch
27 Patch1:         %{name}-plugins.patch
28 Patch2:         %{name}-templatedir.patch
29 Patch3:         %{name}-separate-configs.patch
30 Patch4:         %{name}-timeout.patch
31 URL:            http://munin.sourceforge.net/
32 BuildRequires:  perl-Encode
33 BuildRequires:  perl-Net-SNMP
34 BuildRequires:  perl-devel
35 BuildRequires:  rpm-perlprov
36 BuildRequires:  rpm-pythonprov
37 BuildRequires:  rpmbuild(macros) >= 1.671
38 BuildRequires:  which
39 Requires(triggerpostun):        sed >= 4.0
40 Requires:       %{name}-common = %{version}-%{release}
41 Requires:       fonts-TTF-DejaVu
42 Requires:       perl-Date-Manip
43 Requires:       perl-FCGI
44 Requires:       perl-HTML-Template
45 Requires:       perl-Net-Server
46 Requires:       rrdtool >= 1.3.0
47 Requires:       webapps
48 Requires:       webserver(alias)
49 Requires:       webserver(auth)
50 Requires:       webserver(cgi)
51 Requires:       webserver(expires)
52 Suggests:       crondaemon
53 Conflicts:      apache-base < 2.4.0-1
54 Conflicts:      logrotate < 3.8.0
55 BuildArch:      noarch
56 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58 %define         _noautoreq_perl DBD::Pg
59
60 %define         _sysconfdir     /etc/%{name}
61 %define         _webapps        /etc/webapps
62 %define         _webapp         %{name}
63 %define         _appdir         %{_datadir}/%{_webapp}
64 %define         _htmldir        /var/lib/%{name}/html
65
66 %description
67 Munin, formerly known as The Linpro RRD server, queries a number of
68 nodes, and processes the data using RRDtool and presents it on web
69 pages.
70
71 %description -l pl.UTF-8
72 Munin, znany poprzednio jako serwer RRD Linpro, odpytuje wiele węzłów
73 i przetwarza dane przy użyciu RRDtoola, a następnie prezentuje je na
74 stronach WWW.
75
76 %package common
77 Summary:        Munin - the Linpro RRD data agent - common files
78 Summary(pl.UTF-8):      Munin - agent danych RRD Linpro - wspólne pliki
79 Group:          Daemons
80 Requires(postun):       /usr/sbin/groupdel
81 Requires(postun):       /usr/sbin/userdel
82 Requires(pre):  /bin/id
83 Requires(pre):  /usr/bin/getgid
84 Requires(pre):  /usr/sbin/groupadd
85 Requires(pre):  /usr/sbin/useradd
86
87 %description common
88 Munin, formerly known as The Linpro RRD server, queries a number of
89 nodes, and processes the data using RRDtool and presents it on web
90 pages.
91
92 %description common -l pl.UTF-8
93 Munin, znany poprzednio jako serwer RRD Linpro, odpytuje wiele węzłów
94 i przetwarza dane przy użyciu RRDtoola, a następnie prezentuje je na
95 stronach WWW.
96
97 %package node
98 Summary:        Linpro RRD data agent
99 Summary(pl.UTF-8):      Agent danych RRD Linpro
100 Group:          Daemons
101 Requires(post,preun):   /sbin/chkconfig
102 Requires:       %{name}-common = %{version}-%{release}
103 Requires:       logtail
104 Requires:       logtool
105 #Requires:      perl-Config-General
106 Requires:       perl-Net-Netmask
107 Requires:       perl-Net-SNMP
108 Requires:       perl-Net-Server
109 Requires:       perl-libwww
110 Requires:       procps >= 2.0.7
111 Requires:       rc-scripts >= 0.4.0.15
112 Requires:       sysstat
113 Suggests:       perl-DBD-Pg
114 Conflicts:      logrotate < 3.7-4
115
116 %description node
117 The Munin node package returns statistical data on the request of a
118 Munin server.
119
120 %description node -l pl.UTF-8
121 Pakiet Munin dla węzła zwraca dane statystyczne na żądanie serwera
122 Munin.
123
124 %prep
125 %setup -q
126 %patch0 -p1
127 %patch1 -p1
128 %patch2 -p1
129 %patch3 -p1
130 %patch4 -p1
131
132 %build
133 %{__make} -j1 build \
134         PERL_MB_OPT="perl=%{__perl}" \
135         JCVALID=no
136
137 %install
138 rm -rf $RPM_BUILD_ROOT
139 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,cron.d,logrotate.d},%{_bindir},%{_sbindir}} \
140         $RPM_BUILD_ROOT/var/log/archive/munin \
141         $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
142
143 %{__make} -j1 install \
144         JCVALID=no \
145         CHOWN=/bin/true \
146         DESTDIR=$RPM_BUILD_ROOT
147
148 # move asyncd daemon do sbin
149 %{__mv} $RPM_BUILD_ROOT{%{_datadir}/munin,%{_sbindir}}/munin-asyncd
150
151 install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/munin-asyncd
152 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/munin-node
153 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/munin
154 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/munin
155 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/munin-node
156
157 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
158 cp -p %{SOURCE8} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
159 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/lighttpd.conf
160
161 cp -p dists/tarball/plugins.conf $RPM_BUILD_ROOT%{_sysconfdir}
162 ln -sf %{_sysconfdir}/plugins.conf $RPM_BUILD_ROOT%{_sysconfdir}/plugin-conf.d/munin-node
163
164 for f in cgi-graph cgi-html graph html limits update ; do
165         touch $RPM_BUILD_ROOT/var/log/munin/munin-$f.log
166 done
167
168 %clean
169 rm -rf $RPM_BUILD_ROOT
170
171 %triggerin -- apache1 < 1.3.37-3, apache1-base
172 %webapp_register apache %{_webapp}
173
174 %triggerun -- apache1 < 1.3.37-3, apache1-base
175 %webapp_unregister apache %{_webapp}
176
177 %triggerin -- apache-base
178 %webapp_register httpd %{_webapp}
179
180 %triggerun -- apache-base
181 %webapp_unregister httpd %{_webapp}
182
183 %triggerin -- lighttpd
184 %webapp_register lighttpd %{_webapp}
185
186 %triggerun -- lighttpd
187 %webapp_unregister lighttpd %{_webapp}
188
189 %triggerpostun -- munin < 1.3.4-5
190 # rescue app config
191 if [ -f /etc/munin/munin.conf.rpmsave ]; then
192         mv -f %{_webapps}/%{_webapp}/munin.conf{,.rpmnew}
193         mv -f /etc/munin/munin.conf.rpmsave %{_webapps}/%{_webapp}/munin.conf
194
195         # fix paths in munin.conf
196         sed -i -e 's|dbdir.*|dbdir      /var/lib/munin/db|' \
197                 -e 's|tmpldir.*|tmpldir %{_webapps}/%{_webapp}/templates|' \
198                 %{_webapps}/%{_webapp}/munin.conf
199 fi
200 # move RRDs to new location
201 cd /var/lib/munin
202 for i in *; do
203         case "$i" in
204                 db|html|plugin-state) ;;
205                 *) mv -f "$i" db/ ;;
206         esac
207 done
208
209 %post
210 for f in cgi-graph cgi-html graph html limits update ; do
211         touch /var/log/munin/munin-$f.log
212         chmod 660 /var/log/munin/munin-$f.log
213         chown munin:http /var/log/munin/munin-$f.log
214 done
215
216 %post node
217 if [ "$1" = "1" ] ; then
218         /sbin/chkconfig --add munin-node
219         %{_sbindir}/munin-node-configure --shell | sh
220 fi
221 %service munin-node restart "Munin Node agent"
222 %service munin-asyncd try-restart "Munin Asyncd agent"
223
224 %preun node
225 if [ "$1" = "0" ] ; then
226         %service munin-asyncd stop
227         %service munin-node stop
228         /sbin/chkconfig --del munin-node
229         /sbin/chkconfig --del munin-asyncd
230 fi
231
232 %pre common
233 %groupadd -g 158 munin
234 %useradd -o -u 158 -s /bin/false -g munin -c "Munin Node agent" -d /var/lib/munin munin
235
236 %postun common
237 if [ "$1" = "0" ]; then
238         %userremove munin
239         %groupremove munin
240 fi
241
242 %files
243 %defattr(644,root,root,755)
244 %dir %attr(750,munin,http) %{_webapps}/%{_webapp}
245 %dir %attr(750,munin,http) %{_webapps}/%{_webapp}/munin-conf.d
246 %dir %{_webapps}/%{_webapp}/templates
247 %{_webapps}/%{_webapp}/templates/*.tmpl
248 %dir %{_webapps}/%{_webapp}/templates/static
249 %{_webapps}/%{_webapp}/templates/static/*.css
250 %{_webapps}/%{_webapp}/templates/static/*.html
251 %{_webapps}/%{_webapp}/templates/static/*.ico
252 %{_webapps}/%{_webapp}/templates/static/*.js
253 %{_webapps}/%{_webapp}/templates/static/*.png
254 %dir %{_webapps}/%{_webapp}/templates/partial
255 %{_webapps}/%{_webapp}/templates/partial/*.tmpl
256 %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/munin.conf
257 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
258 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
259 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/lighttpd.conf
260 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/munin
261 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/munin
262 %attr(755,root,root) %{_sbindir}/munin-cron
263 %attr(755,root,root) %{_datadir}/munin/munin-check
264 %attr(755,root,root) %{_datadir}/munin/munin-graph
265 %attr(755,root,root) %{_datadir}/munin/munin-html
266 %attr(755,root,root) %{_datadir}/munin/munin-limits
267 %attr(755,root,root) %{_datadir}/munin/munin-update
268 %attr(755,root,root) %{_datadir}/munin/munin-datafile2storable
269 %attr(755,root,root) %{_datadir}/munin/munin-storable2datafile
270 %attr(755,munin,root) %dir %{_datadir}/munin/cgi
271 %attr(755,munin,root) %{_datadir}/munin/cgi/munin-cgi-graph
272 %attr(755,munin,root) %{_datadir}/munin/cgi/munin-cgi-html
273 %attr(755,munin,root) %dir %{_htmldir}
274 %{perl_vendorlib}/Munin/Master
275 %{_mandir}/man3/Munin::Master*
276 %{_mandir}/man5/munin.conf*
277 %{_mandir}/man8/munin-check*
278 %{_mandir}/man8/munin-cron*
279 %{_mandir}/man8/munin-graph*
280 %{_mandir}/man8/munin-html*
281 %{_mandir}/man8/munin-limits*
282 %{_mandir}/man8/munin-update*
283 %{_mandir}/man8/munin.*
284 %attr(771,munin,munin) %dir /var/lib/munin/db
285 %attr(770,munin,http) %dir /var/lib/munin/db/cgi-tmp
286 %attr(660,munin,http) %ghost /var/log/munin/munin-cgi-graph.log
287 %attr(660,munin,http) %ghost /var/log/munin/munin-cgi-html.log
288 %attr(660,munin,http) %ghost /var/log/munin/munin-graph.log
289 %attr(660,munin,http) %ghost /var/log/munin/munin-html.log
290 %attr(660,munin,http) %ghost /var/log/munin/munin-limits.log
291 %attr(660,munin,http) %ghost /var/log/munin/munin-update.log
292
293 %files common
294 %defattr(644,root,root,755)
295 %doc README ChangeLog logo* Checklist
296 %dir %{_datadir}/munin
297 %attr(770,munin,http) %dir /var/log/munin
298 %attr(750,munin,http) %dir /var/log/archive/munin
299 %attr(771,munin,munin) %dir /var/lib/munin
300 %attr(770,munin,http) %dir /var/run/munin
301 %dir %{perl_vendorlib}/Munin
302 %{perl_vendorlib}/Munin/Common
303 %{_mandir}/man3/Munin::Common*
304
305 %files node
306 %defattr(644,root,root,755)
307 %dir %{_sysconfdir}
308 %dir %{_sysconfdir}/plugins
309 %dir %{_sysconfdir}/plugin-conf.d
310 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/munin-node.conf
311 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/plugins.conf
312 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/plugin-conf.d/munin-node
313 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/munin-node
314 %attr(754,root,root) /etc/rc.d/init.d/munin-asyncd
315 %attr(754,root,root) /etc/rc.d/init.d/munin-node
316 %attr(755,root,root) %{_bindir}/munindoc
317 %attr(755,root,root) %{_sbindir}/munin-asyncd
318 %attr(755,root,root) %{_sbindir}/munin-node
319 %attr(755,root,root) %{_sbindir}/munin-node-configure
320 %attr(755,root,root) %{_sbindir}/munin-run
321 %attr(755,root,root) %{_sbindir}/munin-sched
322 %{perl_vendorlib}/Munin/Node
323 %{perl_vendorlib}/Munin/Plugin
324 %{perl_vendorlib}/Munin/Plugin.pm
325 %attr(755,root,root) %{_datadir}/munin/munin-async
326 %dir %{_datadir}/munin/plugins
327 %attr(755,root,root) %{_datadir}/munin/plugins/*
328 %if !%{with sybase}
329 %exclude %{_datadir}/munin/plugins/sybase_space
330 %endif
331 %dir %attr(770,munin,munin) /var/lib/munin/plugin-state
332 %dir %attr(770,munin,munin) /var/spool/munin
333 %{_mandir}/man1/munin-node*
334 %{_mandir}/man1/munin-run*
335 %{_mandir}/man1/munin-sched*
336 %{_mandir}/man1/munindoc*
337 %{_mandir}/man3/Munin::Node*
338 %{_mandir}/man3/Munin::Plugin*
339 %{_mandir}/man5/munin-node.conf*
340
341 #%files plugins-java
342 #%defattr(644,root,root,755)
343 #%{_datadir}/munin/munin-jmx-plugins.jar