summaryrefslogtreecommitdiffstats
path: root/php-doctrine-collections.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-doctrine-collections.spec')
-rw-r--r--php-doctrine-collections.spec92
1 files changed, 48 insertions, 44 deletions
diff --git a/php-doctrine-collections.spec b/php-doctrine-collections.spec
index 36cf889..8164b44 100644
--- a/php-doctrine-collections.spec
+++ b/php-doctrine-collections.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-doctrine-collections
#
-# Copyright (c) 2013-2015 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2013-2017 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,14 +12,14 @@
%global github_owner doctrine
%global github_name collections
-%global github_version 1.3.0
-%global github_commit 6c1e4eef75f310ea1b3e30945e9f06e652128b8a
+%global github_version 1.4.0
+%global github_commit 1a4fb7e902202c33cce8c55989b945612943c2ba
%global composer_vendor doctrine
%global composer_project collections
-# "php": ">=5.3.2"
-%global php_min_ver 5.3.2
+# "php": "^5.6 || ^7.0"
+%global php_min_ver 5.6
# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}
@@ -28,13 +28,17 @@
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 3%{?github_release}%{?dist}
+Release: 1%{?github_release}%{?dist}
Summary: Collections abstraction library
Group: Development/Libraries
License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
-Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
+
+# GitHub export does not include tests.
+# Run php-doctrine-collections-get-source.sh to create full source.
+Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
+Source1: %{name}-get-source.sh
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -43,18 +47,20 @@ BuildArch: noarch
## composer.json
BuildRequires: %{_bindir}/phpunit
BuildRequires: php(language) >= %{php_min_ver}
-## phpcompatinfo (computed from version 1.3.0)
+## phpcompatinfo (computed from version 1.4.0)
+BuildRequires: php-pcre
BuildRequires: php-spl
# Autoloader
-BuildRequires: php-composer(symfony/class-loader)
+BuildRequires: php-composer(fedora/autoloader)
%endif
# composer.json
Requires: php(language) >= %{php_min_ver}
-# phpcompatinfo (computed from version 1.3.0)
+# phpcompatinfo (computed from version 1.4.0)
+Requires: php-pcre
Requires: php-spl
# Autoloader
-Requires: php-composer(symfony/class-loader)
+Requires: php-composer(fedora/autoloader)
# Composer
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
@@ -65,37 +71,25 @@ Conflicts: php-pear(pear.doctrine-project.org/DoctrineCommon) < 2.4
%description
%{summary}.
+Autoloader: %{phpdir}/Doctrine/Common/Collections/autoload.php
+
%prep
%setup -qn %{github_name}-%{github_commit}
+
+%build
: Create autoloader
-(cat <<'AUTOLOAD'
+cat <<'AUTOLOAD' | tee lib/Doctrine/Common/Collections/autoload.php
<?php
/**
- * Autoloader created by %{name}-%{version}-%{release}
- *
- * @return \Symfony\Component\ClassLoader\ClassLoader
+ * Autoloader for %{name} and its' dependencies
+ * (created by %{name}-%{version}-%{release}).
*/
+require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
-if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) {
- if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) {
- require_once '%{phpdir}/Symfony/Component/ClassLoader/ClassLoader.php';
- }
-
- $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
- $fedoraClassLoader->register();
-}
-
-$fedoraClassLoader->addPrefix('Doctrine\\Common\\Collections\\', dirname(dirname(dirname(__DIR__))));
-
-return $fedoraClassLoader;
+\Fedora\Autoloader\Autoload::addPsr4('Doctrine\\Common\\Collections\\', __DIR__);
AUTOLOAD
-) | tee lib/Doctrine/Common/Collections/autoload.php
-
-
-%build
-# Empty build section, nothing required
%install
@@ -106,19 +100,25 @@ cp -rp lib/* %{buildroot}%{phpdir}/
%check
%if %{with_tests}
-: Create tests autoloader
-(cat <<'AUTOLOAD'
+: Create tests bootstrap
+cat <<'BOOTSTRAP' | tee bootstrap.php
<?php
-
-$fedoraClassLoader =
- require_once '%{buildroot}%{phpdir}/Doctrine/Common/Collections/autoload.php';
-
-$fedoraClassLoader->addPrefix('Doctrine\\Tests', __DIR__ . '/tests');
-AUTOLOAD
-) | tee autoload.php
-
-: Run tests
-%{_bindir}/phpunit -v --bootstrap autoload.php
+require_once '%{buildroot}%{phpdir}/Doctrine/Common/Collections/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('Doctrine\\Tests\\', __DIR__.'/tests/Doctrine/Tests');
+BOOTSTRAP
+
+: Upstream tests
+%{_bindir}/phpunit --verbose --bootstrap bootstrap.php
+
+: Upstream tests with SCLs if available
+SCL_RETURN_CODE=0
+for SCL in php70 php71; do
+ if which $SCL; then
+ $SCL %{_bindir}/phpunit --verbose --bootstrap bootstrap.php \
+ || SCL_RETURN_CODE=1
+ fi
+done
+exit $SCL_RETURN_CODE
%else
: Tests skipped
%endif
@@ -140,6 +140,10 @@ rm -rf %{buildroot}
%changelog
+* Sat Mar 04 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.4.0-1
+- Updated to 1.4.0 (RHBZ #1415530)
+- Switched autoloader to php-composer(fedora/autoloader)
+
* Sat Jun 27 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.3.0-3
- Updated autoloader with trailing separator