%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}} %{!?php_extdir: %{expand: %%global php_extdir %(php-config --extension-dir)}} %global pecl_name rrd Summary: PHP Bindings for rrdtool Name: php-pecl-rrd Version: 1.0.3 Release: 1%{?dist} License: PHP Group: Development/Languages URL: http://pecl.php.net/package/rrd Source: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: php-devel >= 5.3.2 BuildRequires: rrdtool BuildRequires: rrdtool-devel >= 1.3.0 BuildRequires: php-pear Requires(post): %{__pecl} Requires(postun): %{__pecl} Conflicts: rrdtool-php Provides: php-pecl(%{pecl_name}) = %{version} Requires: php(zend-abi) = %{php_zend_api} Requires: php(api) = %{php_core_api} %{?filter_setup: %filter_provides_in %{php_extdir}/.*\.so$ %filter_setup } %description Procedural and simple OO wrapper for rrdtool - data logging and graphing system for time series data. %prep %setup -c -q %build cd %{pecl_name}-%{version} phpize %configure make %{?_smp_mflags} %install cd %{pecl_name}-%{version} rm -rf %{buildroot} make install INSTALL_ROOT=%{buildroot} # Drop in the bit of configuration mkdir -p %{buildroot}%{_sysconfdir}/php.d cat > %{buildroot}%{_sysconfdir}/php.d/%{pecl_name}.ini << 'EOF' ; Enable %{pecl_name} extension module extension=%{pecl_name}.so EOF # Install XML package description mkdir -p %{buildroot}%{pecl_xmldir} install -m 644 ../package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml %check cd %{pecl_name}-%{version} php --no-php-ini \ --define extension_dir=modules \ --define extension=%{pecl_name}.so \ --modules | grep %{pecl_name} make -C tests/data clean make -C tests/data all make test NO_INTERACTION=1 | tee rpmtests.log if grep -q "FAILED TEST" rpmtests.log; then for t in tests/*diff; do echo "*** FAILED: $(basename $t .diff)" diff -u tests/$(basename $t .diff).exp tests/$(basename $t .diff).out || : done %if 0%{?fedora} >= 14 # tests only succeed with rrdtool 1.4.x # http://pecl.php.net/bugs/22642 exit 1 %endif fi %clean rm -rf %{buildroot} %if 0%{?pecl_install:1} %post %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : %endif %if 0%{?pecl_uninstall:1} %postun if [ $1 -eq 0 ] ; then %{pecl_uninstall} %{pecl_name} >/dev/null || : fi %endif %files %defattr(-, root, root, -) %doc %{pecl_name}-%{version}/CREDITS %{pecl_name}-%{version}/LICENSE %config(noreplace) %{_sysconfdir}/php.d/%{pecl_name}.ini %{php_extdir}/%{pecl_name}.so %{pecl_xmldir}/%{name}.xml %changelog * Fri Apr 29 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.3-1 - Version 1.0.3 (stable) - API 1.0.3 (stable) - no change in sources * Wed Apr 20 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.2-1 - Version 1.0.2 (stable) - API 1.0.2 (stable) - no change in sources * Sat Apr 16 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.1-1 - Version 1.0.1 (stable) - API 1.0.1 (stable) - no change in sources - remove generated Changelog (only latest version, no real value) * Tue Apr 12 2011 Remi Collet <Fedora@FamilleCollet.com> 1.0.0-1 - Version 1.0.0 (stable) - API 1.0.0 (stable) - remove all patches merged by upstream * Sat Mar 05 2011 Remi Collet <Fedora@FamilleCollet.com> 0.10.0-2 - improved patches - implement rrd_strversion * Fri Mar 04 2011 Remi Collet <Fedora@FamilleCollet.com> 0.10.0-1 - Version 0.10.0 (stable) - API 0.10.0 (beta) - remove patches, merged upstream - add links to 5 new upstream bugs * Mon Jan 03 2011 Remi Collet <Fedora@FamilleCollet.com> 0.9.0-1 - Version 0.9.0 (beta) - API 0.9.0 (beta) - initial RPM