From 6229d64acd9badfbc4fbdcd86a63d1d9fc4e8421 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 1 Aug 2017 11:52:22 +0200 Subject: v0.1.5 (from PECL) --- php-ast.spec | 71 +++++++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 56 insertions(+), 15 deletions(-) (limited to 'php-ast.spec') 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 - 0.1.5-1 +- update to 0.1.5 (stable) +- sources from PECL + * Tue Jul 18 2017 Remi Collet - 0.1.4-4 - rebuild for PHP 7.2.0beta2 new API -- cgit