summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-12-14 06:38:25 +0100
committerRemi Collet <remi@remirepo.net>2017-12-14 06:38:25 +0100
commita672df23ad9e7441ffc744b4b57691f9b065a209 (patch)
tree303bcd0ecc501e59aa65c05193569b850601022c
parent870be34342dc5e24fd8a6e0b43909af73b817ba8 (diff)
From Fedora
- Update to 1.0.5 (RHBZ #1514861) - Fix autoloader for multiple versions of Symfony - Test with SCLs if available For remirepo - adapt symfony dependency for older distro
-rw-r--r--.gitignore8
-rw-r--r--composer.json4
-rw-r--r--php-stack-builder.spec95
3 files changed, 61 insertions, 46 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fc9aa8c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,8 @@
+clog
+package-*.xml
+*.tgz
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/composer.json b/composer.json
index 0af2722..1a001b2 100644
--- a/composer.json
+++ b/composer.json
@@ -11,8 +11,8 @@
],
"require": {
"php": ">=5.3.0",
- "symfony/http-foundation": "~2.1|~3.0",
- "symfony/http-kernel": "~2.1|~3.0"
+ "symfony/http-foundation": "~2.1|~3.0|~4.0",
+ "symfony/http-kernel": "~2.1|~3.0|~4.0"
},
"require-dev": {
"silex/silex": "~1.0"
diff --git a/php-stack-builder.spec b/php-stack-builder.spec
index 2eadbac..418379b 100644
--- a/php-stack-builder.spec
+++ b/php-stack-builder.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-stack-builder
#
-# Copyright (c) 2015-2016 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2015-2017 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,8 +12,8 @@
%global github_owner stackphp
%global github_name builder
-%global github_version 1.0.4
-%global github_commit 59fcc9b448a8ce5e338a04c4e2e4aca893e83425
+%global github_version 1.0.5
+%global github_commit fb3d136d04c6be41120ebf8c0cc71fe9507d750a
%global composer_vendor stack
%global composer_project builder
@@ -23,11 +23,14 @@
# "silex/silex": "~1.0"
%global silex_min_ver 1.0
%global silex_max_ver 2.0
-# "symfony/http-foundation": "~2.1|~3.0"
-# "symfony/http-kernel": "~2.1|~3.0"
+# "symfony/http-foundation": ~2.1|~3.0|~4.0
+# "symfony/http-kernel": ~2.1|~3.0|~4.0
# NOTE: Min version not 2.1 because autoloader required
-%global symfony_min_ver 2.7.1
-%global symfony_max_ver 4.0
+%if 0%{?fedora} >= 26
+%global symfony_max_ver 5.0
+%else
+%global symfony_max_ver 4
+%endif
# Build using "--without tests" to disable tests
%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
@@ -45,33 +48,33 @@ URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz
BuildArch: noarch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# Autoloader
-BuildRequires: %{_bindir}/phpab
+BuildRequires: php-composer(theseer/autoload)
# Tests
%if %{with_tests}
BuildRequires: php-composer(phpunit/phpunit)
## composer.json
-BuildRequires: php(language) >= %{php_min_ver}
-BuildRequires: php-composer(silex/silex) >= %{silex_min_ver}
-BuildRequires: php-composer(symfony/http-foundation) >= %{symfony_min_ver}
+BuildRequires: php(language) >= %{php_min_ver}
+BuildRequires: php-composer(silex/silex) < %{silex_max_ver}
+BuildRequires: php-composer(silex/silex) >= %{silex_min_ver}
BuildRequires: php-composer(symfony/http-foundation) < %{symfony_max_ver}
-BuildRequires: php-composer(symfony/http-kernel) >= %{symfony_min_ver}
-BuildRequires: php-composer(symfony/http-kernel) < %{symfony_max_ver}
-## phpcompatinfo (computed from version 1.0.4)
+BuildRequires: php-composer(symfony/http-kernel) < %{symfony_max_ver}
+## phpcompatinfo (computed from version 1.0.5)
BuildRequires: php-reflection
BuildRequires: php-spl
+## Autoloader
+BuildRequires: php-composer(fedora/autoloader)
%endif
# composer.json
-Requires: php(language) >= %{php_min_ver}
-Requires: php-composer(symfony/http-foundation) >= %{symfony_min_ver}
+Requires: php(language) >= %{php_min_ver}
Requires: php-composer(symfony/http-foundation) < %{symfony_max_ver}
-Requires: php-composer(symfony/http-kernel) >= %{symfony_min_ver}
-Requires: php-composer(symfony/http-kernel) < %{symfony_max_ver}
-# phpcompatinfo (computed from version 1.0.4)
+Requires: php-composer(symfony/http-kernel) < %{symfony_max_ver}
+# phpcompatinfo (computed from version 1.0.5)
Requires: php-reflection
Requires: php-spl
+# Autoloader
+Requires: php-composer(fedora/autoloader)
# Composer
Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version}
@@ -95,15 +98,24 @@ Autoloader: %{phpdir}/Stack/autoload-builder.php
cat <<'AUTOLOAD' | tee -a src/Stack/autoload-builder.php
-// Required dependencies
-require_once '%{phpdir}/Symfony/Component/HttpFoundation/autoload.php';
-require_once '%{phpdir}/Symfony/Component/HttpKernel/autoload.php';
+require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
+
+\Fedora\Autoloader\Dependencies::required(array(
+ array(
+ '%{phpdir}/Symfony4/Component/HttpFoundation/autoload.php',
+ '%{phpdir}/Symfony3/Component/HttpFoundation/autoload.php',
+ '%{phpdir}/Symfony/Component/HttpFoundation/autoload.php',
+ ),
+ array(
+ '%{phpdir}/Symfony4/Component/HttpKernel/autoload.php',
+ '%{phpdir}/Symfony3/Component/HttpKernel/autoload.php',
+ '%{phpdir}/Symfony/Component/HttpKernel/autoload.php',
+ ),
+));
AUTOLOAD
%install
-rm -rf %{buildroot}
-
mkdir -p %{buildroot}%{phpdir}
cp -rp src/* %{buildroot}%{phpdir}/
@@ -117,31 +129,21 @@ require_once '%{buildroot}%{phpdir}/Stack/autoload-builder.php';
require_once '%{phpdir}/Silex/autoload.php';
BOOTSTRAP
-run=0
-ret=0
-if which php56; then
- php56 %{_bindir}/phpunit --bootstrap bootstrap.php || ret=1
- run=1
-fi
-if which php71; then
- php71 %{_bindir}/phpunit --bootstrap bootstrap.php || ret=1
- run=1
-fi
-if [ $run -eq 0 ]; then
-%{_bindir}/phpunit --bootstrap bootstrap.php
-fi
-exit $ret
+: Upstream tests
+RETURN_CODE=0
+PHPUNIT=$(which phpunit)
+for PHP_EXEC in "" %{?rhel:php54 php55} php56 php70 php71 php72; do
+ if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
+ $PHP_EXEC $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
@@ -153,6 +155,11 @@ rm -rf %{buildroot}
%changelog
+* Wed Dec 13 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.5-1
+- Update to 1.0.5 (RHBZ #1514861)
+- Fix autoloader for multiple versions of Symfony
+- Test with SCLs if available
+
* Sun Jul 24 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.0.4-1
- Update to 1.0.4 (RHBZ #1342093)
- Update autoloader to use dependencies' autoloaders