From 5f0e59aed4a3ca5caee1e7db384f3ae3d45b7b76 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 26 Jun 2015 07:51:46 +0200 Subject: php-doctrine-collections: backport rawhide changes --- php-doctrine-collections.spec | 97 +++++++++++++++++++++++++++++++------------ 1 file changed, 70 insertions(+), 27 deletions(-) (limited to 'php-doctrine-collections.spec') diff --git a/php-doctrine-collections.spec b/php-doctrine-collections.spec index 52fb8df..ba9f59c 100644 --- a/php-doctrine-collections.spec +++ b/php-doctrine-collections.spec @@ -1,7 +1,8 @@ +# remirepo spec file for php-doctrine-collections, from: # -# RPM spec file for php-doctrine-collections +# Fedora spec file for php-doctrine-collections # -# Copyright (c) 2013-2014 Shawn Iwinski +# Copyright (c) 2013-2015 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -11,8 +12,8 @@ %global github_owner doctrine %global github_name collections -%global github_version 1.2 -%global github_commit b99c5c46c87126201899afe88ec490a25eedd6a2 +%global github_version 1.3.0 +%global github_commit 6c1e4eef75f310ea1b3e30945e9f06e652128b8a %global composer_vendor doctrine %global composer_project collections @@ -21,11 +22,13 @@ %global php_min_ver 5.3.2 # Build using "--without tests" to disable tests -%global with_tests %{?_without_tests:0}%{!?_without_tests:1} +%global with_tests 0%{!?_without_tests:1} + +%{!?phpdir: %global phpdir %{_datadir}/php} Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 3%{?github_release}%{?dist} +Release: 2%{?github_release}%{?dist} Summary: Collections abstraction library Group: Development/Libraries @@ -35,17 +38,23 @@ Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{githu BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch +# Tests %if %{with_tests} -# For tests +## composer.json +BuildRequires: %{_bindir}/phpunit BuildRequires: php(language) >= %{php_min_ver} -BuildRequires: php-phpunit-PHPUnit -# For tests: phpcompatinfo (computed from v1.2) +## phpcompatinfo (computed from version 1.3.0) BuildRequires: php-spl +# Autoloader +BuildRequires: php-composer(symfony/class-loader) %endif +# composer.json Requires: php(language) >= %{php_min_ver} -# phpcompatinfo (computed from v1.2) +# phpcompatinfo (computed from version 1.3.0) Requires: php-spl +# Autoloader +Requires: php-composer(symfony/class-loader) # Composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} @@ -60,6 +69,30 @@ Conflicts: php-pear(pear.doctrine-project.org/DoctrineCommon) < 2.4 %prep %setup -qn %{github_name}-%{github_commit} +: Create autoloader +(cat <<'AUTOLOAD' +register(); +} + +$fedoraClassLoader->addPrefix('Doctrine\\Common\\Collections', dirname(dirname(dirname(__DIR__)))); + +return $fedoraClassLoader; +AUTOLOAD +) | tee lib/Doctrine/Common/Collections/autoload.php + %build # Empty build section, nothing required @@ -67,26 +100,25 @@ Conflicts: php-pear(pear.doctrine-project.org/DoctrineCommon) < 2.4 %install rm -rf %{buildroot} -mkdir -p %{buildroot}/%{_datadir}/php -cp -rp lib/* %{buildroot}/%{_datadir}/php/ +mkdir -p %{buildroot}%{phpdir} +cp -rp lib/* %{buildroot}%{phpdir}/ %check %if %{with_tests} -# Create autoloader -mkdir vendor -cat > vendor/autoload.php <<'AUTOLOAD' +: Create tests autoloader +(cat <<'AUTOLOAD' phpunit.xml +$fedoraClassLoader = + require_once '%{buildroot}%{phpdir}/Doctrine/Common/Collections/autoload.php'; + +$fedoraClassLoader->addPrefix('Doctrine\\Tests', __DIR__ . '/tests'); +AUTOLOAD +) | tee autoload.php -%{_bindir}/phpunit --include-path ./lib:./tests -d date.timezone="UTC" +: Run tests +%{_bindir}/phpunit -v --bootstrap autoload.php %else : Tests skipped %endif @@ -98,13 +130,24 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) -%doc LICENSE *.md composer.json -%dir %{_datadir}/php/Doctrine -%dir %{_datadir}/php/Doctrine/Common - %{_datadir}/php/Doctrine/Common/Collections +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc *.md +%doc composer.json +%dir %{phpdir}/Doctrine +%dir %{phpdir}/Doctrine/Common + %{phpdir}/Doctrine/Common/Collections %changelog +* Wed Jun 24 2015 Shawn Iwinski - 1.3.0-2 +- Added autoloader dependencies + +* Wed Jun 24 2015 Shawn Iwinski - 1.3.0-1 +- Updated to 1.3.0 (RHBZ #1211818) +- Added autoloader +- %%license usage + * Fri Jun 20 2014 Shawn Iwinski - 1.2-3 - Added php-composer(%%{composer_vendor}/%%{composer_project}) virtual provide - Added option to build without tests ("--without tests") -- cgit