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