summaryrefslogtreecommitdiffstats
path: root/php-phpunit-phploc.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-phpunit-phploc.spec')
-rw-r--r--php-phpunit-phploc.spec98
1 files changed, 59 insertions, 39 deletions
diff --git a/php-phpunit-phploc.spec b/php-phpunit-phploc.spec
index ae1f45a..20252eb 100644
--- a/php-phpunit-phploc.spec
+++ b/php-phpunit-phploc.spec
@@ -1,13 +1,13 @@
# remirepo/fedora spec file for php-phpunit-phploc
#
-# Copyright (c) 2009-2015 Guillaume Kulakowski, Christof Damian, Remi Collet
+# Copyright (c) 2009-2016 Guillaume Kulakowski, Christof Damian, Remi Collet
#
# License: MIT
# http://opensource.org/licenses/MIT
#
# Please, preserve the changelog entries
#
-%global gh_commit 50e063abd41833b3a5d29a2e8fbef5859ac28bdc
+%global gh_commit 74f917e6f80f291856989960d31afa44a4196859
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner sebastianbergmann
%global gh_project phploc
@@ -17,8 +17,8 @@
%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
Name: php-phpunit-phploc
-Version: 2.1.5
-Release: 1%{?dist}
+Version: 3.0.1
+Release: 3%{?dist}
Summary: A tool for quickly measuring the size of a PHP project
Group: Development/Libraries
@@ -29,46 +29,47 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit
# Fix for RPM, use autoload
Patch0: %{gh_project}-rpm.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
-BuildRequires: php(language) >= 5.3.3
-BuildRequires: php-composer(theseer/autoload)
+BuildRequires: php(language) >= 5.6
+BuildRequires: php-fedora-autoloader-devel
%if %{with_tests}
-BuildRequires: php-composer(phpunit/phpunit)
-BuildRequires: php-composer(sebastian/finder-facade) >= 1.1
BuildRequires: php-composer(sebastian/finder-facade) < 2
-BuildRequires: php-composer(sebastian/git) >= 2.0
-BuildRequires: php-composer(sebastian/git) < 3
+BuildRequires: php-composer(sebastian/finder-facade) >= 1.1
+BuildRequires: php-composer(sebastian/git) < 3
+BuildRequires: php-composer(sebastian/git) >= 2.1
+BuildRequires: php-composer(sebastian/version) < 3
BuildRequires: php-composer(sebastian/version) >= 1.0.3
-BuildRequires: php-composer(sebastian/version) < 2
+BuildRequires: php-composer(symfony/console) < 4
BuildRequires: php-composer(symfony/console) >= 2.5
-BuildRequires: php-composer(symfony/console) < 3
# For our autoloader
BuildRequires: php-composer(symfony/class-loader)
+# From composer.json, "require-dev": {
+# "phpunit/phpunit": "~5"
+BuildRequires: php-composer(phpunit/phpunit) >= 5
%endif
-# From composer.json
-# "php": ">=5.3.3",
+# From composer.json, "require": {
+# "php": ">=5.6",
# "sebastian/finder-facade": "~1.1",
-# "sebastian/git": "~2.0",
-# "sebastian/version": "~1.0.3",
-# "symfony/console": "~2.5"
-Requires: php(language) >= 5.3.3
+# "sebastian/git": "~2.1",
+# "sebastian/version": "~1.0.3|~2.0",
+# "symfony/console": "~2.5|~3.0"
+Requires: php(language) >= 5.6
Requires: php-cli
Requires: php-composer(sebastian/finder-facade) >= 1.1
Requires: php-composer(sebastian/finder-facade) < 2
-Requires: php-composer(sebastian/git) >= 2.0
+Requires: php-composer(sebastian/git) >= 2.1
Requires: php-composer(sebastian/git) < 3
Requires: php-composer(sebastian/version) >= 1.0.3
-Requires: php-composer(sebastian/version) < 2
+Requires: php-composer(sebastian/version) < 3
Requires: php-composer(symfony/console) >= 2.5
-Requires: php-composer(symfony/console) < 3
+Requires: php-composer(symfony/console) < 4
# From phpcompatinfo report for version 2.1.3
Requires: php-dom
Requires: php-spl
Requires: php-tokenizer
# For our autoloader
-Requires: php-composer(symfony/class-loader)
+Requires: php-composer(fedora/autoloader)
Provides: php-composer(phploc/phploc) = %{version}
# For compat
@@ -93,21 +94,25 @@ need to get a quick understanding of a project's size.
%build
%{_bindir}/phpab \
--output src/autoload.php \
+ --template fedora \
src
cat << 'EOF' | tee -a src/autoload.php
-// Dependencies
-$vendorDir = '/usr/share/php';
-require_once $vendorDir . '/SebastianBergmann/FinderFacade/autoload.php';
-require_once $vendorDir . '/SebastianBergmann/Git/autoload.php';
-require_once $vendorDir . '/SebastianBergmann/Version/autoload.php';
-require_once $vendorDir . '/TheSeer/fDOMDocument/autoload.php';
-require_once $vendorDir . '/Symfony/Component/Console/autoloader.php';
+
+\Fedora\Autoloader\Dependencies::required([
+ '%{_datadir}/php/SebastianBergmann/FinderFacade/autoload.php',
+ '%{_datadir}/php/SebastianBergmann/Git/autoload.php',
+ '%{_datadir}/php/SebastianBergmann/Version/autoload.php',
+ '%{_datadir}/php/TheSeer/fDOMDocument/autoload.php',
+ [
+ '%{_datadir}/php/Symfony3/Component/Console/autoload.php',
+ '%{_datadir}/php/Symfony/Component/Console/autoload.php',
+ ],
+]);
EOF
%install
-rm -rf %{buildroot}
mkdir -p %{buildroot}%{php_home}
cp -pr src %{buildroot}%{php_home}/PHPLOC
@@ -116,16 +121,16 @@ install -D -p -m 755 phploc %{buildroot}%{_bindir}/phploc
%if %{with_tests}
%check
-%{_bindir}/phpunit \
- --bootstrap %{buildroot}%{php_home}/PHPLOC/autoload.php \
- --verbose tests
+for cmd in php php56 php70 php71 php72; do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit \
+ --bootstrap %{buildroot}%{php_home}/PHPLOC/autoload.php \
+ --verbose tests
+ fi
+done
%endif
-%clean
-rm -rf %{buildroot}
-
-
%post
if [ -x %{_bindir}/pear ]; then
%{_bindir}/pear uninstall --nodeps --ignore-errors --register-only \
@@ -134,7 +139,6 @@ fi
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README.md
@@ -144,6 +148,22 @@ fi
%changelog
+* Thu May 11 2017 Remi Collet <remi@remirepo.net> - 3.0.1-3
+- switch to fedora/autoloader
+- use Symfony 3 when available
+
+* Tue Apr 26 2016 Remi Collet <remi@fedoraproject.org> - 3.0.1-1
+- update to 3.0.1
+- raise dependency on sebastian/git >= 2.1
+
+* Mon Apr 18 2016 Remi Collet <remi@fedoraproject.org> - 3.0.0-2
+- allow sebastian/version 2.0
+
+* Wed Jan 13 2016 Remi Collet <remi@fedoraproject.org> - 3.0.0-1
+- raise minimal php version to 5.6
+- raise dependency on PHPUnit ~5
+- allow symfony 3
+
* Thu Oct 22 2015 Remi Collet <remi@fedoraproject.org> - 2.1.5-1
- update to 2.1.5
- simplify autoloader