summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json13
-rw-r--r--php-phpunit-php-timer2.spec112
2 files changed, 60 insertions, 65 deletions
diff --git a/composer.json b/composer.json
index 0f16164..f2ed136 100644
--- a/composer.json
+++ b/composer.json
@@ -10,18 +10,23 @@
"authors": [
{
"name": "Sebastian Bergmann",
- "email": "sb@sebastian-bergmann.de",
+ "email": "sebastian@phpunit.de",
"role": "lead"
}
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-timer/issues"
},
+ "prefer-stable": true,
"require": {
- "php": "^5.3.3 || ^7.0"
+ "php": "^7.1"
},
"require-dev": {
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
+ "phpunit/phpunit": "^7.0"
+ },
+ "config": {
+ "optimize-autoloader": true,
+ "sort-packages": true
},
"autoload": {
"classmap": [
@@ -30,7 +35,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "1.0-dev"
+ "dev-master": "2.0-dev"
}
}
}
diff --git a/php-phpunit-php-timer2.spec b/php-phpunit-php-timer2.spec
index 342b0ea..6315355 100644
--- a/php-phpunit-php-timer2.spec
+++ b/php-phpunit-php-timer2.spec
@@ -1,77 +1,81 @@
-# remirepo/fedora spec file for php-phpunit-PHP-Timer
+# remirepo/fedora spec file for php-phpunit-php-timer2
#
-# Copyright (c) 2010-2015 Christof Damian, Remi Collet
+# Copyright (c) 2010-2018 Christof Damian, Remi Collet
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please, preserve the changelog entries
#
-%global gh_commit 3dcf38ca72b158baf0bc245e9184d3fdffa9c46f
+%global bootstrap 1
+%global gh_commit 8b8454ea6958c3dee38453d3bd571e023108c91f
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner sebastianbergmann
%global gh_project php-timer
+# Packagist
+%global pk_vendor phpunit
+%global pk_project %{gh_project}
+# Namespace
+%global ns_vendor SebastianBergmann
+%global ns_project Timer
+
+%global major 2
%global php_home %{_datadir}/php
-%global pear_name PHP_Timer
-%global pear_channel pear.phpunit.de
-%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
+%if %{bootstrap}
+%global with_tests 0%{?_with_tests:1}
+%else
+%global with_tests 0%{!?_without_tests:1}
+%endif
-Name: php-phpunit-PHP-Timer
-Version: 1.0.9
-Release: 1%{?dist}
+Name: php-%{pk_vendor}-%{pk_project}%{major}
+Version: 2.0.0
+Release: 0%{?dist}
Summary: PHP Utility class for timing
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.3.3
+BuildRequires: php(language) >= 7.1
BuildRequires: php-fedora-autoloader-devel
%if %{with_tests}
# From composer.json"require-dev": {
-# "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
-BuildRequires: php-composer(phpunit/phpunit) >= 4.8.35
+# "phpunit/phpunit": "^7.0"
+BuildRequires: phpunit7
%endif
# From composer.json
-# "php": "^5.3.3 || ^7.0"
-Requires: php(language) >= 5.3.3
-# From phpcompatinfo report for version 1.0.5
+# "php": "^7.1"
+Requires: php(language) >= 7.1
+# From phpcompatinfo report for version 2.0.0
Requires: php-spl
# Autoloader
Requires: php-composer(fedora/autoloader)
-Provides: php-composer(phpunit/php-timer) = %{version}
-# For compatibility with PEAR mode
-Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version}
+Provides: php-composer(%{pk_vendor}/%{pk_project}) = %{version}
%description
-PHP Utility class for timing
+Utility class for timing things, factored out of PHPUnit into a stand-alone
+component.
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-# Restore PSR-0 tree
-mv src PHP
-mkdir PHP/Timer
-
%build
phpab \
--template fedora \
- --output PHP/Timer/Autoload.php \
- PHP
+ --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}
@@ -79,50 +83,36 @@ cp -pr PHP %{buildroot}%{php_home}
mkdir vendor
touch vendor/autoload.php
-: Run tests - set include_path to ensure PHPUnit autoloader use it
-# remirepo:13
-run=0
+: Run upstream test suite
ret=0
-if which php56; then
- php56 -d include_path=.:%{buildroot}%{php_home}:%{php_home} \
- %{_bindir}/phpunit || ret=1
- run=1
-fi
-if which php71; then
- php71 -d include_path=.:%{buildroot}%{php_home}:%{php_home} \
- %{_bindir}/phpunit6 || ret=1
- run=1
-fi
-if [ $run -eq 0 ]; then
-%{_bindir}/php -d include_path=.:%{buildroot}%{php_home}:%{php_home} \
-%{_bindir}/phpunit --verbose
-# remirepo:2
-fi
+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}/phpunit7 --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
+%dir %{php_home}/%{ns_vendor}
+ %{php_home}/%{ns_vendor}/%{ns_project}
%changelog
+* Fri Feb 2 2018 Remi Collet <remi@remirepo.net> - 2.0.0-0
+- update to 2.0.0
+- rename to php-phpunit-php-timer2
+- move to /usr/share/php/SebastianBergmann/Timer
+- raise dependency on PHP 7.1
+- use phpunit 7
+- bootstrap build
+
* Sun Feb 26 2017 Remi Collet <remi@fedoraproject.org> - 1.0.9-1
- update to 1.0.9
- switch to fedora/autoloader