%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} # For the 1.2 branch, we use 0s here # For 1.3+, we use the three digit versions %global somajor 2 %global sominor 4 %global sobuild 9 %global sover %{somajor}.%{sominor}.%{sobuild} %define svnrevision 5631 Name: v8 Version: %{sover} Release: 1%{?svnrevision:.svn%svnrevision}%{?_dist_release} Summary: JavaScript Engine Summary(ja): JavaScript エンジン Group: System Environment/Libraries License: BSD URL: http://code.google.com/p/v8 # U=http://v8.googlecode.com/svn/trunk/ # R=$(svn log $U |awk '/^r[0-9]* / {r=$1} /2\.4\.8/ {print r; exit}') # svn export -$R $U v8-2.4.8 # tar cjf v8-2.4.8.tar.bz2 v8-2.4.8 Source0: %{name}-%{version}%{?svnrevision:.svn%svnrevision}.tar.bz2 Source10: v8-snapshot.sh BuildRoot: %{_tmppath}/%{name}-%{version}-root ExclusiveArch: %{ix86} x86_64 arm BuildRequires: scons BuildRequires: readline-devel %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. #' %description -l ja V8 は Google のオープンソース JavaScript エンジンです。 V8 で C++ 書かれており、Google 発のオープンソースブラウザである Google Chrome で使われています。 V8 は ECMA-262 第 3 版で指定されている ECMAScript を満たしています。 %package devel Group: Development/Libraries Summary: Development headers and libraries for v8 Requires: %{name} = %{version}-%{release} %description devel Development headers, libraries and tools for v8. %prep %setup -q # -fno-strict-aliasing is needed with gcc 4.4 to get past some ugly code PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS -fPIC -fno-strict-aliasing -Wno-unused-parameter\'| %__sed "s/ /',/g" | %__sed "s/',/', '/g"` %__sed -i "s|'-O3',|$PARSED_OPT_FLAGS,|g" SConstruct %build %if %{?_dist_release} == "vl6" export GCC_VERSION="44" %endif scons library=shared snapshots=on %{_smp_mflags} \ %ifarch x86_64 arch=x64 \ %endif visibility=default \ env=CCFLAGS:"-fPIC" # When will people learn to create versioned shared libraries by default? # first, lets get rid of the old .so %__rm -rf libv8.so # Now, lets make it right. %ifarch arm g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} obj/release/*.os obj/release/arm/*.os %endif %ifarch %{ix86} g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} obj/release/*.os obj/release/ia32/*.os %endif %ifarch x86_64 g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} obj/release/*.os obj/release/x64/*.os %endif # We need to do this so d8 can link against it. %__ln_s -f libv8.so.%{sover} libv8.so scons d8 %{_smp_mflags} \ %ifarch x86_64 arch=x64 \ %endif library=shared snapshots=on console=readline visibility=default # Ahem %__rm -rf d8 g++ $RPM_OPT_FLAGS -o d8 obj/release/d8-debug.os obj/release/d8-posix.os obj/release/d8-readline.os obj/release/d8.os obj/release/d8-js.os -lpthread -lreadline -lpthread -L. -lv8 %install %__rm -rf %{buildroot} %__mkdir_p %{buildroot}%{_includedir} %__mkdir_p %{buildroot}%{_libdir} %__install -p include/*.h %{buildroot}%{_includedir} %__install -p libv8.so.%{sover} %{buildroot}%{_libdir} %__mkdir_p %{buildroot}%{_bindir} %__install -p -m0755 d8 %{buildroot}%{_bindir} %__install -d %{buildroot}%{python_sitelib} %__install -pm644 tools/js2c.py %{buildroot}%{python_sitelib} %__install -pm644 tools/jsmin.py %{buildroot}%{python_sitelib} cd %{buildroot}%{_libdir} %__ln_s -f libv8.so.%{sover} libv8.so %__ln_s -f libv8.so.%{sover} libv8.so.%{somajor} %__ln_s -f libv8.so.%{sover} libv8.so.%{somajor}.%{sominor} %__chmod -x %{buildroot}%{_includedir}/v8*.h %clean %__rm -rf %{buildroot} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-,root,root,-) %doc AUTHORS ChangeLog LICENSE %{_bindir}/d8 %{_libdir}/*.so.* %files devel %defattr(-,root,root,-) %{_includedir}/*.h %{_libdir}/*.so %{python_sitelib}/*.py* %changelog * Sat Oct 16 2010 Munehiro Yamamoto - 2.4.9-1.svn5631 - source 2.4.9 rev.5631 * Sun Oct 10 2010 Munehiro Yamamoto - 2.4.8-1 - initial build * Sat Sep 18 2010 Lubomir Rintel - 2.4.4-1 - Newer version - Package based on 2.3.11-1.20100831svn5385 by Tom "spot" Callaway * Wed Sep 15 2010 Lubomir Rintel - 2.3.8-2 - Package based on 2.3.11-1.20100831svn5385 by Tom "spot" Callaway