]>
Commit | Line | Data |
---|---|---|
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 | 9 | Summary: Munin - the Linpro RRD data agent |
2d3160ae | 10 | Summary(pl.UTF-8): Munin - agent danych RRD Linpro |
4bc4cd7a | 11 | Name: munin |
4bc24037 | 12 | Version: 2.0.19 |
8b3c0607 | 13 | Release: 3 |
4bc4cd7a | 14 | License: GPL |
055dd9b8 | 15 | Group: Applications/WWW |
86c1c314 | 16 | Source0: http://downloads.sourceforge.net/munin/%{name}-%{version}.tar.gz |
4bc24037 | 17 | # Source0-md5: ab27d477052c0f5da4ed81edb7f95f1b |
c6d9e008 JR |
18 | Source1: %{name}-node.init |
19 | Source2: %{name}.cron | |
45370027 | 20 | Source3: %{name}-apache.conf |
feeb2b03 | 21 | Source4: %{name}.logrotate |
e4cd494c | 22 | Source5: %{name}-node.logrotate |
055dd9b8 | 23 | Source6: %{name}-lighttpd.conf |
dfceca38 | 24 | Source7: %{name}.tmpfiles |
ed06bc9b | 25 | Source8: %{name}-httpd.conf |
86c1c314 | 26 | Source9: %{name}-node.service |
ec328424 JR |
27 | Source10: %{name}-asyncd.service |
28 | Source11: %{name}-asyncd.init | |
45b918d5 | 29 | Patch0: %{name}-Makefile.patch |
3979e847 | 30 | Patch1: %{name}-plugins.patch |
6f055b6e JR |
31 | Patch2: %{name}-templatedir.patch |
32 | Patch3: %{name}-separate-configs.patch | |
6f13caf9 | 33 | Patch4: %{name}-timeout.patch |
4bc4cd7a | 34 | URL: http://munin.sourceforge.net/ |
2958a9fa | 35 | BuildRequires: perl-Encode |
24c8eb60 | 36 | BuildRequires: perl-Net-SNMP |
c6d9e008 | 37 | BuildRequires: perl-devel |
24c8eb60 | 38 | BuildRequires: rpm-perlprov |
05914e2e | 39 | BuildRequires: rpm-pythonprov |
86c1c314 | 40 | BuildRequires: rpmbuild(macros) >= 1.671 |
05914e2e | 41 | BuildRequires: which |
f1dbcb61 | 42 | Requires(triggerpostun): sed >= 4.0 |
45b918d5 | 43 | Requires: %{name}-common = %{version}-%{release} |
747b36ba | 44 | Requires: fonts-TTF-DejaVu |
ccb1a599 | 45 | Requires: perl-Date-Manip |
86c1c314 | 46 | Requires: perl-FCGI |
4bc4cd7a JR |
47 | Requires: perl-HTML-Template |
48 | Requires: perl-Net-Server | |
9ae69bf4 | 49 | Requires: rrdtool >= 1.3.0 |
055dd9b8 JR |
50 | Requires: webapps |
51 | Requires: webserver(alias) | |
52 | Requires: webserver(auth) | |
53 | Requires: webserver(cgi) | |
54 | Requires: webserver(expires) | |
8b3c0607 | 55 | Suggests: crondaemon |
ed06bc9b | 56 | Conflicts: apache-base < 2.4.0-1 |
30abe6cf | 57 | Conflicts: logrotate < 3.8.0 |
4bc4cd7a JR |
58 | BuildArch: noarch |
59 | BuildRoot: %{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 |
70 | Munin, formerly known as The Linpro RRD server, queries a number of | |
71 | nodes, and processes the data using RRDtool and presents it on web | |
72 | pages. | |
73 | ||
edc25e29 JR |
74 | %description -l pl.UTF-8 |
75 | Munin, znany poprzednio jako serwer RRD Linpro, odpytuje wiele węzłów | |
76 | i przetwarza dane przy użyciu RRDtoola, a następnie prezentuje je na | |
372a5e27 JB |
77 | stronach WWW. |
78 | ||
45b918d5 JR |
79 | %package common |
80 | Summary: Munin - the Linpro RRD data agent - common files | |
2d3160ae | 81 | Summary(pl.UTF-8): Munin - agent danych RRD Linpro - wspólne pliki |
45b918d5 | 82 | Group: Daemons |
b9eec776 ER |
83 | Requires(postun): /usr/sbin/groupdel |
84 | Requires(postun): /usr/sbin/userdel | |
45b918d5 | 85 | Requires(pre): /bin/id |
b9eec776 | 86 | Requires(pre): /usr/bin/getgid |
45b918d5 JR |
87 | Requires(pre): /usr/sbin/groupadd |
88 | Requires(pre): /usr/sbin/useradd | |
45b918d5 JR |
89 | |
90 | %description common | |
91 | Munin, formerly known as The Linpro RRD server, queries a number of | |
92 | nodes, and processes the data using RRDtool and presents it on web | |
93 | pages. | |
94 | ||
edc25e29 JR |
95 | %description common -l pl.UTF-8 |
96 | Munin, znany poprzednio jako serwer RRD Linpro, odpytuje wiele węzłów | |
97 | i przetwarza dane przy użyciu RRDtoola, a następnie prezentuje je na | |
45b918d5 JR |
98 | stronach WWW. |
99 | ||
4bc4cd7a JR |
100 | %package node |
101 | Summary: Linpro RRD data agent | |
2d3160ae | 102 | Summary(pl.UTF-8): Agent danych RRD Linpro |
4bc4cd7a | 103 | Group: Daemons |
45b918d5 JR |
104 | Requires(post,preun): /sbin/chkconfig |
105 | Requires: %{name}-common = %{version}-%{release} | |
6a0ae003 | 106 | Requires: logtail |
3979e847 | 107 | Requires: logtool |
4bc4cd7a | 108 | #Requires: perl-Config-General |
3979e847 | 109 | Requires: perl-Net-Netmask |
ccb1a599 | 110 | Requires: perl-Net-SNMP |
b9eec776 | 111 | Requires: perl-Net-Server |
ccb1a599 | 112 | Requires: perl-libwww |
4bc4cd7a | 113 | Requires: procps >= 2.0.7 |
03c327b0 | 114 | Requires: rc-scripts >= 0.4.0.15 |
4bc4cd7a | 115 | Requires: sysstat |
ff8f6adf | 116 | Requires: systemd-units >= 38 |
3d2d2471 | 117 | Suggests: perl-DBD-Pg |
5d71945b | 118 | Conflicts: logrotate < 3.7-4 |
4bc4cd7a JR |
119 | |
120 | %description node | |
121 | The Munin node package returns statistical data on the request of a | |
122 | Munin server. | |
123 | ||
edc25e29 JR |
124 | %description node -l pl.UTF-8 |
125 | Pakiet Munin dla węzła zwraca dane statystyczne na żądanie serwera | |
372a5e27 JB |
126 | Munin. |
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 | 142 | rm -rf $RPM_BUILD_ROOT |
dfceca38 JR |
143 | install -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 |
157 | install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/rc.d/init.d/munin-asyncd |
158 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/munin-node | |
159 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.d/munin | |
160 | cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/logrotate.d/munin | |
161 | cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/munin-node | |
c6d9e008 | 162 | |
ff8f6adf ER |
163 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/apache.conf |
164 | cp -p %{SOURCE8} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/httpd.conf | |
165 | cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/lighttpd.conf | |
9cadb988 | 166 | |
ff8f6adf | 167 | cp -p %{SOURCE7} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf |
dfceca38 | 168 | |
ff8f6adf ER |
169 | cp -p %{SOURCE9} $RPM_BUILD_ROOT%{systemdunitdir}/munin-node.service |
170 | cp -p %{SOURCE10} $RPM_BUILD_ROOT%{systemdunitdir}/munin-asyncd.service | |
86c1c314 | 171 | |
ff8f6adf | 172 | cp -p dists/tarball/plugins.conf $RPM_BUILD_ROOT%{_sysconfdir} |
3979e847 | 173 | ln -sf %{_sysconfdir}/plugins.conf $RPM_BUILD_ROOT%{_sysconfdir}/plugin-conf.d/munin-node |
4bc4cd7a | 174 | |
86c1c314 JR |
175 | for f in cgi-graph cgi-html graph html limits update ; do |
176 | touch $RPM_BUILD_ROOT/var/log/munin/munin-$f.log | |
177 | done | |
178 | ||
4bc4cd7a JR |
179 | %clean |
180 | rm -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 |
202 | if [ -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 |
210 | fi |
211 | # move RRDs to new location | |
212 | cd /var/lib/munin | |
c924886e | 213 | for i in *; do |
59652a7d JR |
214 | case "$i" in |
215 | db|html|plugin-state) ;; | |
216 | *) mv -f "$i" db/ ;; | |
217 | esac | |
218 | done | |
219 | ||
86c1c314 JR |
220 | %post |
221 | for 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 | |
225 | done | |
226 | ||
4bc4cd7a | 227 | %post node |
c6d9e008 | 228 | if [ "$1" = "1" ] ; then |
4bc4cd7a JR |
229 | /sbin/chkconfig --add munin-node |
230 | %{_sbindir}/munin-node-configure --shell | sh | |
231 | fi | |
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 | 238 | if [ "$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 | 243 | fi |
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 |
257 | if [ "$1" = "0" ]; then |
258 | %userremove munin | |
259 | %groupremove munin | |
4bc4cd7a JR |
260 | fi |
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 |