From 194c599f20b22de156b07dd26761f2ebb9c92a8e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 29 Apr 2014 17:20:44 +0200 Subject: php-phpunit-FinderFacade: sources from github --- php-phpunit-FinderFacade.spec | 101 +++++++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 45 deletions(-) diff --git a/php-phpunit-FinderFacade.spec b/php-phpunit-FinderFacade.spec index 2600661..0663f2f 100644 --- a/php-phpunit-FinderFacade.spec +++ b/php-phpunit-FinderFacade.spec @@ -1,34 +1,49 @@ -%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}} -%global pear_name FinderFacade -%global channel pear.phpunit.de +# spec file for php-phpunit-FinderFacade +# +# Copyright (c) 2012-2014 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/3.0/ +# +# Please, preserve the changelog entries +# +%global gh_commit 1e396fda3449fce9df032749fa4fa2619e0347e0 +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner sebastianbergmann +%global gh_project finder-facade +%global php_home %{_datadir}/php +%global pear_name FinderFacade +%global pear_channel pear.phpunit.de +%global with_tests %{?_without_tests:0}%{!?_without_tests:1} Name: php-phpunit-FinderFacade Version: 1.1.0 -Release: 1%{?dist} +Release: 3%{?dist} Summary: Wrapper for Symfony Finder component Group: Development/Libraries License: BSD -URL: https://github.com/sebastianbergmann/finder-facade -Source0: http://pear.phpunit.de/get/%{pear_name}-%{version}.tgz +URL: https://github.com/%{gh_owner}/%{gh_project} +Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: php(language) >= 5.3.3 -BuildRequires: php-pear(PEAR) >= 1.9.4 -BuildRequires: php-channel(%{channel}) +%if %{with_tests} +BuildRequires: php-pear-PHPUnit >= 3.7.0 +BuildRequires: php-theseer-fDOMDocument >= 1.3.1 +BuildRequires: php-symfony-finder >= 2.2.0 +%endif -Requires: php-pear(PEAR) >= 1.9.4 -Requires: php-channel(%{channel}) +# From composer.json Requires: php(language) >= 5.3.3 +Requires: php-theseer-fDOMDocument >= 1.3.1 +Requires: php-symfony-finder >= 2.2.0 +# From phpcompatinfo report Requires: php-ctype Requires: php-spl -Requires: php-pear(pear.netpirates.net/fDOMDocument) >= 1.3.1 -Requires: php-pear(pear.symfony.com/Finder) >= 2.2.0 -Requires(post): %{__pear} -Requires(postun): %{__pear} -Provides: php-pear(%{channel}/%{pear_name}) = %{version} +# For compatibility with PEAR mode +Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version} %description @@ -36,55 +51,52 @@ Convenience wrapper for Symfony's Finder component. %prep -%setup -q -c +%setup -q -n %{gh_project}-%{gh_commit} -mv package.xml %{pear_name}-%{version}/%{name}.xml +rm src/autoload.php.in %build -cd %{pear_name}-%{version} # Empty build section, most likely nothing required. +# If upstream drop Autoload.php, command to generate it. +#phpab \ +# --output src/autoload.php \ +# --template src/autoload.php.in \ +# src -%install -rm -rf %{buildroot} -cd %{pear_name}-%{version} -%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{php_home}/SebastianBergmann +cp -pr src %{buildroot}%{php_home}/SebastianBergmann/FinderFacade -# Clean up unnecessary files -rm -rf %{buildroot}%{pear_metadir}/.??* -# Install XML package description -mkdir -p %{buildroot}%{pear_xmldir} -install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir} +%if %{with_tests} +%check +phpunit \ + -d date.timezone=UTC \ + --bootstrap src/autoload.php \ + tests +%endif %clean rm -rf %{buildroot} -%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 %{pear_docdir}/%{pear_name} -%{pear_xmldir}/%{name}.xml -%dir %{pear_phpdir}/SebastianBergmann -%{pear_phpdir}/SebastianBergmann/%{pear_name} +%doc ChangeLog.md README.md LICENSE composer.json +%dir %{php_home}/SebastianBergmann + %{php_home}/SebastianBergmann/FinderFacade %changelog +* Tue Apr 29 2014 Remi Collet - 1.1.0-3 +- sources from github +- run tests during build + * Thu May 30 2013 Remi Collet - 1.1.0-1 - Update to 1.1.0 @@ -99,5 +111,4 @@ fi * Thu Oct 11 2012 Remi Collet - 1.0.5-1 - Version 1.0.5 (stable) - API 1.0.1 (stable) -- Initial packaging - +- Initial packaging \ No newline at end of file -- cgit