summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--PHPINFO4
-rw-r--r--REFLECTION2
-rw-r--r--php-zephir-parser.spec72
3 files changed, 54 insertions, 24 deletions
diff --git a/PHPINFO b/PHPINFO
index 2418cf3..88d4c98 100644
--- a/PHPINFO
+++ b/PHPINFO
@@ -5,5 +5,5 @@ Zephir Parser
The Zephir Parser delivered as a C extension for the PHP language.
Zephir Parser => enabled
Author => Zephir Team and contributors
-Version => 1.3.8
-Build Date => Sep 9 2021 00:00:00
+Version => 1.4.0
+Build Date => Sep 18 2021 00:00:00
diff --git a/REFLECTION b/REFLECTION
index e0b1c45..31daf3e 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #124 Zephir Parser version 1.3.8 ] {
+Extension [ <persistent> extension #124 Zephir Parser version 1.4.0 ] {
- Functions {
Function [ <internal:Zephir Parser> function zephir_parse_file ] {
diff --git a/php-zephir-parser.spec b/php-zephir-parser.spec
index ad0b117..2de72f6 100644
--- a/php-zephir-parser.spec
+++ b/php-zephir-parser.spec
@@ -17,31 +17,38 @@
#global gh_date 20161126
%global gh_owner phalcon
%global gh_project php-zephir-parser
-%global ext_name zephir_parser
+%global pecl_name zephir_parser
Name: %{?scl_prefix}%{gh_project}
-Version: 1.3.8
+Version: 1.4.0
Release: 1%{?gh_date:.%{gh_date}git%{gh_short}}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-Summary: Zephir parser extension
+Summary: Zephir code parser
License: MIT
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
+Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.0
+BuildRequires: %{?scl_prefix}php-pear
BuildRequires: re2c >= 0.13.6
-Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
-Requires: %{?scl_prefix}php(api) = %{php_core_api}
+Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
+Requires: %{?scl_prefix}php(api) = %{php_core_api}
%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
-Obsoletes: %{?scl_prefix}zephir-parser < 0.10
-Provides: %{?scl_prefix}zephir-parser = %{version}
+Obsoletes: %{?scl_prefix}zephir-parser < 0.10
+Provides: %{?scl_prefix}zephir-parser = %{version}
+# PECL
+Provides: %{?scl_prefix}php-pecl-zephir-parser = %{version}-%{release}
+Provides: %{?scl_prefix}php-pecl-zephir-parser%{?_isa} = %{version}-%{release}
+Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
+Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
%description
-The Zephir Parser delivered as a C extension for the PHP language.
+Zephir Parser is a code parser, delivered as a C extension
+for the PHP language.
%package devel
@@ -54,62 +61,85 @@ These are the files needed to compile programs using %{name}.
%prep
-%setup -q -n %{gh_project}-%{gh_commit}
+%setup -qc
+mv %{pecl_name}-%{version} NTS
+# Don't install/register tests
+sed -e 's/role="test"/role="src"/' \
+ %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
+ -i package.xml
+
+pushd NTS
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_ZEPHIR_PARSER_VERSION/{s/.* "//;s/".*$//;p}' zephir_parser.h)
if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then
: Error: Upstream extension version is ${extver}, expecting %{version}%{?gh_date:-dev}.
exit 1
fi
+popd
%build
%{?dtsenable}
+pushd NTS
%{_bindir}/phpize
%configure \
--with-php-config=%{_bindir}/php-config \
--enable-zephir_parser
make %{?_smp_mflags}
-
+popd
%install
%{?dtsenable}
-make install INSTALL_ROOT=%{buildroot}
+make -C NTS install INSTALL_ROOT=%{buildroot}
+
+# Install XML package description
+install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
+
+# 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
+pushd NTS
: Check extension
-%{_bindir}/php -n -d extension=modules/%{ext_name}.so -m | grep "Zephir Parser"
+%{_bindir}/php -n -d extension=modules/%{pecl_name}.so -m | grep "Zephir Parser"
%if %{with_tests}
: Run test suite
TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{ext_name}.so" \
+TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php --show-diff
%else
: Test suite disabled
%endif
+popd
%files
-%{!?_licensedir:%global license %%doc}
-%license LICENSE
-%doc CREDITS NO_WARRANTY
-%doc *.md
-%{php_extdir}/%{ext_name}.so
+%{?_licensedir:%license NTS/LICENSE}
+%doc %{pecl_docdir}/%{pecl_name}
+%{pecl_xmldir}/%{name}.xml
+%{php_extdir}/%{pecl_name}.so
%files devel
-%{php_incldir}/ext/%{ext_name}
-
+%{php_incldir}/ext/%{pecl_name}
%changelog
+* Sat Sep 18 2021 Remi Collet <remi@remirepo.net> - 1.4.0-1
+- update to 1.4.0
+- sources from pecl
+- open https://github.com/zephir-lang/php-zephir-parser/issues/127
+ please provides test in pecl archive
+
* Thu Sep 9 2021 Remi Collet <remi@remirepo.net> - 1.3.8-1
- update to 1.3.8