diff options
-rw-r--r-- | phan-autoload.patch | 20 | ||||
-rw-r--r-- | phan-autoload.php | 12 | ||||
-rw-r--r-- | phan.spec | 45 |
3 files changed, 32 insertions, 45 deletions
diff --git a/phan-autoload.patch b/phan-autoload.patch index d391ccb..c484c8b 100644 --- a/phan-autoload.patch +++ b/phan-autoload.patch @@ -36,7 +36,7 @@ diff -up ./src/Phan/Bootstrap.php.rpm ./src/Phan/Bootstrap.php - } -} +// Use the fedora autoloader -+require_once __DIR__ . '/autoload.php'; ++require_once __DIR__ . '/../autoload.php'; define('EXIT_SUCCESS', 0); define('EXIT_FAILURE', 1); @@ -48,15 +48,6 @@ diff -up ./src/phan.php.rpm ./src/phan.php <?php declare(strict_types=1); // Phan does a ton of GC and this offers a major speed -@@ -13,7 +14,7 @@ require_once(__DIR__ . '/requirements.ph - // own - $code_base = require_once(__DIR__ . '/codebase.php'); - --require_once(__DIR__ . '/Phan/Bootstrap.php'); -+require_once(__DIR__ . '/Bootstrap.php'); - - use Phan\CLI; - use Phan\CodeBase; diff -up ./src/prep.php.rpm ./src/prep.php --- ./src/prep.php.rpm 2016-11-24 16:08:59.122090771 +0100 +++ ./src/prep.php 2016-11-24 16:11:34.003914271 +0100 @@ -65,15 +56,6 @@ diff -up ./src/prep.php.rpm ./src/prep.php <?php declare(strict_types=1); // Phan does a ton of GC and this offers a major speed -@@ -7,7 +8,7 @@ gc_disable(); - - // Check the environment to make sure Phan can run successfully - require_once(__DIR__ . '/requirements.php'); --require_once(__DIR__ . '/Phan/Bootstrap.php'); -+require_once(__DIR__ . '/Bootstrap.php'); - - use Phan\CLI; - use Phan\Prep; diff -up ./src/requirements.php.rpm ./src/requirements.php --- ./src/requirements.php.rpm 2017-03-16 11:48:32.604583610 +0100 +++ ./src/requirements.php 2017-03-16 11:48:37.237605505 +0100 diff --git a/phan-autoload.php b/phan-autoload.php deleted file mode 100644 index b40a5bf..0000000 --- a/phan-autoload.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php -/* Autoloader for etsy/phan and its dependencies */ - -require_once '/usr/share/php/Fedora/Autoloader/autoload.php'; - -\Fedora\Autoloader\Autoload::addPsr4('Phan\\', __DIR__); -\Fedora\Autoloader\Dependencies::required([ - [ - '/usr/share/php/Symfony3/Component/Console/autoload.php', - '/usr/share/php/Symfony/Component/Console/autoload.php', - ], -]); @@ -6,7 +6,7 @@ # # Please, preserve the changelog entries # -%global gh_commit 6757938c1f18e245fec5ebdf629fe8b0f3d1e41d +%global gh_commit e16ea3a01fdb4b38cd12d411200a1926ed56dd2a %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner etsy #global gh_date 20150820 @@ -15,7 +15,7 @@ %global with_tests 0%{!?_without_tests:1} Name: %{gh_project} -Version: 0.9.2 +Version: 0.9.3 Release: 1%{?gh_date?%{gh_date}git%{gh_short}}%{?dist} Summary: A static analyzer for PHP @@ -25,7 +25,6 @@ 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 # Use fedora autoloader -Source1: %{name}-autoload.php Patch0: %{name}-autoload.patch BuildArch: noarch @@ -92,8 +91,24 @@ and narrow types based on conditionals. %prep %setup -q -n %{gh_project}-%{gh_commit} -%patch0 -p1 -cp %{SOURCE1} src/%{psr0}/autoload.php +%patch0 -p1 -b .rpm + +cat << 'EOF' | tee src/autoload.php +<?php +/* Autoloader for etsy/phan and its dependencies */ + +require_once '/usr/share/php/Fedora/Autoloader/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('Phan\\', __DIR__ . '/Phan'); +\Fedora\Autoloader\Dependencies::required([ + [ + '/usr/share/php/Symfony3/Component/Console/autoload.php', + '/usr/share/php/Symfony/Component/Console/autoload.php', + ], +]); +EOF + +find . -name \*.rpm -delete +chmod +x src/phan.php %build @@ -102,28 +117,24 @@ cp %{SOURCE1} src/%{psr0}/autoload.php %install : Library -mkdir -p %{buildroot}%{_datadir}/php -cp -pr src/%{psr0} %{buildroot}%{_datadir}/php/%{psr0} - -: Relocated tools -cp -pr src/*php %{buildroot}%{_datadir}/php/%{psr0}/ -install -Dpm 755 src/phan.php %{buildroot}%{_datadir}/php/%{psr0}/phan.php -install -Dpm 755 src/prep.php %{buildroot}%{_datadir}/php/%{psr0}/prep.php +mkdir -p %{buildroot}%{_datadir}/php/ +cp -pr src %{buildroot}%{_datadir}/php/%{psr0} : Commands mkdir -p %{buildroot}%{_bindir} ln -s ../share/php/%{psr0}/phan.php %{buildroot}%{_bindir}/phan -ln -s ../share/php/%{psr0}/prep.php %{buildroot}%{_bindir}/phan-prep +install -Dpm 755 phan_client %{buildroot}%{_bindir}/phan-client %check %if %{with_tests} cat << 'EOF' | tee tests/autoload.php <?php -require '%{buildroot}%{_datadir}/php/%{psr0}/Bootstrap.php'; +require '%{buildroot}%{_datadir}/php/%{psr0}/Phan/Bootstrap.php'; \Fedora\Autoloader\Autoload::addPsr4('Phan\\Tests\\', __DIR__ . '/Phan'); EOF +# NOTICE mosquitto, request and grpc must be disabled %{_bindir}/phpunit6 -d memory_limit=1G --bootstrap tests/autoload.php --verbose @@ -147,6 +158,12 @@ rm -rf %{buildroot} %changelog +* Wed Jul 12 2017 Remi Collet <remi@remirepo.net> - 0.9.3-1 +- Update to 0.9.3 +- installation layout match upstream tree +- remove phan-prep command (only an example) +- add phan-client command + * Wed Jun 14 2017 Remi Collet <remi@remirepo.net> - 0.9.2-1 - Update to 0.9.2 - allow Symfony 3 |