Code

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