File v8.spec of Package v8.2395
#
# spec file for package v8
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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: v8
Version: 3.22.24.8
Release: 0
Summary: JavaScript Engine
License: BSD-3-Clause
Group: System/Libraries
Url: http://code.google.com/p/v8
Source: http://gsdview.appspot.com/chromium-browser-official/%{name}-%{version}.tar.bz2
Patch1: fix-gcc48.patch
BuildRequires: gcc-c++
BuildRequires: libicu-devel >= 4.0
BuildRequires: lzma
BuildRequires: python-devel
BuildRequires: readline-devel
ExclusiveArch: %{ix86} x86_64 %arm
%global somajor `echo %{version} | cut -f1 -d'.'`
%global sominor `echo %{version} | cut -f2 -d'.'`
%global sobuild `echo %{version} | cut -f3 -d'.'`
%global sover %{somajor}.%{sominor}.%{sobuild}
%description
V8 is Google's open source JavaScript engine. V8 is written in C++ and is used
in Google Chrome, the open source browser from Google. V8 implements ECMAScript
as specified in ECMA-262, 3rd edition.
%package -n libv8-3
Summary: JavaScript Engine
Group: Development/Libraries/Other
Obsoletes: v8 < %{version}
Provides: v8 = %{version}
%description -n libv8-3
Libraries for v8.
%package devel
Summary: Development headers and libraries for v8
Group: Development/Libraries/Other
Requires: lib%{name}-3 = %{version}
%description devel
Development headers and libraries for v8.
%if 0%{?suse_version} > 1140 || 0%{?fedora_version}
%package private-headers-devel
Summary: Private Development headers for v8
Group: Development/Libraries/C and C++
Requires: %{name}-devel = %{version}
%description private-headers-devel
Special Private Development headers for v8.
%endif
%prep
%setup -q
%if 0%{?suse_version} > 1230
%patch1 -p0
%endif
%build
myconf+=" -Duse_system_icu=1
-Dcomponent=shared_library
-Dsoname_version=%{somajor}
-Dconsole=readline"
./build/gyp_v8 -f make build/all.gyp --depth . $myconf
env=CCFLAGS:"-fPIC"
MAKE_EXTRA_FLAGS=""
%ifarch armv7hl
MAKE_EXTRA_FLAGS+=hardfp=on
%endif
cd out
make %{?_smp_mflags} \
snapshots=on \
$MAKE_EXTRA_FLAGS \
BUILDTYPE=Release V=1
%install
%if 0%{?suse_version} > 1140 || 0%{?fedora_version}
mkdir -p %{buildroot}%{_includedir}/v8/x64
%else
mkdir -p %{buildroot}%{_includedir}
%endif
mkdir -p %{buildroot}%{_libdir}
install -p include/*.h %{buildroot}%{_includedir}
%if 0%{?suse_version} > 1140 || 0%{?fedora_version}
install -p src/*.h %{buildroot}%{_includedir}/v8
install -p src/x64/*.h %{buildroot}%{_includedir}/v8/x64
%endif
install -p out/out/Release/obj.target/tools/gyp/libv8.so* %{buildroot}%{_libdir}/
mkdir -p %{buildroot}%{_bindir}
install -p -m0755 out/out/Release/d8 %{buildroot}%{_bindir}
cd %{buildroot}%{_libdir}
ln -sf libv8.so.%{somajor} libv8.so
chmod -x %{buildroot}%{_includedir}/v8*.h
%post -n libv8-3 -p /sbin/ldconfig
%postun -n libv8-3 -p /sbin/ldconfig
%files -n libv8-3
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog LICENSE.* OWNERS
%{_bindir}/d8
%{_libdir}/*.so.*
%files devel
%defattr(-,root,root,-)
%{_includedir}/*.h
%{_libdir}/*.so
%if 0%{?suse_version} > 1140 || 0%{?fedora_version}
%files private-headers-devel
%defattr(644,root,root,-)
%{_includedir}/v8/
%endif
%changelog