Hi. I fixed the rrdtool package, patches applied to this mail.
Chears. -- Regards // Oden Eriksson, Deserve-IT.com
rrdtool-1.0.40-annoyance_be_gone.patch.bz2
Description: BZip2 compressed data
--- rrdtool.spec 2003-01-14 16:18:00.000000000 +0100
+++ rrdtool.spec.oden 2003-01-15 21:03:00.000000000 +0100
@@ -1,26 +1,38 @@
+# OE: we have to use at least rversion becasue of
+# new PHP_BUILD policies
+%define rname rrdtool
+%define rversion 1.0.40
+%define release 2mdk
+
%define major 0
-%define libname lib%name%major
+%define libname lib%{rname}%{major}
+
+%define phpsource %{_prefix}/src/php-devel
+%{expand:%(cat /usr/src/php-devel/PHP_BUILD||(echo -e "error: failed build dependencies:\n php-devel >= 430 (4.3.0) is needed by this package." >/dev/stderr;kill -2 $PPID))}
-%{expand:%%define php_version %(php -v 2>/dev/null)}
-%define phpdir %{_libdir}/php
-%define phpsource /usr/src/php-devel
-
-Name: rrdtool
-Summary: RRDtool - round robin database
-Version: 1.0.40
-Release: 1mdk
+%define realname RRDtool
+%define modname %{rname}
+%define dirname %{modname}
+%define soname %{modname}.so
+%define inifile 61_%{modname}.ini
+
+Name: %{rname}
+Summary: %{realname} - round robin database
+Version: %{rversion}
+Release: %{release}
License: GPL
Group: Networking/Other
-Source: http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/pub/%{name}-%{version}.tar.bz2
-Patch: rrdtool.doc.patch.bz2
+Source: http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/pub/%{rname}-%{rversion}.tar.bz2
+Patch0: rrdtool.doc.patch.bz2
Patch1: rrdtool-1.0.38-zlib-libpng.patch.bz2
-Buildroot: %{_tmppath}rrdtool-root
+Patch2: rrdtool-1.0.40-annoyance_be_gone.patch.bz2
Url: http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/
Requires: libpng >= 1.0.3, zlib >= 1.1.3
BuildRequires: libpng-devel >= 1.0.3, perl-devel libgd-devel, zlib-devel
-Prereq: php-common = %{php_version}
-Requires: php-common = %{php_version}
-BuildRequires: php-devel = %{php_version}
+Requires: libphp_common%{libversion}
+Requires: php%{libversion}
+BuildRequires: php%{libversion}-devel
+Buildroot: %{_tmppath}/%{rname}-%{rversion}-root
%description
RRD is the Acronym for Round Robin Database. RRD is a system to store and
@@ -31,47 +43,52 @@
scripts (from shell or Perl) or via frontends that poll network devices and
put a friendly user interface on it.
-%package -n %libname
-
-Summary: RRDtool - round robin database static libraries and headers
-Group: System/Libraries
+%package -n %{libname}
+Summary: %{realname} - round robin database static libraries and headers
+Version: %{rversion}
+Group: System/Libraries
-%description -n %libname
+%description -n %{libname}
RRD is the Acronym for Round Robin Database. RRD is a system to store and
display time-series data (i.e. network bandwidth, machine-room temperature,
server load average). This package allow you to use directly this library
+%package -n %{libname}-devel
+Summary: %{realname} - round robin database static libraries and headers
+Version: %{rversion}
+Group: Development/Other
+Requires: %{libname} = %{version}
+Requires: libgd-devel
+Provides: librrdtool-devel
+Obsoletes: rrdtool-devel
+Provides: rrdtool-devel
-%package -n %libname-devel
-Summary: RRDtool - round robin database static libraries and headers
-Group: Development/Other
-Requires: %libname = %version
-Requires: libgd-devel
-Provides: librrdtool-devel
-Obsoletes: rrdtool-devel
-Provides: rrdtool-devel
-
-%description -n %libname-devel
+%description -n %{libname}-devel
RRD is the Acronym for Round Robin Database. RRD is a system to store and
display time-series data (i.e. network bandwidth, machine-room temperature,
server load average). This package allow you to use directly this library.
-%package -n php-rrdtool
-Summary: A RRDTool exstension for PHP4
-Version: %{version}
-Release: %{release}
-Group: System/Servers
-Requires: %libname = %version
-Obsoletes: php-rrdtool
-Provides: php-rrdtool
-
-%description -n php-rrdtool
-A RRDTool exstension for PHP4
+%package -n php-%{modname}
+Summary: The %{realname} module for PHP
+Version: %{rversion}
+Group: System/Servers
+Requires: %{libname} = %{version}
+Requires: libphp_common%{libversion}
+Requires: php%{libversion}
+Provides: ADVXpackage
+
+%description -n php-%{modname}
+The %{rname} package is a dynamic shared object (DSO) that adds
+%{realname} support to PHP.
+PHP is an HTML-embedded scripting language.
+If you need %{realname} support for PHP applications,
+you will need to install this package in addition to the php package.
%prep
%setup -q
%patch0 -p1 -b .doc
%patch1 -p1 -b .systemlibs
+%patch2 -p1
%build
#CFLAGS="$RPM_OPT_FLAGS" LIBS="-lm -lz -lpng"
@@ -86,81 +103,94 @@
# build the php-rrdtool php extension addon
pushd contrib/php4
- %{phpsource}/buildext rrdtool "rrdtool.c" "-L../../src/.libs -I../../src -lrrd" "-DHAVE_RRDTOOL -DCOMPILE_DL_RRDTOOL"
+ %{phpsource}/buildext %{modname} "%{modname}.c" \
+ "-L../../src/.libs -I../../src -lrrd" "-DHAVE_RRDTOOL -DCOMPILE_DL_RRDTOOL"
popd
%install
-rm -rf $RPM_BUILD_ROOT
-%makeinstall
+[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
+
+%{makeinstall}
# equivalent of "make site-perl-install" except for the PREFIX
# "make site-perl-install" is not done by "make install"
-make -C perl-piped install PREFIX=$RPM_BUILD_ROOT%{_prefix}
-make -C perl-shared install PREFIX=$RPM_BUILD_ROOT%{_prefix}
+make -C perl-piped install PREFIX=%{buildroot}%{_prefix}
+make -C perl-shared install PREFIX=%{buildroot}%{_prefix}
+
+install -d %{buildroot}%{_sbindir}
# now create include and files
-install -d $RPM_BUILD_ROOT/usr/include
-install -m644 src/rrd*.h $RPM_BUILD_ROOT/usr/include
-install -m755 contrib/log2rrd/log2rrd.pl $RPM_BUILD_ROOT/usr/bin
+install -d %{buildroot}%{_includedir}
+install -m644 src/rrd*.h %{buildroot}%{_includedir}/
+install -m755 contrib/log2rrd/log2rrd.pl %{buildroot}%{_sbindir}/
#remove .in/.am files
find -name "*.in" | xargs rm -f
find -name "*.am" | xargs rm -f
#moving the docs in the right place
-mkdir -p %{_tmppath}rrdtool-root/%{_docdir}/%{name}-%{version}/{pod,txt}
-cp -a %{_tmppath}rrdtool-root/%{_docdir}/*txt %{_tmppath}rrdtool-root/%{_docdir}/%{name}-%{version}/txt
-cp -a %{_tmppath}rrdtool-root/%{_docdir}/*pod %{_tmppath}rrdtool-root/%{_docdir}/%{name}-%{version}/pod
-cp -a %{_tmppath}rrdtool-root/%{_docdir}/html %{_tmppath}rrdtool-root/%{_docdir}/%{name}-%{version}
-cp -a %{_tmppath}rrdtool-root/%{_prefix}/examples/* %{_tmppath}rrdtool-root/%{_docdir}/%{name}-%{version}
-cp -a %{_tmppath}rrdtool-root/%{_prefix}/contrib/* %{_tmppath}rrdtool-root/%{_docdir}/%{name}-%{version}
+install -d %{buildroot}%{_docdir}/%{rname}-%{rversion}/{pod,txt}
-#removing things installed in the wrong place
-rm -rf %{_tmppath}rrdtool-root/%{_docdir}/*txt
-rm -rf %{_tmppath}rrdtool-root/%{_docdir}/*pod
-rm -rf %{_tmppath}rrdtool-root/%{_docdir}/html
-rm -rf %{_tmppath}rrdtool-root/%{_prefix}/examples/*
-rm -rf %{_tmppath}rrdtool-root/%{_prefix}/contrib/*
-rm -rf %{_tmppath}rrdtool-root/%{_prefix}/lib/perl/*.pm
-rm -rf %{_tmppath}rrdtool-root/%{_prefix}/lib/perl/auto/RRDs/RRDs*
+mv %{buildroot}%{_docdir}/*txt %{buildroot}/%{_docdir}/%{rname}-%{rversion}/txt/
+mv %{buildroot}%{_docdir}/*pod %{buildroot}/%{_docdir}/%{rname}-%{rversion}/pod/
+mv %{buildroot}%{_docdir}/html %{buildroot}/%{_docdir}/%{rname}-%{rversion}/
+mv %{buildroot}%{_prefix}/examples/* %{buildroot}/%{_docdir}/%{rname}-%{rversion}/
+mv %{buildroot}%{_prefix}/contrib/* %{buildroot}/%{_docdir}/%{rname}-%{rversion}/
+#removing things installed in the wrong place
+rm -rf %{buildroot}/%{_prefix}/lib/perl/*.pm
+rm -rf %{buildroot}/%{_prefix}/lib/perl/auto/RRDs/RRDs*
-install -d %{buildroot}%{phpdir}/extensions
-install -m755 contrib/php4/rrdtool.so %{buildroot}%{phpdir}/extensions/
+# install the php package
+mkdir -p %{buildroot}%{phpdir}/extensions
+mkdir -p %{buildroot}%{_sysconfdir}/php
+install -m755 contrib/php4/%{soname} %{buildroot}%{phpdir}/extensions/
+
+cat > README.%{modname} <<EOF
+The %{rname} package contains a dynamic shared object (DSO) for PHP.
+To activate it, make sure a file /etc/php/%{inifile} is present and
+contains the line 'extension = %{soname}'.
+EOF
+
+cat > %{buildroot}%{_sysconfdir}/php/%{inifile} << EOF
+extension = %{soname}
+EOF
%clean
-rm -rf $RPM_BUILD_ROOT
+[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
-%post -n %libname -p /sbin/ldconfig
+%post -n %{libname} -p /sbin/ldconfig
-%postun -n %libname -p /sbin/ldconfig
+%postun -n %{libname} -p /sbin/ldconfig
%files
-%defattr(0755,root,root)
-%{_bindir}/*
-%{perl_vendorarch}/auto/*
-%{perl_vendorarch}/*.pm
-%{perl_vendorarch}/*.pl
-%{perl_vendorlib}/*.pm
-%doc %{_docdir}/%{name}*/*
+%defattr(0644,root,root)
+%doc %{_docdir}/%{rname}*/*
+%attr(0755,root,root) %{_bindir}/*
+%attr(0755,root,root) %{_sbindir}/*
+%attr(0755,root,root) %{perl_vendorarch}/auto/*
+%attr(0755,root,root) %{perl_vendorarch}/*.pm
+%attr(0755,root,root) %{perl_vendorarch}/*.pl
+%attr(0755,root,root) %{perl_vendorlib}/*.pm
%attr(0644,root,root) %{_mandir}/man1/*
%attr(0644,root,root) %{_mandir}/man3pm/*
-%files -n %libname
-%defattr(0755,root,root)
+%files -n %{libname}
+%defattr(0644,root,root)
%doc COPYING
-%_libdir/*.so.*
+%attr(0755,root,root) %{_libdir}/*.so.*
-%files -n %libname-devel
-%defattr (-,root,root)
+%files -n %{libname}-devel
+%defattr(0644,root,root)
%doc COPYING
%attr(0644,root,root) %{_libdir}/*.a
%attr(0644,root,root) %{_libdir}/*.la
%attr(0644,root,root) %{_includedir}/*.h
-%_libdir/*.so
+%attr(0755,root,root) %{_libdir}/*.so
-%files -n php-rrdtool
-%defattr(-,root,root)
+%files -n php-%{modname}
+%defattr(0644,root,root)
+%doc README.%{modname}
%doc contrib/php4/USAGE
%doc contrib/php4/README
%doc contrib/php4/INSTALL
@@ -169,9 +199,15 @@
%doc contrib/php4/examples/rrd_create.php
%doc contrib/php4/examples/rrd_fetch.php
%doc contrib/php4/examples/rrd_last.php
-%{phpdir}/extensions/rrdtool.so
+%config(noreplace) %{_sysconfdir}/php/%{inifile}
+%{phpdir}/extensions/%{soname}
%changelog
+* Wed Jan 15 2003 Oden Eriksson <[EMAIL PROTECTED]> 1.0.40-2mdk
+- follow the new PHP spec file design (sorta)
+- added P2
+- misc spec file fixes
+
* Tue Jan 14 2003 Lenny Cartier <[EMAIL PROTECTED]> 1.0.40-1mdk
- 1.0.40
- remove patch2 now merged upstream
@@ -495,3 +531,4 @@
* Thu Jul 15 1999 Tobi
- Released first 'stable' version of RRDtool after almost 18 Month of 'development'
+
