prepare for the release of rrdtool-1.3rc2
[rrdtool.git] / rrdtool.spec
1 %define with_python %{?_without_python: 0} %{?!_without_python: 1}
2 %define with_php %{?_without_php: 0} %{?!_without_php: 1}
3 %define with_tcl %{?_without_tcl: 0} %{?!_without_tcl: 1}
4 %define with_ruby %{?_without_ruby: 0} %{?!_without_ruby: 1}
5 %define php_rrd_svn 839
6 %define php_extdir %(php-config --extension-dir 2>/dev/null || echo %{_libdir}/php4)
7
8 Summary: Round Robin Database Tool to store and display time-series data
9 Name: rrdtool
10 Version: 1.3rc2
11 Release: 0.1%{?dist}
12 License: GPL
13 Group: Applications/Databases
14 URL: http://oss.oetiker.ch/rrdtool/
15 #Source0: http://oss.oetiker.ch/%{name}/pub/%{name}-%{version}.tar.gz
16 Source0: http://oss.oetiker.ch/rrdtool/pub/beta/rrdtool-trunk-svn-snap.tar.gz
17 Source1: php4-svn%{php_rrd_svn}.tar.gz
18 Patch0: rrdtool-1.2.13-php.patch
19 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
20 BuildRequires: gcc-c++, openssl-devel, freetype-devel
21 BuildRequires: libpng-devel, zlib-devel, cairo-devel
22 BuildRequires: perl-ExtUtils-MakeMaker
23 %if "%{?fedora}" >= "7"
24 BuildRequires: perl-devel
25 %endif
26
27 %description
28 RRD is the Acronym for Round Robin Database. RRD is a system to store and
29 display time-series data (i.e. network bandwidth, machine-room temperature,
30 server load average). It stores the data in a very compact way that will not
31 expand over time, and it presents useful graphs by processing the data to
32 enforce a certain data density. It can be used either via simple wrapper
33 scripts (from shell or Perl) or via frontends that poll network devices and
34 put a friendly user interface on it.
35
36 %package devel
37 Summary: RRDtool libraries and header files
38 Group: Development/Libraries
39 Requires: %{name} = %{version}-%{release}
40
41 %description devel
42 RRD is the Acronym for Round Robin Database. RRD is a system to store and
43 display time-series data (i.e. network bandwidth, machine-room temperature,
44 server load average). This package allow you to use directly this library.
45
46 %package doc
47 Summary: RRDtool documentation
48 Group: Documentation
49
50 %description doc
51 RRD is the Acronym for Round Robin Database. RRD is a system to store and
52 display time-series data (i.e. network bandwidth, machine-room temperature,
53 server load average). This package contains documentation on using RRD.
54
55 %package perl
56 Summary: Perl RRDtool bindings
57 Group: Development/Languages
58 Requires: %{name} = %{version}-%{release}
59 Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
60 Obsoletes: perl-%{name} < %{version}-%{release}
61 Provides: perl-%{name} = %{version}-%{release}
62
63 %description perl
64 The Perl RRDtool bindings
65
66 %if %{with_python}
67 %{!?python_sitearch: %define python_sitearch %(%{__python} -c 'from distutils import sysconfig; print sysconfig.get_python_lib(1)')}
68 # eval to 2.3 if python isn't yet present, workaround for no python in fc4 minimal buildroot
69 %{!?python_version: %define python_version %(%{__python} -c 'import sys; print sys.version.split(" ")[0]' || echo "2.3")}
70
71 %package python
72 Summary: Python RRDtool bindings
73 Group: Development/Languages
74 BuildRequires: python-devel >= 2.3
75 Requires: python >= %{python_version}
76 Requires: %{name} = %{version}-%{release}
77 Obsoletes: python-%{name} < %{version}-%{release}
78 Provides: python-%{name} = %{version}-%{release}
79
80 %description python
81 Python RRDtool bindings.
82 %endif
83
84 %ifarch ppc64
85 # php bits busted on ppc64 at the moment
86 %define with_php 0
87 %endif
88
89 %if %{with_php}
90 %package php
91 Summary: PHP RRDtool bindings
92 Group: Development/Languages
93 BuildRequires: php-devel >= 4.0
94 Requires: php >= 4.0
95 Requires: %{name} = %{version}-%{release}
96 Obsoletes: php-%{name} < %{version}-%{release}
97 Provides: php-%{name} = %{version}-%{release}
98
99 %description php
100 The %{name}-php package includes a dynamic shared object (DSO) that adds
101 RRDtool bindings to the PHP HTML-embedded scripting language.
102 %endif
103
104 %if %{with_tcl}
105 %package tcl
106 Summary: Tcl RRDtool bindings
107 Group: Development/Languages
108 BuildRequires: tcl-devel >= 8.0
109 Requires: tcl >= 8.0
110 Requires: %{name} = %{version}-%{release}
111 Obsoletes: tcl-%{name} < %{version}-%{release}
112 Provides: tcl-%{name} = %{version}-%{release}
113
114 %description tcl
115 The %{name}-tcl package includes RRDtool bindings for Tcl.
116 %endif
117
118 %if %{with_ruby}
119 %{!?ruby_sitearch: %define ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')}
120
121 %package ruby
122 Summary: Ruby RRDtool bindings
123 Group: Development/Languages
124 BuildRequires: ruby, ruby-devel
125 Requires: ruby(abi) = 1.8
126 Requires: %{name} = %{version}-%{release}
127
128 %description ruby
129 The %{name}-ruby package includes RRDtool bindings for Ruby.
130 %endif
131
132 %prep
133 #setup -q
134 %setup -q -n %{name}-%{version}
135 %setup -q -T -D -a 1
136 # Patch based on http://oss.oetiker.ch/rrdtool/pub/contrib/php_rrdtool.tgz
137 %if %{with_php}
138 %patch0 -p0 -b .php
139 %{__perl} -pi -e 's|../config.h|../rrd_config.h|g' php4/rrdtool.c
140 %endif
141
142 # Fix to find correct python dir on lib64
143 %{__perl} -pi -e 's|get_python_lib\(0,0,prefix|get_python_lib\(1,0,prefix|g' \
144     configure
145
146 # Most edits shouldn't be necessary when using --libdir, but
147 # w/o, some introduce hardcoded rpaths where they shouldn't,
148 %{__perl} -pi.orig -e 's|/lib\b|/%{_lib}|g' \
149     configure Makefile.in php4/configure php4/ltconfig*
150
151 %build
152 intltoolize --automake -c -f
153 aclocal
154 autoheader
155 autoconf
156 automake -a -c -f
157 %configure \
158     --with-perl-options='INSTALLDIRS="vendor"' \
159 %if %{with_tcl}
160     --enable-tcl-site \
161     --with-tcllib=%{_libdir} \
162 %else
163     --disable-tcl \
164 %endif
165 %if %{with_python}
166     --enable-python \
167 %else
168     --disable-python \
169 %endif
170 %if %{with_ruby}
171     --enable-ruby \
172 %endif
173     --disable-static \
174     --with-pic
175
176 # Fix another rpath issue
177 %{__perl} -pi.orig -e 's|-Wl,--rpath -Wl,\$rp||g' \
178     bindings/perl-shared/Makefile.PL
179
180 # Force RRDp bits where we want 'em, not sure yet why the
181 # --with-perl-options and --libdir don't take
182 pushd bindings/perl-piped/
183 %{__perl} Makefile.PL INSTALLDIRS=vendor
184 %{__perl} -pi.orig -e 's|/lib/perl|/%{_lib}/perl|g' Makefile
185 popd
186
187 %{__make} %{?_smp_mflags}
188
189 # Build the php module, the tmp install is required
190 %if %{with_php}
191 %define rrdtmp %{_tmppath}/%{name}-%{version}-tmpinstall
192 %{__make} install DESTDIR="%{rrdtmp}"
193 pushd php4/
194 %configure \
195     --with-rrdtool="%{rrdtmp}%{_prefix}" \
196     --disable-static
197 %{__make} %{?_smp_mflags}
198 popd
199 %{__rm} -rf %{rrdtmp}
200 %endif
201
202 # Fix @perl@ and @PERL@
203 find examples/ -type f \
204     -exec %{__perl} -pi -e 's|^#! \@perl\@|#!%{__perl}|gi' {} \;
205 find examples/ -name "*.pl" \
206     -exec %{__perl} -pi -e 's|\015||gi' {} \;
207
208 %install
209 rm -rf $RPM_BUILD_ROOT
210 make DESTDIR="$RPM_BUILD_ROOT" install
211
212 # Install the php module
213 %if %{with_php}
214 %{__install} -D -m0755 php4/modules/rrdtool.so \
215     %{buildroot}%{php_extdir}/rrdtool.so
216 # Clean up the examples for inclusion as docs
217 %{__rm} -rf php4/examples/.svn
218 # Put the php config bit into place
219 %{__mkdir_p} %{buildroot}%{_sysconfdir}/php.d
220 %{__cat} << __EOF__ > %{buildroot}%{_sysconfdir}/php.d/rrdtool.ini
221 ; Enable rrdtool extension module
222 extension=rrdtool.so
223 __EOF__
224 %endif
225
226 # Pesky RRDp.pm...
227 %{__mv} $RPM_BUILD_ROOT%{perl_vendorarch}/../RRDp.pm $RPM_BUILD_ROOT%{perl_vendorarch}/
228
229 # We only want .txt and .html files for the main documentation
230 %{__mkdir_p} doc2/html doc2/txt
231 %{__cp} -a doc/*.txt doc2/txt/
232 %{__cp} -a doc/*.html doc2/html/
233
234 # Put perl docs in perl package
235 %{__mkdir_p} doc3/html
236 %{__mv} doc2/html/RRD*.html doc3/html/
237
238 # Clean up the examples
239 %{__rm} -f examples/Makefile* examples/*.in
240
241 # This is so rpm doesn't pick up perl module dependencies automatically
242 find examples/ -type f -exec chmod 0644 {} \;
243
244 # Clean up the buildroot
245 %{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{version}/{txt,html}/ \
246         $RPM_BUILD_ROOT%{perl_vendorarch}/ntmake.pl \
247         $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod \
248         $RPM_BUILD_ROOT%{_datadir}/%{name}/examples \
249         $RPM_BUILD_ROOT%{perl_vendorarch}/auto/*/{.packlist,*.bs}
250
251 %clean
252 %{__rm} -rf $RPM_BUILD_ROOT
253
254 %post -p /sbin/ldconfig
255
256 %postun -p /sbin/ldconfig
257
258 %files
259 %defattr(-,root,root,-)
260 %{_bindir}/*
261 %{_libdir}/*.so.*
262 %{_datadir}/%{name}
263 %{_mandir}/man1/*
264
265 %files devel
266 %defattr(-,root,root,-)
267 %{_includedir}/*.h
268 %exclude %{_libdir}/*.la
269 %{_libdir}/*.so
270
271 %files doc
272 %defattr(-,root,root,-)
273 %doc CHANGES CONTRIBUTORS COPYING COPYRIGHT README TODO NEWS THREADS
274 %doc examples doc2/html doc2/txt
275
276 %files perl
277 %defattr(-,root,root,-)
278 %doc doc3/html
279 %{_mandir}/man3/*
280 %{perl_vendorarch}/*.pm
281 %attr(0755,root,root) %{perl_vendorarch}/auto/RRDs/
282
283 %if %{with_python}
284 %files python
285 %defattr(-,root,root,-)
286 %doc bindings/python/AUTHORS bindings/python/COPYING bindings/python/README
287 %{python_sitearch}/rrdtoolmodule.so
288 %endif
289
290 %if %{with_php}
291 %files php
292 %defattr(-,root,root,0755)
293 %doc php4/examples php4/README
294 %config(noreplace) %{_sysconfdir}/php.d/rrdtool.ini
295 %{php_extdir}/rrdtool.so
296 %endif
297
298 %if %{with_tcl}
299 %files tcl
300 %defattr(-,root,root,-)
301 %doc bindings/tcl/README
302 %{_libdir}/tclrrd*.so
303 %{_libdir}/rrdtool/*.tcl
304 %endif
305
306 %if %{with_ruby}
307 %files ruby
308 %defattr(-,root,root,-)
309 %doc bindings/ruby/README
310 %{ruby_sitearch}/RRD.so
311 %endif
312
313 %changelog
314 * Fri Jun 15 2007 Jarod Wilson <jwilson@redhat.com> 1.2.999050724000-0.1
315 - Update for rrdtool pre-1.3 snapshot
316
317 * Mon May 21 2007 Jarod Wilson <jwilson@redhat.com> 1.2.23-5
318 - BR: ruby so %%ruby_sitearch gets set
319
320 * Mon May 21 2007 Jarod Wilson <jwilson@redhat.com> 1.2.23-4
321 - Build ruby bindings
322
323 * Thu May 03 2007 Jarod Wilson <jwilson@redhat.com> 1.2.23-3
324 - Disable php bits on ppc64 for now, they fail to build
325
326 * Thu May 03 2007 Jarod Wilson <jwilson@redhat.com> 1.2.23-2
327 - Add BR: perl-devel for Fedora 7 and later
328
329 * Tue May 01 2007 Jarod Wilson <jwilson@redhat.com> 1.2.23-1
330 - New upstream release
331
332 * Tue May 01 2007 Jarod Wilson <jwilson@redhat.com> 1.2.21-1
333 - New upstream release
334
335 * Wed Apr 25 2007 Jarod Wilson <jwilson@redhat.com> 1.2.19-2
336 - Define %%python_version *before* its needed (#237826)
337
338 * Mon Apr 09 2007 Jarod Wilson <jwilson@redhat.com> 1.2.19-1
339 - New upstream release
340
341 * Tue Jan 23 2007 Jarod Wilson <jwilson@redhat.com> 1.2.18-1
342 - New upstream release
343
344 * Mon Jan 22 2007 Jarod Wilson <jwilson@redhat.com> 1.2.17-1
345 - New upstream release
346
347 * Tue Jan 02 2007 Jarod Wilson <jwilson@redhat.com> 1.2.15-9
348 - Fix crash with long error strings (upstream
349   changesets 929 and 935)
350
351 * Thu Dec 14 2006 Jarod Wilson <jwilson@redhat.com> 1.2.15-8
352 - Fix for log grid memory leak (#201241)
353
354 * Tue Dec 12 2006 Jarod Wilson <jwilson@redhat.com> 1.2.15-7
355 - Rebuild for python 2.5
356
357 * Tue Nov 14 2006 Jarod Wilson <jwilson@redhat.com> 1.2.15-6
358 - Conditionalize python, php and tcl bits (Resolves #203275)
359
360 * Wed Oct 25 2006 Jarod Wilson <jwilson@redhat.com> 1.2.15-5
361 - Add tcl sub-package (#203275)
362
363 * Tue Sep 05 2006 Jarod Wilson <jwilson@redhat.com> 1.2.15-4
364 - Rebuild for new glibc
365
366 * Wed Aug 02 2006 Jarod Wilson <jwilson@redhat.com> 1.2.15-3
367 - One more addition to initrrdtool patch, to fully revert
368   and correct upstream changeset 839
369 - Fix for no python in minimal fc4 buildroots
370
371 * Tue Aug  1 2006 Mihai Ibanescu <misa@redhat.com> 1.2.15-2
372 - Fixed rrdtool-python to import the module properly (patch
373   rrdtool-1.2.15-initrrdtool.patch)
374
375 * Mon Jul 17 2006 Jarod Wilson <jwilson@redhat.com> 1.2.15-1
376 - Update to 1.2.15
377 - Minor spec cleanups
378
379 * Sat Jun 24 2006 Jarod Wilson <jwilson@redhat.com> 1.2.13-7
380 - Fix up Obsoletes
381
382 * Mon Jun 19 2006 Jarod Wilson <jwilson@redhat.com> 1.2.13-6
383 - Flip perl, php and python sub-package names around to 
384   conform with general practices
385
386 * Sat Jun 10 2006 Jarod Wilson <jwilson@redhat.com> 1.2.13-5
387 - Minor fixes to make package own created directories
388
389 * Wed Jun 07 2006 Jarod Wilson <jwilson@redhat.com> 1.2.13-4
390 - Add php bits back into the mix
391
392 * Mon Jun 05 2006 Jarod Wilson <jwilson@redhat.com> 1.2.13-3
393 - Merge spec fixes from bz 185909
394
395 * Sun Jun 04 2006 Jarod Wilson <jwilson@redhat.com> 1.2.13-2
396 - Remove explicit perl dep, version grabbing using rpm during
397   rpmbuild not guaranteed to work (fails on ppc in plague),
398   and auto-gen perl deps are sufficient
399
400 * Sat Jun 03 2006 Jarod Wilson <jwilson@redhat.com> 1.2.13-1
401 - Update to release 1.2.13
402 - Merge spec changes from dag, atrpms and mdk builds
403 - Additional hacktastic contortions for lib64 & rpath messiness
404 - Add missing post/postun ldconfig
405 - Fix a bunch of rpmlint errors
406 - Disable static libs, per FE guidelines
407 - Split off docs
408
409 * Wed Apr 19 2006 Chris Ricker <kaboom@oobleck.net> 1.2.12-1
410 - Rev to 1.2
411
412 * Fri May 20 2005 Matthias Saou <http://freshrpms.net/> 1.0.49-5
413 - Include patch from Michael to fix perl module compilation on FC4 (#156242).
414
415 * Fri May 20 2005 Matthias Saou <http://freshrpms.net/> 1.0.49-4
416 - Fix for the php module patch (Joe Pruett, Dag Wieers), #156716.
417 - Update source URL to new location since 1.2 is now the default stable.
418 - Don't (yet) update to 1.0.50, as it introduces some changes in the perl
419   modules install.
420
421 * Mon Jan 31 2005 Matthias Saou <http://freshrpms.net/> 1.0.49-3
422 - Put perl modules in vendor_perl and not site_perl. #146513
423
424 * Thu Jan 13 2005 Matthias Saou <http://freshrpms.net/> 1.0.49-2
425 - Minor cleanups.
426
427 * Thu Aug 25 2004 Dag Wieers <dag@wieers.com> - 1.0.49-1
428 - Updated to release 1.0.49.
429
430 * Wed Aug 25 2004 Dag Wieers <dag@wieers.com> - 1.0.48-3
431 - Fixes for x86_64. (Garrick Staples)
432
433 * Fri Jul  2 2004 Matthias Saou <http://freshrpms.net/> 1.0.48-3
434 - Actually apply the patch for fixing the php module, doh!
435
436 * Thu May 27 2004 Matthias Saou <http://freshrpms.net/> 1.0.48-2
437 - Added php.d config entry to load the module once installed.
438
439 * Thu May 13 2004 Dag Wieers <dag@wieers.com> - 1.0.48-1
440 - Updated to release 1.0.48.
441
442 * Tue Apr 06 2004 Dag Wieers <dag@wieers.com> - 1.0.47-1
443 - Updated to release 1.0.47.
444
445 * Thu Mar  4 2004 Matthias Saou <http://freshrpms.net/> 1.0.46-2
446 - Change the strict dependency on perl to fix problem with the recent
447   update.
448
449 * Mon Jan  5 2004 Matthias Saou <http://freshrpms.net/> 1.0.46-1
450 - Update to 1.0.46.
451 - Use system libpng and zlib instead of bundled ones.
452 - Added php-rrdtool sub-package for the php4 module.
453
454 * Fri Dec  5 2003 Matthias Saou <http://freshrpms.net/> 1.0.45-4
455 - Added epoch to the perl dependency to work with rpm > 4.2.
456 - Fixed the %% escaping in the perl dep.
457
458 * Mon Nov 17 2003 Matthias Saou <http://freshrpms.net/> 1.0.45-2
459 - Rebuild for Fedora Core 1.
460
461 * Sun Aug  3 2003 Matthias Saou <http://freshrpms.net/>
462 - Update to 1.0.45.
463
464 * Wed Apr 16 2003 Matthias Saou <http://freshrpms.net/>
465 - Update to 1.0.42.
466
467 * Mon Mar 31 2003 Matthias Saou <http://freshrpms.net/>
468 - Rebuilt for Red Hat Linux 9.
469
470 * Wed Mar  5 2003 Matthias Saou <http://freshrpms.net/>
471 - Added explicit perl version dependency.
472
473 * Sun Feb 23 2003 Matthias Saou <http://freshrpms.net/>
474 - Update to 1.0.41.
475
476 * Fri Jan 31 2003 Matthias Saou <http://freshrpms.net/>
477 - Update to 1.0.40.
478 - Spec file cleanup.
479
480 * Fri Jul 05 2002 Henri Gomez <hgomez@users.sourceforge.net>
481 - 1.0.39
482
483 * Mon Jun 03 2002 Henri Gomez <hgomez@users.sourceforge.net>
484 - 1.0.38
485
486 * Fri Apr 19 2002 Henri Gomez <hgomez@users.sourceforge.net>
487 - 1.0.37
488
489 * Tue Mar 12 2002 Henri Gomez <hgomez@users.sourceforge.net>
490 - 1.0.34
491 - rrdtools include zlib 1.1.4 which fix vulnerabilities in 1.1.3
492