File php5-pecl-v8js.spec of Package php5-pecl-v8js
#
# spec file for package php5-pecl-v8js
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012 Thomas Worm <thomas.worm@thomas-worm.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: php5-pecl-v8js
Version: 0.1.3
Release: 0
Summary: V8 Javascript Engine for PHP
License: PHP-3.0
Group: Development/Libraries/PHP
Url: http://pecl.php.net/package/v8js
Source0: http://pecl.php.net/get/v8js-%{version}.tgz
# PATCH-FIX-UPSTREAM v8js-alignedpointers.patch - Patch for fixing pointer alignment - Thomas Worm <thomas.worm@thomas-worm.de>
Patch1: v8js-alignedpointers.patch
# PATCH-FIX-UPSTREAM v8js-deprecated.patch - Patch for fixing deprecated cast - Thomas Worm <thomas.worm@thomas-worm.de>
Patch2: v8js-deprecated.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: php5
BuildRequires: php5-devel
BuildRequires: v8
BuildRequires: v8-devel
Requires: php5
Requires: v8
# BuildArch: noarch
ExclusiveArch: %{ix86} x86_64 %arm
%define extension_dir %{_libdir}/php5/extensions
%define php_sysconf %{_sysconfdir}/php5
%define extension_name v8js
%description
This extension embeds the Google's V8 Javascript Engine into PHP.
%prep
%setup -q -n %{extension_name}-%{version}
%if 0%{?suse_version} > 1220
%patch1
%endif
%patch2
%build
%{_bindir}/phpize
%if 0%{?suse_version} > 1220
%configure CXXFLAGS="-DV8_USE_UNSAFE_HANDLES=1" --with-%{extension_name}
%else
%configure --with-%{extension_name}
%endif
%{__make}
%check
%install
%{__make} install INSTALL_ROOT=%{buildroot}
mkdir -p %{buildroot}%{php_sysconf}/conf.d
echo "; comment out next line to disable %{extension_name} extension in php" > %{buildroot}%{php_sysconf}/conf.d/%{extension_name}.ini
echo "extension=%{extension_name}.so" >> %{buildroot}%{php_sysconf}/conf.d/%{extension_name}.ini
%clean
rm -rf %{buildroot}
%files
%defattr(644,root,root,755)
%{extension_dir}/%{extension_name}.so
%config(noreplace) %{php_sysconf}/conf.d/%{extension_name}.ini
%changelog