summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-09-23 14:13:24 +0200
committerRemi Collet <fedora@famillecollet.com>2016-09-23 14:13:24 +0200
commitfca2c0c98e11bdf375105ff6c5f0d9688e3ba1ea (patch)
tree59580ad8c7d7bbdc2e0f5352e71351e0dc411244
parent14cfff92d567dee706d7a58b50f8dad4a339e4dd (diff)
php-pecl-v8js: 1.3.3, but still broken, even with v8 5.2 in F25+
-rw-r--r--php-pecl-v8js.spec104
1 files changed, 70 insertions, 34 deletions
diff --git a/php-pecl-v8js.spec b/php-pecl-v8js.spec
index 17809cc..64119f8 100644
--- a/php-pecl-v8js.spec
+++ b/php-pecl-v8js.spec
@@ -6,15 +6,18 @@
#
# Please, preserve the changelog entries
#
-%{!?php_inidir: %{expand: %%global php_inidir %{_sysconfdir}/php.d}}
-%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
+%if 0%{?scl:1}
+%global sub_prefix %{scl_prefix}
+%scl_package php-pecl-v8js
+%endif
-%global with_zts 0%{?__ztsphp:1}
-%global pecl_name v8js
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global pecl_name v8js
+%global ini_name 40-%{pecl_name}.ini
Summary: V8 Javascript Engine for PHP
Name: php-pecl-%{pecl_name}
-Version: 0.1.5
+Version: 1.3.3
Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: PHP
Group: Development/Languages
@@ -22,19 +25,34 @@ URL: http://pecl.php.net/package/%{pecl_name}
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: php-devel
+BuildRequires: php-devel > 7
BuildRequires: php-pear
-BuildRequires: v8-devel >= 3.17.11
+BuildRequires: v8-devel >= 4.6.76
+BuildRequires: chromium
-Requires(post): %{__pecl}
-Requires(postun): %{__pecl}
+Requires: chromium%{?_isa}
Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api}
+%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
+
+Provides: php-%{pecl_name} = %{version}
+Provides: php-%{pecl_name}%{?_isa} = %{version}
+Provides: php-pecl(%{pecl_name}) = %{version}
+Provides: php-pecl(%{pecl_name})%{?_isa} = %{version}
+%if "%{?scl_prefix}" != "%{?sub_prefix}"
+Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
+Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
+%endif
-Provides: php-%{pecl_name} = %{version}
-Provides: php-%{pecl_name}%{?_isa} = %{version}
-Provides: php-pecl(%{pecl_name}) = %{version}
-Provides: php-pecl(%{pecl_name})%{?_isa} = %{version}
+%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1}
+# Other third party repo stuff
+Obsoletes: php70u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php70w-pecl-%{pecl_name} <= %{version}
+%if "%{php_version}" > "7.1"
+Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php71w-pecl-%{pecl_name} <= %{version}
+%endif
+%endif
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
# Filter shared private
@@ -48,18 +66,24 @@ This extension embeds the Google's V8 Javascript Engine into PHP.
Documentation: http://php.net/v8js
+Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}.
+
%prep
%setup -q -c
mv %{pecl_name}-%{version} NTS
-cd NTS
+# Don't install/register tests
+sed -e 's/role="test"/role="src"/' \
+ %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
+ -i package.xml
-# Fix version
-sed -e '/V8JS_VERSION/s/0.1.3/%{version}/' -i php_v8js_macros.h
+cd NTS
+# Fix config script, use blob from chromium
+sed -e '/SEARCH_PATH/s:share/v8:$PHP_LIBDIR/chromium-browser:' -i config.m4
# Sanity check, really often broken
-extver=$(sed -n '/#define V8JS_VERSION/{s/.* "//;s/".*$//;p}' php_v8js_macros.h)
+extver=$(sed -n '/#define PHP_V8JS_VERSION/{s/.* "//;s/".*$//;p}' php_v8js_macros.h)
if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then
: Error: Upstream extension version is ${extver}, expecting %{version}%{?prever:-%{prever}}.
exit 1
@@ -72,7 +96,7 @@ cp -pr NTS ZTS
%endif
# Create configuration file
-cat > %{pecl_name}.ini << 'EOF'
+cat << 'EOF' | tee %{ini_name}
; Enable %{pecl_name} extension module
extension=%{pecl_name}.so
@@ -84,8 +108,7 @@ extension=%{pecl_name}.so
; Sets V8 command line flags. The list of available flags can be obtained
; in CLI mode by setting this parameter to --help.
-;v8js.flags =
-
+;v8js.flags = ''
EOF
@@ -115,7 +138,7 @@ rm -rf %{buildroot}
make -C NTS install INSTALL_ROOT=%{buildroot}
# install config file
-install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_inidir}/%{pecl_name}.ini
+install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
# Install XML package description
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
@@ -123,25 +146,39 @@ install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
%if %{with_zts}
make -C ZTS install INSTALL_ROOT=%{buildroot}
-install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini
+install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
+%{_bindir}/php --no-php-ini \
+ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
+ --re %{pecl_name} > REFLECTION
-%post
-%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+%if 0%{?fedora} < 24
+# when pear installed alone, after us
+%triggerin -- %{?scl_prefix}php-pear
+if [ -x %{__pecl} ] ; then
+ %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+fi
+
+# posttrans as pear can be installed after us
+%posttrans
+if [ -x %{__pecl} ] ; then
+ %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
+fi
%postun
-if [ $1 -eq 0 ] ; then
+if [ $1 -eq 0 -a -x %{__pecl} ] ; then
%{pecl_uninstall} %{pecl_name} >/dev/null || :
fi
+%endif
%check
: Minimal load test for NTS extension
cd NTS
%{_bindir}/php --no-php-ini \
- --define extension=modules/%{pecl_name}.so \
+ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep %{pecl_name}
: Upstream test suite for NTS extension
@@ -156,7 +193,7 @@ REPORT_EXIT_STATUS=1 \
: Minimal load test for ZTS extension
cd ../ZTS
%{__ztsphp} --no-php-ini \
- --define extension=modules/%{pecl_name}.so \
+ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--modules | grep %{pecl_name}
: Upstream test suite for ZTS extension
@@ -168,13 +205,9 @@ REPORT_EXIT_STATUS=1 \
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
-%doc NTS/{LICENSE,CREDITS}
+%{?_licensedir:%license NTS/LICENSE}
+%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{pecl_name}.ini
%{php_extdir}/%{pecl_name}.so
@@ -186,5 +219,8 @@ rm -rf %{buildroot}
%changelog
-* Sun Oct 6 2013 Remi Collet <remi@fedoraproject.org> - 1.3.2-1
+* Fri Sep 23 2016 Remi Collet <remi@fedoraproject.org> - 1.3.2-1
+- update to 1.3.3, for PHP 7
+
+* Sun Oct 6 2013 Remi Collet <remi@fedoraproject.org> - 0.1.5-1
- initial package, version 0.1.5 (beta)