%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}} %global pear_name DbUnit %global channel pear.phpunit.de Name: php-phpunit-DbUnit Version: 1.0.1 Release: 1%{?dist} Summary: DbUnit port for PHP/PHPUnit Group: Development/Libraries License: BSD URL: https://github.com/sebastianbergmann/dbunit Source0: http://pear.phpunit.de/get/%{pear_name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: php-pear(PEAR) >= 1.9.0 BuildRequires: php-channel(%{channel}) Requires(post): %{__pear} Requires(postun): %{__pear} Requires: php-common >= 5.2.7 Requires: php-pear(%{channel}/PHPUnit) >= 3.5.0 Requires: php-pear(pear.symfony-project.com/YAML) >= 1.0.2 Provides: php-pear(%{channel}/%{pear_name}) = %{version} %description DbUnit port for PHP/PHPUnit %prep %setup -q -c # Create a "localized" php.ini to avoid build warning cp /etc/php.ini . echo "date.timezone=UTC" >>php.ini # Create links for standard RPM docdir (to standard PEAR docdir) ln -s %{pear_docdir}/%{pear_name}/LICENSE LICENSE ln -s %{pear_docdir}/%{pear_name}/ChangeLog.markdown CHANGELOG ln -s %{pear_docdir}/%{pear_name}/Samples Samples cd %{pear_name}-%{version} # package.xml is V2 - hack to lower PEAR dependency %{_bindir}/php <<EOF <?php \$xml = simplexml_load_file("../package.xml"); \$xml->dependencies->required->pearinstaller->min="1.9.0"; file_put_contents("%{name}.xml",\$xml->asXML()); EOF %build cd %{pear_name}-%{version} # Empty build section, most likely nothing required. %install rm -rf $RPM_BUILD_ROOT cd %{pear_name}-%{version} PHPRC=../php.ini %{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{name}.xml # Clean up unnecessary files rm -rf $RPM_BUILD_ROOT%{pear_phpdir}/.??* # Install XML package description mkdir -p $RPM_BUILD_ROOT%{pear_xmldir} install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pear_xmldir} %clean rm -rf $RPM_BUILD_ROOT %post %{__pear} install --nodeps --soft --force --register-only \ %{pear_xmldir}/%{name}.xml >/dev/null || : %postun if [ $1 -eq 0 ] ; then %{__pear} uninstall --nodeps --ignore-errors --register-only \ %{channel}/%{pear_name} >/dev/null || : fi %files %defattr(-,root,root,-) %doc LICENSE CHANGELOG Samples %doc %{pear_docdir}/%{pear_name} %{pear_xmldir}/%{name}.xml %{pear_phpdir}/PHPUnit/Extensions/Database %{_bindir}/dbunit %changelog * Wed Feb 16 2011 Remi Collet <Fedora@famillecollet.com> - 1.0.1-1 - Version 1.0.1 (stable) - API 1.0.0 (stable) * Fri Nov 05 2010 Remi Collet <Fedora@famillecollet.com> - 1.0.0-2 - lower PEAR dependency to allow el6 build - fix URL * Sun Sep 26 2010 Remi Collet <Fedora@famillecollet.com> - 1.0.0-1 - initial generated spec + clean