diff --git a/.gitignore b/.gitignore index 4dace64..be6b8a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +clog /php-ast-0.1.2-abfef40.tar.gz /php-ast-0.1.3-ae55a19.tar.gz /php-ast-0.1.4-701e853.tar.gz +/ast-0.1.5.tgz 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 -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-- -- -+= 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-- - - --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/php-ast.spec b/php-ast.spec index eb4affa..20467d9 100644 --- a/php-ast.spec +++ b/php-ast.spec @@ -20,18 +20,27 @@ Summary: Abstract Syntax Tree Name: php-ast -Version: 0.1.4 -Release: 4%{?dist} +Version: 0.1.5 +Release: 1%{?dist} 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: php-devel > 7 +BuildRequires: php-pear BuildRequires: php-tokenizer +# PECL +Provides: php-pecl-%{pecl_name} = %{version}-%{release} +Provides: php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} +Provides: php-pecl(%{pecl_name}) = %{version} +Provides: php-pecl(%{pecl_name})%{?_isa} = %{version} + Requires: php(zend-abi) = %{php_zend_api} Requires: php(api) = %{php_core_api} Requires: php-tokenizer%{?_isa} @@ -43,10 +52,19 @@ This extension exposes the abstract syntax tree generated by PHP 7. %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) @@ -87,6 +105,9 @@ make %{?_smp_mflags} %install +# 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} @@ -97,6 +118,10 @@ 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 @@ -131,10 +156,8 @@ REPORT_EXIT_STATUS=1 \ %files %license NTS/LICENSE -%doc NTS/README.md -%doc NTS/ast_stub.php -%doc NTS/scripts -%doc NTS/util.php +%doc %{pecl_docdir}/%{pecl_name} +%{pecl_xmldir}/%{name}.xml %config(noreplace) %{php_inidir}/%{ini_name} %{php_extdir}/%{pecl_name}.so @@ -146,8 +169,9 @@ REPORT_EXIT_STATUS=1 \ %changelog -* Thu Jul 27 2017 Fedora Release Engineering - 0.1.4-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild +* Tue Aug 1 2017 Remi Collet - 0.1.5-1 +- update to 0.1.5 (stable) +- sources from PECL * Wed Mar 29 2017 Remi Collet - 0.1.4-3 - add upstream patch for PHP 7.1.4RC1, fix FTBFS detected by Koschei diff --git a/sources b/sources index 49d493b..8e4e717 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (php-ast-0.1.4-701e853.tar.gz) = 2edf0cc56827972f3523ee19d9f1c6eeeed3d7ea9c674b488ec70202e22bae7e1e9ebc615f566b9e1a031b9fe6fb023eedf040cb657bbd76c3ee0d68162219b9 +SHA512 (ast-0.1.5.tgz) = b66a1bf6234a01f31fb2f741eb90f71f01feece87b678bcaaf2464a4c579db4cd8b603ed7f66c4b02b37a7c87af659fc605dfb90e18299c9a6510c47160adc6a