summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore5
-rw-r--r--0aa5b47574a6c4e6a034bfdb41a91f4a0699fb9d.patch44
-rw-r--r--REFLECTION29
-rw-r--r--php-ast.spec71
4 files changed, 86 insertions, 63 deletions
diff --git a/.gitignore b/.gitignore
index d820c84..1ab5c4f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,7 @@
+package-*.xml
+*.tgz
*.tar.gz
+*.tar.xz
+*.tar.xz.asc
*.src.rpm
+*/*rpm
diff --git a/0aa5b47574a6c4e6a034bfdb41a91f4a0699fb9d.patch b/0aa5b47574a6c4e6a034bfdb41a91f4a0699fb9d.patch
deleted file mode 100644
index 062543e..0000000
--- a/0aa5b47574a6c4e6a034bfdb41a91f4a0699fb9d.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 0aa5b47574a6c4e6a034bfdb41a91f4a0699fb9d Mon Sep 17 00:00:00 2001
-From: Nikita Popov <nikita.ppv@gmail.com>
-Date: Fri, 17 Mar 2017 18:20:25 +0100
-Subject: [PATCH] Fix ast_dump_with_linenos.phpt test
-
----
- tests/ast_dump_with_linenos.phpt | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/tests/ast_dump_with_linenos.phpt b/tests/ast_dump_with_linenos.phpt
-index 2b7c67a..abba57a 100644
---- a/tests/ast_dump_with_linenos.phpt
-+++ b/tests/ast_dump_with_linenos.phpt
-@@ -1,7 +1,11 @@
- --TEST--
- ast_dump() with AST_DUMP_LINENOS
- --SKIPIF--
--<?php if (!extension_loaded("ast")) print "skip"; ?>
-+<?php
-+if (!extension_loaded("ast")) print "skip";
-+if (PHP_VERSION_ID >= 70000 && PHP_VERSION_ID < 70018) print "skip buggy PHP version";
-+if (PHP_VERSION_ID >= 70100 && PHP_VERSION_ID < 70104) print "skip buggy PHP version";
-+?>
- --FILE--
- <?php
-
-@@ -22,8 +26,6 @@ PHP;
- $ast = ast\parse_code($code, $version=30);
- echo ast_dump($ast, AST_DUMP_LINENOS);
-
--// The lineno for AST_ARG_LIST is wrong...
--
- ?>
- --EXPECT--
- AST_STMT_LIST @ 1
-@@ -37,7 +39,7 @@ AST_STMT_LIST @ 1
- expr: AST_NAME @ 6
- flags: NAME_NOT_FQ (1)
- name: "var_dump"
-- args: AST_ARG_LIST @ 8
-+ args: AST_ARG_LIST @ 7
- 0: AST_VAR @ 7
- name: "foo"
- returnType: null
diff --git a/REFLECTION b/REFLECTION
index 9f1b4e8..9989ed9 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,6 +1,6 @@
-Extension [ <persistent> extension #75 ast version 0.1.4 ] {
+Extension [ <persistent> extension #75 ast version 0.1.5 ] {
- - Constants [187] {
+ - Constants [190] {
Constant [ integer ast\AST_ARG_LIST ] { 128 }
Constant [ integer ast\AST_LIST ] { 129 }
Constant [ integer ast\AST_ARRAY ] { 130 }
@@ -110,6 +110,9 @@ Extension [ <persistent> extension #75 ast version 0.1.4 ] {
Constant [ integer ast\flags\MODIFIER_ABSTRACT ] { 2 }
Constant [ integer ast\flags\MODIFIER_FINAL ] { 4 }
Constant [ integer ast\flags\RETURNS_REF ] { 67108864 }
+ Constant [ integer ast\flags\FUNC_RETURNS_REF ] { 67108864 }
+ Constant [ integer ast\flags\FUNC_GENERATOR ] { 8388608 }
+ Constant [ integer ast\flags\CLOSURE_USE_REF ] { 1 }
Constant [ integer ast\flags\CLASS_ABSTRACT ] { 32 }
Constant [ integer ast\flags\CLASS_FINAL ] { 4 }
Constant [ integer ast\flags\CLASS_TRAIT ] { 128 }
@@ -239,7 +242,16 @@ Extension [ <persistent> extension #75 ast version 0.1.4 ] {
Property [ <default> public $children ]
}
- - Methods [0] {
+ - Methods [1] {
+ Method [ <internal:ast, ctor> public method __construct ] {
+
+ - Parameters [4] {
+ Parameter #0 [ <optional> $kind ]
+ Parameter #1 [ <optional> $flags ]
+ Parameter #2 [ <optional> array or NULL $children ]
+ Parameter #3 [ <optional> $lineno ]
+ }
+ }
}
}
@@ -264,7 +276,16 @@ Extension [ <persistent> extension #75 ast version 0.1.4 ] {
Property [ <default> public $docComment ]
}
- - Methods [0] {
+ - Methods [1] {
+ Method [ <internal:ast, inherits ast\Node, ctor> public method __construct ] {
+
+ - Parameters [4] {
+ Parameter #0 [ <optional> $kind ]
+ Parameter #1 [ <optional> $flags ]
+ Parameter #2 [ <optional> array or NULL $children ]
+ Parameter #3 [ <optional> $lineno ]
+ }
+ }
}
}
}
diff --git a/php-ast.spec b/php-ast.spec
index cafe4d8..92616ac 100644
--- a/php-ast.spec
+++ b/php-ast.spec
@@ -20,20 +20,23 @@
Summary: Abstract Syntax Tree
Name: %{?scl_prefix}php-ast
-Version: 0.1.4
+Version: 0.1.5
%if 0%{?gh_date:1}
Release: 0.3.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
%else
-Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
%endif
License: BSD
Group: Development/Languages
URL: https://github.com/%{gh_owner}/%{gh_project}
+%if 0%{?gh_date}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
-
-Patch0: 0aa5b47574a6c4e6a034bfdb41a91f4a0699fb9d.patch
+%else
+Source0: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz
+%endif
BuildRequires: %{?scl_prefix}php-devel > 7
+BuildRequires: %{?scl_prefix}php-pear
BuildRequires: %{?scl_prefix}php-tokenizer
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
@@ -41,12 +44,32 @@ Requires: %{?scl_prefix}php(api) = %{php_core_api}
Requires: %{?scl_prefix}php-tokenizer%{?_isa}
%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
+%if "%{?scl_prefix}" != "%{?sub_prefix}"
+Provides: %{?scl_prefix}php-%{pecl_name} = %{version}-%{release}
+Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}-%{release}
+%endif
+# PECL
+Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
+Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
+Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
+Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
+
%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-Obsoletes: php70u-%{pecl_name} <= %{version}
-Obsoletes: php70w-%{pecl_name} <= %{version}
+Obsoletes: php70u-%{pecl_name} <= %{version}
+Obsoletes: php70u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php70w-%{pecl_name} <= %{version}
+Obsoletes: php70w-pecl-%{pecl_name} <= %{version}
%if "%{php_version}" > "7.1"
-Obsoletes: php71u-%{pecl_name} <= %{version}
-Obsoletes: php71w-%{pecl_name} <= %{version}
+Obsoletes: php71u-%{pecl_name} <= %{version}
+Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php71w-%{pecl_name} <= %{version}
+Obsoletes: php71w-pecl-%{pecl_name} <= %{version}
+%endif
+%if "%{php_version}" > "7.2"
+Obsoletes: php72u-%{pecl_name} <= %{version}
+Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php72w-%{pecl_name} <= %{version}
+Obsoletes: php72w-pecl-%{pecl_name} <= %{version}
%endif
%endif
@@ -65,10 +88,19 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -qc
+%if 0%{?gh_date}
mv %{gh_project}-%{gh_commit} NTS
+mv NTS/package.xml .
+%else
+mv %{pecl_name}-%{version}%{?prever} NTS
+%endif
+
+# Don't install/register tests
+sed -e 's/role="test"/role="src"/' \
+ %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
+ -i package.xml
cd NTS
-%patch0 -p1 -b .upstream
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_AST_VERSION/{s/.* "//;s/".*$//;p}' php_ast.h)
@@ -113,6 +145,9 @@ make %{?_smp_mflags}
%install
%{?dtsenable}
+# Install XML package description
+install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
+
# Install the NTS stuff
make -C NTS install INSTALL_ROOT=%{buildroot}
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
@@ -123,6 +158,11 @@ make -C ZTS install INSTALL_ROOT=%{buildroot}
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
+# Documentation
+for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
+do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+done
+
%check
@@ -156,12 +196,9 @@ REPORT_EXIT_STATUS=1 \
%files
-%{!?_licensedir:%global license %%doc}
-%license NTS/LICENSE
-%doc NTS/README.md
-%doc NTS/ast_stub.php
-%doc NTS/scripts
-%doc NTS/util.php
+%{?_licensedir:%license NTS/LICENSE}
+%doc %{pecl_docdir}/%{pecl_name}
+%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}
%{php_extdir}/%{pecl_name}.so
@@ -173,6 +210,10 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Tue Aug 1 2017 Remi Collet <remi@remirepo.net> - 0.1.5-1
+- update to 0.1.5 (stable)
+- sources from PECL
+
* Tue Jul 18 2017 Remi Collet <remi@remirepo.net> - 0.1.4-4
- rebuild for PHP 7.2.0beta2 new API