summaryrefslogtreecommitdiffstats
path: root/php-ocramius-generated-hydrator.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-ocramius-generated-hydrator.spec')
-rw-r--r--php-ocramius-generated-hydrator.spec92
1 files changed, 47 insertions, 45 deletions
diff --git a/php-ocramius-generated-hydrator.spec b/php-ocramius-generated-hydrator.spec
index f351cdf..39c00f2 100644
--- a/php-ocramius-generated-hydrator.spec
+++ b/php-ocramius-generated-hydrator.spec
@@ -1,4 +1,4 @@
-# remirpeo spec file for php-ocramius-generated-hydrator, from
+# remirepo spec file for php-ocramius-generated-hydrator, from:
#
# Fedora spec file for php-ocramius-generated-hydrator
#
@@ -12,21 +12,21 @@
%global github_owner Ocramius
%global github_name GeneratedHydrator
-%global github_version 2.0.0
-%global github_commit 98a731e7d4e393513cb6f4e7f120da853680fb50
+%global github_version 2.1.0
+%global github_commit 7cf05fe50e23e5f1c3bb063744360a23552d6075
%global composer_vendor ocramius
%global composer_project generated-hydrator
# "php": "~7.0"
%global php_min_ver 7.0
-# "nikic/php-parser": "~2.0"
+# "nikic/php-parser": "~2.0|~3.0"
%global php_parser_min_ver 2.0
%global php_parser_max_ver 3
-# "ocramius/code-generator-utils": "0.4.*"
-%global ocramius_cgu_min_ver 0.4.0
-%global ocramius_cgu_max_ver 0.5
-# "zendframework/zend-hydrator": "~2.0"
+# "ocramius/code-generator-utils": "~0.4"
+%global ocramius_cgu_min_ver 0.4
+%global ocramius_cgu_max_ver 1.0
+# "zendframework/zend-hydrator": "^2.0"
%global zf_hydrator_min_ver 2.0
%global zf_hydrator_max_ver 3
@@ -37,7 +37,7 @@
Name: php-%{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 3%{?github_release}%{?dist}
+Release: 1%{?github_release}%{?dist}
Summary: An object hydrator
Group: Development/Libraries
@@ -45,37 +45,38 @@ License: MIT
URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
%if %{with_tests}
# composer.json
BuildRequires: php(language) >= %{php_min_ver}
BuildRequires: php-composer(nikic/php-parser) < %{php_parser_max_ver}
BuildRequires: php-composer(nikic/php-parser) >= %{php_parser_min_ver}
-BuildRequires: php-composer(ocramius/code-generator-utils) >= %{ocramius_cgu_min_ver}
BuildRequires: php-composer(ocramius/code-generator-utils) < %{ocramius_cgu_max_ver}
+BuildRequires: php-composer(ocramius/code-generator-utils) >= %{ocramius_cgu_min_ver}
BuildRequires: php-composer(phpunit/phpunit) >= 5.0
-BuildRequires: php-composer(zendframework/zend-hydrator) >= %{zf_hydrator_min_ver}
BuildRequires: php-composer(zendframework/zend-hydrator) < %{zf_hydrator_max_ver}
-# phpcompatinfo (computed from version 2.0.0)
-BuildRequires: php-pcre
+BuildRequires: php-composer(zendframework/zend-hydrator) >= %{zf_hydrator_min_ver}
+# phpcompatinfo (computed from version 2.1.0)
+BuildRequires: php-date
BuildRequires: php-reflection
BuildRequires: php-spl
# Autoloader
-BuildRequires: php-composer(symfony/class-loader)
+BuildRequires: php-composer(fedora/autoloader)
%endif
# composer.json
Requires: php(language) >= %{php_min_ver}
Requires: php-composer(nikic/php-parser) < %{php_parser_max_ver}
Requires: php-composer(nikic/php-parser) >= %{php_parser_min_ver}
-Requires: php-composer(ocramius/code-generator-utils) >= %{ocramius_cgu_min_ver}
Requires: php-composer(ocramius/code-generator-utils) < %{ocramius_cgu_max_ver}
-Requires: php-composer(zendframework/zend-hydrator) >= %{zf_hydrator_min_ver}
+Requires: php-composer(ocramius/code-generator-utils) >= %{ocramius_cgu_min_ver}
Requires: php-composer(zendframework/zend-hydrator) < %{zf_hydrator_max_ver}
-# phpcompatinfo (computed from version 2.0.0)
+Requires: php-composer(zendframework/zend-hydrator) >= %{zf_hydrator_min_ver}
+# phpcompatinfo (computed from version 2.1.0)
Requires: php-reflection
Requires: php-spl
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# Composer
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
@@ -98,32 +99,25 @@ cat <<'AUTOLOAD' | tee src/GeneratedHydrator/autoload.php
/**
* Autoloader for %{name} and its' dependencies
* (created by %{name}-%{version}-%{release}).
- *
- * @return \Symfony\Component\ClassLoader\ClassLoader
*/
+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();
-}
+\Fedora\Autoloader\Autoload::addPsr4('GeneratedHydrator\\', __DIR__);
-$fedoraClassLoader->addPrefix('GeneratedHydrator\\', dirname(__DIR__));
-
-// Required dependencies
-require_once '%{phpdir}/CodeGenerationUtils/autoload.php';
-require_once '%{phpdir}/PhpParser2/autoload.php';
-require_once '%{phpdir}/Zend/autoload.php';
+\Fedora\Autoloader\Dependencies::required([
+ '%{phpdir}/CodeGenerationUtils/autoload.php',
+ [
+ '%{phpdir}/PhpParser3/autoload.php',
+ '%{phpdir}/PhpParser2/autoload.php',
+ ],
+ '%{phpdir}/Zend/autoload.php',
+]);
return $fedoraClassLoader;
AUTOLOAD
%install
-rm -rf %{buildroot}
mkdir -p %{buildroot}%{phpdir}
cp -rp src/GeneratedHydrator %{buildroot}%{phpdir}/
@@ -134,24 +128,27 @@ cp -rp src/GeneratedHydrator %{buildroot}%{phpdir}/
: Create tests bootstrap
cat <<'BOOTSTRAP' | tee bootstrap.php
<?php
-$fedoraClassLoader = require '%{buildroot}%{phpdir}/GeneratedHydrator/autoload.php';
-$fedoraClassLoader->addPrefix('GeneratedHydratorPerformance\\', __DIR__.'/tests');
-$fedoraClassLoader->addPrefix('GeneratedHydratorTest\\', __DIR__.'/tests');
-$fedoraClassLoader->addPrefix('GeneratedHydratorTestAsset\\', __DIR__.'/tests');
+require '%{buildroot}%{phpdir}/GeneratedHydrator/autoload.php';
+
+\Fedora\Autoloader\Autoload::addPsr4('GeneratedHydratorTest\\', __DIR__.'/tests/GeneratedHydratorTest');
+\Fedora\Autoloader\Autoload::addPsr4('GeneratedHydratorTestAsset\\', __DIR__.'/tests/GeneratedHydratorTestAsset');
BOOTSTRAP
-%{_bindir}/phpunit --verbose --bootstrap bootstrap.php
+: Upstream tests
+RETURN_CODE=0
+for PHP_EXEC in php php71 php72; do
+ if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then
+ $PHP_EXEC %{_bindir}/phpunit --verbose --bootstrap bootstrap.php \
+ || RETURN_CODE=1
+ fi
+done
+exit $RETURN_CODE
%else
: Tests skipped
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
@@ -160,6 +157,11 @@ rm -rf %{buildroot}
%changelog
+* Sat Aug 05 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.1.0-1
+- Update to 2.1.0 (RHBZ #1473994)
+- Switch autoloader to php-composer(fedora/autoloader)
+- Test with SCLs if available
+
* Mon Jan 23 2017 Remi Collet <remi@fedoraproject.org> - 2.0.0-3
- change BR order, fix FTBFS from Koschei