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