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