From 77f52b234f1b7357918ddb8be8488bb40e8ef904 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 11 May 2017 08:57:51 +0200 Subject: fedora/autoloader + SF 3 --- .gitignore | 7 ++++++ php-phpunit-phploc-dev.spec | 52 ++++++++++++++++++++++++--------------------- 2 files changed, 35 insertions(+), 24 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ab5c4f --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/php-phpunit-phploc-dev.spec b/php-phpunit-phploc-dev.spec index d2ce4e7..20252eb 100644 --- a/php-phpunit-phploc-dev.spec +++ b/php-phpunit-phploc-dev.spec @@ -18,7 +18,7 @@ Name: php-phpunit-phploc Version: 3.0.1 -Release: 1%{?dist} +Release: 3%{?dist} Summary: A tool for quickly measuring the size of a PHP project Group: Development/Libraries @@ -29,14 +29,17 @@ 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.6 -BuildRequires: php-composer(theseer/autoload) +BuildRequires: php-fedora-autoloader-devel %if %{with_tests} +BuildRequires: php-composer(sebastian/finder-facade) < 2 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(symfony/console) < 4 BuildRequires: php-composer(symfony/console) >= 2.5 # For our autoloader BuildRequires: php-composer(symfony/class-loader) @@ -66,7 +69,7 @@ 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 @@ -91,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 @@ -114,22 +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 - -if which php70; then - php70 %{_bindir}/phpunit \ +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 + fi +done %endif -%clean -rm -rf %{buildroot} - - %post if [ -x %{_bindir}/pear ]; then %{_bindir}/pear uninstall --nodeps --ignore-errors --register-only \ @@ -138,7 +139,6 @@ fi %files -%defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE %doc README.md @@ -148,6 +148,10 @@ fi %changelog +* Thu May 11 2017 Remi Collet - 3.0.1-3 +- switch to fedora/autoloader +- use Symfony 3 when available + * Tue Apr 26 2016 Remi Collet - 3.0.1-1 - update to 3.0.1 - raise dependency on sebastian/git >= 2.1 -- cgit