summaryrefslogtreecommitdiffstats
path: root/phan.spec
diff options
context:
space:
mode:
Diffstat (limited to 'phan.spec')
-rw-r--r--phan.spec45
1 files changed, 31 insertions, 14 deletions
diff --git a/phan.spec b/phan.spec
index 2f4da2b..2b1c7b1 100644
--- a/phan.spec
+++ b/phan.spec
@@ -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