]> git.pld-linux.org Git - packages/munin.git/blob - munin.spec
2725b53cbbafe07fc2c280ec1ca21d4ee4922d97
[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.17
13 Release:        6
14 License:        GPL
15 Group:          Applications/WWW
16 Source0:        http://downloads.sourceforge.net/munin/%{name}-%{version}.tar.gz
17 # Source0-md5:  80c8e6090963ad888e43b90c77f0a866
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 Source7:        %{name}.tmpfiles
25 Source8:        %{name}-httpd.conf
26 Source9:        %{name}-node.service
27 Source10:       %{name}-asyncd.service
28 Source11:       %{name}-asyncd.init
29 Patch0:         %{name}-Makefile.patch
30 Patch1:         %{name}-plugins.patch
31 Patch2:         %{name}-templatedir.patch
32 Patch3:         %{name}-separate-configs.patch
33 Patch4:         %{name}-timeout.patch
34 URL:            http://munin.sourceforge.net/
35 BuildRequires:  perl-Encode
36 BuildRequires:  perl-Net-SNMP
37 BuildRequires:  perl-devel
38 BuildRequires:  rpm-perlprov
39 BuildRequires:  rpm-pythonprov
40 BuildRequires:  rpmbuild(macros) >= 1.671
41 BuildRequires:  which
42 Requires(triggerpostun):        sed >= 4.0
43 Requires:       %{name}-common = %{version}-%{release}
44 Requires:       fonts-TTF-DejaVu
45 Requires:       perl-Date-Manip
46 Requires:       perl-FCGI
47 Requires:       perl-HTML-Template
48 Requires:       perl-Net-Server
49 Requires:       rrdtool >= 1.3.0
50 Requires:       webapps
51 Requires:       webserver(alias)
52 Requires:       webserver(auth)
53 Requires:       webserver(cgi)
54 Requires:       webserver(expires)
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:       systemd-units >= 38
115 Requires:       sysstat
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 JCVALID=no
137
138 %install
139 rm -rf $RPM_BUILD_ROOT
140 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,cron.d,logrotate.d},%{_bindir},%{_sbindir}} \
141         $RPM_BUILD_ROOT/var/log/archive/munin \
142         $RPM_BUILD_ROOT%{_webapps}/%{_webapp} \
143         $RPM_BUILD_ROOT/usr/lib/tmpfiles.d \
144         $RPM_BUILD_ROOT%{systemdunitdir}
145
146 %{__make} -j1 install \
147         JCVALID=no \
148         CHOWN=/bin/true \
149         DESTDIR=$RPM_BUILD_ROOT
150
151 # move asyncd daemon do sbin
152 %{__mv} $RPM_BUILD_ROOT{%{_datadir}/munin,%{_sbindir}}/munin-asyncd
153
154 install %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/munin-asyncd
155 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/munin-node
156 install %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/munin
157 install %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/munin
158 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/munin-node
159
160 install %{SOURCE3} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf
161 install %{SOURCE8} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf
162 install %{SOURCE6} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/lighttpd.conf
163
164 install %{SOURCE7} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
165
166 install %{SOURCE9} $RPM_BUILD_ROOT%{systemdunitdir}/munin-node.service
167 install %{SOURCE10} $RPM_BUILD_ROOT%{systemdunitdir}/munin-asyncd.service
168
169 install dists/tarball/plugins.conf $RPM_BUILD_ROOT%{_sysconfdir}
170 ln -sf %{_sysconfdir}/plugins.conf $RPM_BUILD_ROOT%{_sysconfdir}/plugin-conf.d/munin-node
171
172 for f in cgi-graph cgi-html graph html limits update ; do
173         touch $RPM_BUILD_ROOT/var/log/munin/munin-$f.log
174 done
175
176 %clean
177 rm -rf $RPM_BUILD_ROOT
178
179 %triggerin -- apache1 < 1.3.37-3, apache1-base
180 %webapp_register apache %{_webapp}
181
182 %triggerun -- apache1 < 1.3.37-3, apache1-base
183 %webapp_unregister apache %{_webapp}
184
185 %triggerin -- apache-base
186 %webapp_register httpd %{_webapp}
187
188 %triggerun -- apache-base
189 %webapp_unregister httpd %{_webapp}
190
191 %triggerin -- lighttpd
192 %webapp_register lighttpd %{_webapp}
193
194 %triggerun -- lighttpd
195 %webapp_unregister lighttpd %{_webapp}
196
197 %triggerpostun -- munin < 1.3.4-5
198 # rescue app config
199 if [ -f /etc/munin/munin.conf.rpmsave ]; then
200         mv -f %{_webapps}/%{_webapp}/munin.conf{,.rpmnew}
201         mv -f /etc/munin/munin.conf.rpmsave %{_webapps}/%{_webapp}/munin.conf
202
203         # fix paths in munin.conf
204         sed -i -e 's|dbdir.*|dbdir      /var/lib/munin/db|' \
205                 -e 's|tmpldir.*|tmpldir %{_webapps}/%{_webapp}/templates|' \
206                 %{_webapps}/%{_webapp}/munin.conf
207 fi
208 # move RRDs to new location
209 cd /var/lib/munin
210 for i in *; do
211         case "$i" in
212                 db|html|plugin-state) ;;
213                 *) mv -f "$i" db/ ;;
214         esac
215 done
216
217 %post
218 for f in cgi-graph cgi-html graph html limits update ; do
219         touch /var/log/munin/munin-$f.log
220         chmod 660 /var/log/munin/munin-$f.log
221         chown munin:http /var/log/munin/munin-$f.log
222 done
223
224 %post node
225 if [ "$1" = "1" ] ; then
226         /sbin/chkconfig --add munin-node
227         %{_sbindir}/munin-node-configure --shell | sh
228 fi
229 %service munin-node restart "Munin Node agent"
230 %service munin-asyncd try-restart "Munin Asyncd agent"
231 %systemd_post munin-node.service
232 %systemd_service_restart munin-asyncd.service
233
234 %preun node
235 if [ "$1" = "0" ] ; then
236         %service munin-asyncd stop
237         %service munin-node stop
238         /sbin/chkconfig --del munin-node
239         /sbin/chkconfig --del munin-asyncd
240 fi
241 %systemd_preun munin-node.service munin-asyncd.service
242
243 %postun node
244 %systemd_reload
245
246 %triggerpostun node -- munin-node < 2.0.17-1
247 %systemd_trigger munin-node.service
248
249 %pre common
250 %groupadd -g 158 munin
251 %useradd -o -u 158 -s /bin/false -g munin -c "Munin Node agent" -d /var/lib/munin munin
252
253 %postun common
254 if [ "$1" = "0" ]; then
255         %userremove munin
256         %groupremove munin
257 fi
258
259 %files
260 %defattr(644,root,root,755)
261 %dir %attr(750,munin,http) %{_webapps}/%{_webapp}
262 %dir %attr(750,munin,http) %{_webapps}/%{_webapp}/munin-conf.d
263 %dir %{_webapps}/%{_webapp}/templates
264 %{_webapps}/%{_webapp}/templates/*.tmpl
265 %dir %{_webapps}/%{_webapp}/templates/static
266 %{_webapps}/%{_webapp}/templates/static/*.css
267 %{_webapps}/%{_webapp}/templates/static/*.html
268 %{_webapps}/%{_webapp}/templates/static/*.ico
269 %{_webapps}/%{_webapp}/templates/static/*.js
270 %{_webapps}/%{_webapp}/templates/static/*.png
271 %dir %{_webapps}/%{_webapp}/templates/partial
272 %{_webapps}/%{_webapp}/templates/partial/*.tmpl
273 %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/munin.conf
274 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
275 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
276 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/lighttpd.conf
277 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/munin
278 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/munin
279 %attr(755,root,root) %{_sbindir}/munin-cron
280 %attr(755,root,root) %{_datadir}/munin/munin-check
281 %attr(755,root,root) %{_datadir}/munin/munin-graph
282 %attr(755,root,root) %{_datadir}/munin/munin-html
283 %attr(755,root,root) %{_datadir}/munin/munin-limits
284 %attr(755,root,root) %{_datadir}/munin/munin-update
285 %attr(755,root,root) %{_datadir}/munin/munin-datafile2storable
286 %attr(755,root,root) %{_datadir}/munin/munin-storable2datafile
287 %attr(755,munin,root) %dir %{_datadir}/munin/cgi
288 %attr(755,munin,root) %{_datadir}/munin/cgi/munin-cgi-graph
289 %attr(755,munin,root) %{_datadir}/munin/cgi/munin-cgi-html
290 %attr(755,munin,root) %dir %{_htmldir}
291 %{perl_vendorlib}/Munin/Master
292 %{_mandir}/man3/Munin::Master*
293 %{_mandir}/man5/munin.conf*
294 %{_mandir}/man8/munin-check*
295 %{_mandir}/man8/munin-cron*
296 %{_mandir}/man8/munin-graph*
297 %{_mandir}/man8/munin-html*
298 %{_mandir}/man8/munin-limits*
299 %{_mandir}/man8/munin-update*
300 %{_mandir}/man8/munin.*
301 %attr(771,munin,munin) %dir /var/lib/munin/db
302 %attr(770,munin,http) %dir /var/lib/munin/db/cgi-tmp
303 %attr(660,munin,http) %ghost /var/log/munin/munin-cgi-graph.log
304 %attr(660,munin,http) %ghost /var/log/munin/munin-cgi-html.log
305 %attr(660,munin,http) %ghost /var/log/munin/munin-graph.log
306 %attr(660,munin,http) %ghost /var/log/munin/munin-html.log
307 %attr(660,munin,http) %ghost /var/log/munin/munin-limits.log
308 %attr(660,munin,http) %ghost /var/log/munin/munin-update.log
309
310 %files common
311 %defattr(644,root,root,755)
312 %doc README ChangeLog logo* Checklist
313 %dir %{_datadir}/munin
314 /usr/lib/tmpfiles.d/%{name}.conf
315 %attr(770,munin,http) %dir /var/log/munin
316 %attr(750,munin,http) %dir /var/log/archive/munin
317 %attr(771,munin,munin) %dir /var/lib/munin
318 %attr(770,munin,http) %dir /var/run/munin
319 %dir %{perl_vendorlib}/Munin
320 %{perl_vendorlib}/Munin/Common
321 %{_mandir}/man3/Munin::Common*
322
323 %files node
324 %defattr(644,root,root,755)
325 %dir %{_sysconfdir}
326 %dir %{_sysconfdir}/plugins
327 %dir %{_sysconfdir}/plugin-conf.d
328 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/munin-node.conf
329 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/plugins.conf
330 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/plugin-conf.d/munin-node
331 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/munin-node
332 %attr(754,root,root) /etc/rc.d/init.d/munin-asyncd
333 %attr(754,root,root) /etc/rc.d/init.d/munin-node
334 %{systemdunitdir}/munin-asyncd.service
335 %{systemdunitdir}/munin-node.service
336 %attr(755,root,root) %{_bindir}/munindoc
337 %attr(755,root,root) %{_sbindir}/munin-asyncd
338 %attr(755,root,root) %{_sbindir}/munin-node
339 %attr(755,root,root) %{_sbindir}/munin-node-configure
340 %attr(755,root,root) %{_sbindir}/munin-run
341 %attr(755,root,root) %{_sbindir}/munin-sched
342 %{perl_vendorlib}/Munin/Node
343 %{perl_vendorlib}/Munin/Plugin
344 %{perl_vendorlib}/Munin/Plugin.pm
345 %attr(755,root,root) %{_datadir}/munin/munin-async
346 %dir %{_datadir}/munin/plugins
347 %attr(755,root,root) %{_datadir}/munin/plugins/*
348 %if !%{with sybase}
349 %exclude %{_datadir}/munin/plugins/sybase_space
350 %endif
351 %dir %attr(770,munin,munin) /var/lib/munin/plugin-state
352 %dir %attr(770,munin,munin) /var/spool/munin
353 %{_mandir}/man1/munin-node*
354 %{_mandir}/man1/munin-run*
355 %{_mandir}/man1/munin-sched*
356 %{_mandir}/man1/munindoc*
357 %{_mandir}/man3/Munin::Node*
358 %{_mandir}/man3/Munin::Plugin*
359 %{_mandir}/man5/munin-node.conf*
360
361 #%files plugins-java
362 #%defattr(644,root,root,755)
363 #%{_datadir}/munin/munin-jmx-plugins.jar
This page took 0.790725 seconds and 2 git commands to generate.