summaryrefslogtreecommitdiffstats
path: root/php-phpunit-php-invoker2.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-01-29 08:52:43 +0100
committerRemi Collet <remi@remirepo.net>2018-01-29 08:52:43 +0100
commit4cb460f06ef7c50e976069513e56d5699fe803a8 (patch)
tree6184d1611a83ff111e435c76a3419c087d8ace45 /php-phpunit-php-invoker2.spec
parent283a57dc802bb3d48488e0449c1dc5515dccbe25 (diff)
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
Diffstat (limited to 'php-phpunit-php-invoker2.spec')
-rw-r--r--php-phpunit-php-invoker2.spec109
1 files changed, 48 insertions, 61 deletions
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