summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-PHPParser-command.patch13
-rw-r--r--php-PHPParser.spec15
2 files changed, 26 insertions, 2 deletions
diff --git a/php-PHPParser-command.patch b/php-PHPParser-command.patch
new file mode 100644
index 0000000..0a8cfd5
--- /dev/null
+++ b/php-PHPParser-command.patch
@@ -0,0 +1,13 @@
+diff -up bin/php-parse.php.rpm bin/php-parse.php
+--- bin/php-parse.php.rpm 2015-02-25 17:52:01.000000000 +0100
++++ bin/php-parse.php 2015-02-25 17:52:55.000000000 +0100
+@@ -1,6 +1,8 @@
++#!/usr/bin/php
+ <?php
+
+-require __DIR__ . '/../lib/bootstrap.php';
++require 'PhpParser/Autoloader.php';
++PhpParser\Autoloader::register();
+
+ ini_set('xdebug.max_nesting_level', 2000);
+
diff --git a/php-PHPParser.spec b/php-PHPParser.spec
index a3e8149..85f3f29 100644
--- a/php-PHPParser.spec
+++ b/php-PHPParser.spec
@@ -11,7 +11,7 @@
Name: php-%{lib_name_old}
Version: %{github_version}
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A PHP parser written in PHP
Group: Development/Libraries
@@ -20,7 +20,10 @@ URL: https://github.com/%{github_owner}/%{github_name}
# Upstream tarball don't provide test suite
# Use mksrc.sh to generate a git snapshot tarball
Source0: %{name}-%{github_version}-%{github_short}.tgz
-Source1: mksrc.sh
+Source1: makesrc.sh
+
+# Patch for distribution
+Patch0: %{name}-command.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -58,6 +61,8 @@ A PHP parser written in PHP to simplify static analysis and code manipulation.
%prep
%setup -q -n %{github_name}-%{github_short}
+%patch0 -p0 -b .rpm
+
%build
# Empty build section, nothing to build
@@ -72,6 +77,8 @@ mkdir -p -m 755 %{buildroot}%{_datadir}/php/%{lib_name_old}
ln -s ../%{lib_name}/Autoloader.php \
%{buildroot}%{_datadir}/php/%{lib_name_old}/Autoloader.php
+install -Dpm 755 bin/php-parse.php %{buildroot}%{_bindir}/php-parse
+
%check
%{_bindir}/phpunit
@@ -82,11 +89,15 @@ ln -s ../%{lib_name}/Autoloader.php \
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md doc grammar composer.json
+%{_bindir}/php-parse
%{_datadir}/php/%{lib_name_old}
%{_datadir}/php/%{lib_name}
%changelog
+* Wed Feb 25 2015 Remi Collet <remi@fedoraproject.org> - 1.1.0-2
+- provide the php-parse command
+
* Wed Feb 25 2015 Remi Collet <remi@fedoraproject.org> - 1.1.0-1
- update to 1.1.0
- use git snapshot as upstream tarball don't provide the test suite