summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phan-autoload.patch20
-rw-r--r--phan-autoload.php12
-rw-r--r--phan.spec42
3 files changed, 29 insertions, 45 deletions
diff --git a/phan-autoload.patch b/phan-autoload.patch
index c9cd218..753f06d 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 2017-06-13 17:53:57.000000000 +0200
+++ ./src/prep.php 2017-06-14 06:15:48.238648972 +0200
@@ -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-06-14 06:15:48.239648977 +0200
+++ ./src/requirements.php 2017-06-14 06:16:26.179834206 +0200
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',
- ],
-]);
diff --git a/phan.spec b/phan.spec
index 67dea5c..fa625c2 100644
--- a/phan.spec
+++ b/phan.spec
@@ -6,7 +6,7 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit 9dbe813f09122c7799e1c197c5a70d3c279867a2
+%global gh_commit 52307bfc60c1fd682536e2145bd3e52bbb142a23
%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.8.4
+Version: 0.8.5
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
@@ -94,9 +93,23 @@ and narrow types based on conditionals.
%setup -q -n %{gh_project}-%{gh_commit}
%patch0 -p1 -b .rpm
-cp %{SOURCE1} src/%{psr0}/autoload.php
+
+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
@@ -105,29 +118,24 @@ find . -name \*.rpm -delete
%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 request and grpc must be disabled
+# NOTICE mosquitto, request and grpc must be disabled
%{_bindir}/phpunit6 -d memory_limit=1G --bootstrap tests/autoload.php --verbose
@@ -146,6 +154,12 @@ EOF
%changelog
+* Wed Jul 12 2017 Remi Collet <remi@remirepo.net> - 0.8.5-1
+- Update to 0.8.5
+- 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.8.4-1
- Update to 0.8.4
- allow Symfony 3