summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Autoload-php53.patch22
-rw-r--r--php-theseer-autoload.spec14
2 files changed, 35 insertions, 1 deletions
diff --git a/Autoload-php53.patch b/Autoload-php53.patch
new file mode 100644
index 0000000..0ce1961
--- /dev/null
+++ b/Autoload-php53.patch
@@ -0,0 +1,22 @@
+From d8f950ded329f8a8715b8cbe114cd9c1123e0126 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Wed, 24 Apr 2019 13:58:37 +0200
+Subject: [PATCH] restore PHP 5.3 compatibility
+
+---
+ src/Application.php | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Application.php b/src/Application.php
+index 4d883ba..9f14aa6 100644
+--- a/src/Application.php
++++ b/src/Application.php
+@@ -86,7 +86,7 @@ private function runCollector() {
+ unset($scanner);
+ } else {
+ $file = new \SplFileInfo($directory);
+- $filter = $this->factory->getFilter(new \ArrayIterator([$file]));
++ $filter = $this->factory->getFilter(new \ArrayIterator(array($file)));
+ foreach($filter as $file) {
+ $this->logger->log('Scanning file ' . $file . "\n");
+ $collector->processFile($file);
diff --git a/php-theseer-autoload.spec b/php-theseer-autoload.spec
index 1983ef8..7682fe8 100644
--- a/php-theseer-autoload.spec
+++ b/php-theseer-autoload.spec
@@ -20,7 +20,7 @@
Name: php-theseer-autoload
Version: 1.25.4
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A tool and library to generate autoload code
License: BSD
@@ -29,6 +29,8 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit
# Autoloader path
Patch0: %{gh_project}-rpm.patch
+# PHP 5.3
+Patch1: %{gh_project}-php53.patch
BuildArch: noarch
BuildRequires: php(language) >= 5.3.1
@@ -85,6 +87,7 @@ the option of creating static require lists as well as phar archives.
%setup -q -n %{gh_project}-%{gh_commit}
%patch0 -p0 -b .rpm
+%patch1 -p1
: drop composer dependencies
sed -e '\:../vendor/:d' -i src/autoload.php
@@ -113,6 +116,11 @@ install -Dpm 0755 phpab.php %{buildroot}%{_bindir}/phpab
%check
+: Check version
+sed -e 's:%{php_home}:%{buildroot}%{php_home}:' phpab.php >t.php
+php t.php --version | grep %{version}
+php t.php --output foo.php src
+
: Fix test suite to use installed library
cat <<EOF | tee tests/init.php
<?php
@@ -146,6 +154,10 @@ fi
%changelog
+* Wed Apr 24 2019 Remi Collet <remi@remirepo.net> - 1.25.4-2
+- add patch for PHP 5.3 from
+ https://github.com/theseer/Autoload/pull/86
+
* Fri Apr 19 2019 Remi Collet <remi@remirepo.net> - 1.25.4-1
- update to 1.25.4