summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json17
-rw-r--r--php-phpunit-php-invoker2.spec109
2 files changed, 61 insertions, 65 deletions
diff --git a/composer.json b/composer.json
index 8f80034..46b6ef3 100644
--- a/composer.json
+++ b/composer.json
@@ -1,6 +1,6 @@
{
"name": "phpunit/php-invoker",
- "description": "Utility class for invoking callables with a timeout.",
+ "description": "Invoke callables with a timeout",
"type": "library",
"keywords": [
"process"
@@ -17,13 +17,17 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-invoker/issues"
},
+ "prefer-stable": true,
+ "config": {
+ "optimize-autoloader": true,
+ "sort-packages": true
+ },
"require": {
- "php": ">=5.3.3",
- "phpunit/php-timer": ">=1.0.6",
+ "php": "^7.1",
"ext-pcntl": "*"
},
"require-dev": {
- "phpunit/phpunit": "~4"
+ "phpunit/phpunit": "^6.5"
},
"autoload": {
"classmap": [
@@ -34,6 +38,11 @@
"classmap": [
"tests/"
]
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
}
}
diff --git a/php-phpunit-php-invoker2.spec b/php-phpunit-php-invoker2.spec
index 63f9b4f..235bdf7 100644
--- a/php-phpunit-php-invoker2.spec
+++ b/php-phpunit-php-invoker2.spec
@@ -1,128 +1,115 @@
-# remirepo/fedora spec file for php-phpunit-PHP-Invoker
+# remirepo/fedora spec file for php-phpunit-php-invoker2
#
-# Copyright (c) 2011-2017 Remi Collet
+# Copyright (c) 2011-2018 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
%global bootstrap 0
-%global gh_commit 86074bf0fc2caf02ec8819a93f65a37cd0b44c8e
+%global gh_commit 4a01883f660b10d4a19a14de5efd19b22eac2d93
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner sebastianbergmann
%global gh_project php-invoker
%global php_home %{_datadir}/php
-%global pear_name PHP_Invoker
-%global pear_channel pear.phpunit.de
+%global ns_vendor SebastianBergmann
+%global ns_project Invoker
%if %{bootstrap}
%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
%else
%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
%endif
-Name: php-phpunit-PHP-Invoker
-Version: 1.1.4
+Name: php-phpunit-php-invoker2
+Version: 2.0.0
Release: 1%{?dist}
-Summary: Utility class for invoking callables with a timeout
+Summary: Invoke callables with a timeout
Group: Development/Libraries
License: BSD
URL: https://github.com/%{gh_owner}/%{gh_project}
-Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
+Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
-BuildRequires: php(language) >= 5.2.7
-BuildRequires: %{_bindir}/phpab
+BuildRequires: php(language) >= 7.1
+BuildRequires: php-fedora-autoloader-devel
%if %{with_tests}
-BuildRequires: %{_bindir}/phpunit
+# From composer.json, require-dev
+# "phpunit/phpunit": "^6.5"
+BuildRequires: phpunit6 >= 6.5
%endif
-# From composer.json
-# "php": ">=5.3.3",
-# "phpunit/php-timer": ">=1.0.6",
+# From composer.json, require
+# "php": "^7.1",
# "ext-pcntl": "*"
-Requires: php(language) >= 5.3.3
-Requires: php-composer(phpunit/php-timer) >= 1.0.6
+Requires: php(language) >= 7.1
Requires: php-pcntl
-# From phpcompatinfo report for version 1.0.5
+# From phpcompatinfo report for version 2.0.0
Requires: php-spl
+# Autoloader
+Requires: php-composer(fedora/autoloader)
Provides: php-composer(phpunit/php-invoker) = %{version}
-# For compatibility with PEAR mode
-Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version}
-
%description
-Utility class for invoking callables with a timeout.
+phpunit/php-invoker provides the means to invoke a callable with a timeout.
+
+Autoloader: %{php_home}/%{ns_vendor}/%{ns_project}/autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-: Restore previous PSR-0 layout
-mkdir -p PHP/Invoker
-mv src/Invoker.php PHP/
-mv src/*.php PHP/Invoker/
-rmdir src
-
-
%build
: Generate autoloader
%{_bindir}/phpab \
- --output PHP/Invoker/Autoload.php \
- --basedir PHP/Invoker \
- PHP
-
-cat << EOF | tee -a PHP/Invoker/Autoload.php
-// Dependencies
-require_once 'PHP/Timer/Autoload.php';
-EOF
-
+ --template fedora \
+ --output src/autoload.php \
+ src
%install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}%{php_home}
-cp -pr PHP %{buildroot}%{php_home}
+mkdir -p %{buildroot}%{php_home}/%{ns_vendor}
+cp -pr src %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}
%if %{with_tests}
%check
: Generate tests autoloader
-%{_bindir}/phpab \
- --output tests/bs.php \
- tests
+mkdir vendor
+%{_bindir}/phpab --output vendor/autoload.php tests
: Run upstream test suite
-%{_bindir}/phpunit \
- --include-path %{buildroot}%{php_home} \
- --bootstrap tests/bs.php \
- --verbose
+ret=0
+for cmd in php php71 php72; do
+ if which $cmd; then
+ $cmd -d auto_prepend_file=%{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}/autoload.php \
+ %{_bindir}/phpunit6 --verbose || ret=1
+ fi
+done
+exit $ret
%endif
-%clean
-rm -rf %{buildroot}
-
-
-%post
-if [ -x %{_bindir}/pear ]; then
- %{_bindir}/pear uninstall --nodeps --ignore-errors --register-only \
- %{pear_channel}/%{pear_name} >/dev/null || :
-fi
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README.md
%doc composer.json
-%{php_home}/PHP/Invoker*
+%dir %{php_home}/%{ns_vendor}
+ %{php_home}/%{ns_vendor}/%{ns_project}
%changelog
+* Mon Jan 29 2018 Remi Collet <remi@remirepo.net> - 2.0.0-1
+- Update to 2.0.0
+- rename to php-phpunit-php-invoker2
+- raise dependency on PHP 7.1
+- move to PSR-0 tree (/usr/share/php/SebastianBergmann/Invoker)
+- switch to phpunit6
+- switch to fedora/autoloader
+
* Sun Jun 21 2015 Remi Collet <remi@fedoraproject.org> - 1.1.4-1
- update to 1.1.4
- raise dependencies on PHP >= 5.3.3 and php-timer >= 1.0.6