From ce9c92e822ad176e5381f2510790280badcc62fb Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 22 Jun 2014 10:16:19 +0200 Subject: php-doctrine-cache: rawhide changes --- php-doctrine-cache.spec | 59 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 16 deletions(-) diff --git a/php-doctrine-cache.spec b/php-doctrine-cache.spec index dc33149..76107f0 100644 --- a/php-doctrine-cache.spec +++ b/php-doctrine-cache.spec @@ -1,19 +1,34 @@ -%global github_owner doctrine -%global github_name cache -%global github_version 1.3.0 -%global github_commit e16d7adf45664a50fa86f515b6d5e7f670130449 +# +# RPM spec file for php-doctrine-cache +# +# Copyright (c) 2013-2014 Shawn Iwinski +# +# License: MIT +# http://opensource.org/licenses/MIT +# +# Please preserve changelog entries +# + +%global github_owner doctrine +%global github_name cache +%global github_version 1.3.0 +%global github_commit e16d7adf45664a50fa86f515b6d5e7f670130449 + +%global composer_vendor doctrine +%global composer_project cache # "php": ">=5.3.2" -%global php_min_ver 5.3.2 +%global php_min_ver 5.3.2 # "phpunit/phpunit": ">=3.7" -%global phpunit_min_ver 3.7 +%global phpunit_min_ver 3.7 -%global summary_base Doctrine Cache +# Build using "--without tests" to disable tests +%global with_tests %{?_without_tests:0}%{!?_without_tests:1} -Name: php-%{github_owner}-%{github_name} +Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 2%{?dist} -Summary: %{summary_base} +Release: 4%{?dist} +Summary: Doctrine Cache Group: Development/Libraries License: MIT @@ -22,15 +37,17 @@ Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{githu BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch +%if %{with_tests} # For tests -BuildRequires: php(language) >= %{php_min_ver} -BuildRequires: php-pear(pear.phpunit.de/PHPUnit) >= %{phpunit_min_ver} +BuildRequires: php(language) >= %{php_min_ver} +BuildRequires: php-phpunit-PHPUnit >= %{phpunit_min_ver} # For tests: phpcompatinfo (computed from v1.3.0) BuildRequires: php-date BuildRequires: php-hash BuildRequires: php-pcre BuildRequires: php-reflection BuildRequires: php-spl +%endif Requires: php(language) >= %{php_min_ver} # phpcompatinfo (computed from git commit v1.3.0) @@ -39,6 +56,9 @@ Requires: php-hash Requires: php-pcre Requires: php-spl +# Composer +Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} + # Extracted from Doctrine Common as of version 2.4 Conflicts: php-pear(pear.doctrine-project.org/DoctrineCommon) < 2.4 @@ -57,7 +77,7 @@ Optional: %prep -%setup -q -n %{github_name}-%{github_commit} +%setup -qn %{github_name}-%{github_commit} # Remove files that will never be used find . -name '*WinCache*' -delete @@ -75,6 +95,7 @@ cp -rp lib/* %{buildroot}/%{_datadir}/php/ %check +%if %{with_tests} # Create tests' init cat > tests/Doctrine/Tests/TestInit.php <<'TESTINIT' phpunit.xml +sed 's/colors="true"/colors="false"/' phpunit.xml.dist > phpunit.xml # Skip tests requiring a server to connect to rm -f \ @@ -98,6 +117,9 @@ rm -f \ tests/Doctrine/Tests/Common/Cache/RiakCacheTest.php %{_bindir}/phpunit --include-path ./lib:./tests -d date.timezone="UTC" +%else +: Tests skipped +%endif %clean @@ -113,6 +135,11 @@ rm -rf %{buildroot} %changelog +* Fri Jun 20 2014 Shawn Iwinski - 1.3.0-4 +- Added php-composer(%%{composer_vendor}/%%{composer_project}) virtual provide +- Removed %%{summary_base} +- Added option to build without tests + * Sat Jan 11 2014 Remi Collet 1.3.0-2 - backport for remi repo -- cgit