File v8-3.12.spec of Package v8-3.12

%define bname v8
%define ver 3.12
Name: %bname-%ver
Version: 19
Release: 2
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/%bname-%ver.%version.tar.xz
Patch: %bname-%ver.%version-git.patch
Requires: lib%name = %version-%release
BuildRequires: gcc-c++ readline-devel gyp
ExclusiveArch: %ix86 x86_64 %arm

%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 lib%name
Summary: JavaScript Engine
Group: Development/Libraries/Other

%description -n lib%name
Libraries for v8.


%package devel
Summary: Development headers and libraries for v8
Group: Development/Libraries/Other
Requires: lib%name = %version-%release
Provides: %bname-devel = %ver.%version-%release
Provides: lib%bname-devel = %ver.%version-%release

%description devel
Development headers and libraries for v8.


%prep
%setup -q -n %bname-%ver.%version
%patch -p1
sed -i \
	"/'cflags':.*'-Wall'/a'-Wno-unused-local-typedefs', '-Wno-aggressive-loop-optimizations', '-Wno-strict-overflow'," \
	build/standalone.gypi


%build
./build/gyp_v8 -f make build/all.gyp --depth . \
	-Dcomponent=shared_library \
	-Dsoname_version=%ver \
	-Ddebuggersupport=off \
	-Dconsole=readline
make -C out %{?_smp_mflags} snapshots=on BUILDTYPE=Release V=1

gzip -9c ChangeLog > ChangeLog.gz


%install
install -d -m 0755 %buildroot{%_bindir,%_libdir,%_includedir/%bname/x64}
install -p -m 0644 include/*.h %buildroot%_includedir

install -p -m 0644 src/*.h %buildroot%_includedir/%bname
install -p -m 0644 src/x64/*.h %buildroot%_includedir/%bname/x64

install -p -m 0755 out/out/Release/obj.target/tools/gyp/lib%bname.so* %buildroot%_libdir/
install -p -m 0755 out/out/Release/d8 %buildroot%_bindir

ln -sf lib%bname.so.%ver %buildroot%_libdir/lib%bname.so


%post -n lib%name -p /sbin/ldconfig
%postun -n lib%name -p /sbin/ldconfig


%files
%defattr(-,root,root)
%_bindir/*


%files -n lib%name
%defattr(-,root,root)
%doc AUTHORS ChangeLog.* LICENSE*
%_libdir/*.so.*


%files devel
%defattr(-,root,root)
%_includedir/*
%_libdir/*.so


%changelog
openSUSE Build Service is sponsored by