v8-vl.spec 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
  2. # For the 1.2 branch, we use 0s here
  3. # For 1.3+, we use the three digit versions
  4. %global somajor 2
  5. %global sominor 4
  6. %global sobuild 8
  7. %global sover %{somajor}.%{sominor}.%{sobuild}
  8. Name: v8
  9. Version: %{somajor}.%{sominor}.%{sobuild}
  10. Release: 1%{?_dist_release}
  11. Summary: JavaScript Engine
  12. Summary(ja): JavaScript エンジン
  13. Group: System Environment/Libraries
  14. License: BSD
  15. URL: http://code.google.com/p/v8
  16. # U=http://v8.googlecode.com/svn/trunk/
  17. # R=$(svn log $U |awk '/^r[0-9]* / {r=$1} /2\.4\.4/ {print r; exit}')
  18. # svn export -$R $U v8-2.4.8
  19. # tar cjf v8-2.4.8.tar.bz2 v8-2.4.8
  20. Source0: %{name}-%{version}.tar.bz2
  21. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  22. ExclusiveArch: %{ix86} x86_64 arm
  23. BuildRequires: scons, readline-devel
  24. %description
  25. V8 is Google's open source JavaScript engine. V8 is written in C++ and is used
  26. in Google Chrome, the open source browser from Google. V8 implements ECMAScript
  27. as specified in ECMA-262, 3rd edition.
  28. #'
  29. %description -l ja
  30. V8 は Google のオープンソース JavaScript エンジンです。
  31. V8 で C++ 書かれており、Google 発のオープンソースブラウザである
  32. Google Chrome で使われています。
  33. V8 は ECMA-262 第 3 版で指定されている ECMAScript を満たしています。
  34. %package devel
  35. Group: Development/Libraries
  36. Summary: Development headers and libraries for v8
  37. Requires: %{name} = %{version}-%{release}
  38. %description devel
  39. Development headers, libraries and tools for v8.
  40. %prep
  41. %setup -q
  42. # -fno-strict-aliasing is needed with gcc 4.4 to get past some ugly code
  43. PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS -fPIC -fno-strict-aliasing -Wno-unused-parameter\'| %__sed "s/ /',/g" | %__sed "s/',/', '/g"`
  44. %__sed -i "s|'-O3',|$PARSED_OPT_FLAGS,|g" SConstruct
  45. %build
  46. %if %{?_dist_release} == "vl6"
  47. export GCC_VERSION="44"
  48. %endif
  49. scons library=shared snapshots=on %{_smp_mflags} \
  50. %ifarch x86_64
  51. arch=x64 \
  52. %endif
  53. visibility=default \
  54. env=CCFLAGS:"-fPIC"
  55. # When will people learn to create versioned shared libraries by default?
  56. # first, lets get rid of the old .so
  57. %__rm -rf libv8.so
  58. # Now, lets make it right.
  59. %ifarch arm
  60. g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} obj/release/*.os obj/release/arm/*.os
  61. %endif
  62. %ifarch %{ix86}
  63. g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} obj/release/*.os obj/release/ia32/*.os
  64. %endif
  65. %ifarch x86_64
  66. g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} obj/release/*.os obj/release/x64/*.os
  67. %endif
  68. # We need to do this so d8 can link against it.
  69. %__ln_s -f libv8.so.%{sover} libv8.so
  70. scons d8 %{_smp_mflags} \
  71. %ifarch x86_64
  72. arch=x64 \
  73. %endif
  74. library=shared snapshots=on console=readline visibility=default
  75. # Ahem
  76. %__rm -rf d8
  77. 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
  78. %install
  79. %__rm -rf %{buildroot}
  80. %__mkdir_p %{buildroot}%{_includedir}
  81. %__mkdir_p %{buildroot}%{_libdir}
  82. %__install -p include/*.h %{buildroot}%{_includedir}
  83. %__install -p libv8.so.%{sover} %{buildroot}%{_libdir}
  84. %__mkdir_p %{buildroot}%{_bindir}
  85. %__install -p -m0755 d8 %{buildroot}%{_bindir}
  86. %__install -d %{buildroot}%{python_sitelib}
  87. %__install -pm644 tools/js2c.py %{buildroot}%{python_sitelib}
  88. %__install -pm644 tools/jsmin.py %{buildroot}%{python_sitelib}
  89. cd %{buildroot}%{_libdir}
  90. %__ln_s -f libv8.so.%{sover} libv8.so
  91. %__ln_s -f libv8.so.%{sover} libv8.so.%{somajor}
  92. %__ln_s -f libv8.so.%{sover} libv8.so.%{somajor}.%{sominor}
  93. %__chmod -x %{buildroot}%{_includedir}/v8*.h
  94. %clean
  95. %__rm -rf %{buildroot}
  96. %post -p /sbin/ldconfig
  97. %postun -p /sbin/ldconfig
  98. %files
  99. %defattr(-,root,root,-)
  100. %doc AUTHORS ChangeLog LICENSE
  101. %{_bindir}/d8
  102. %{_libdir}/*.so.*
  103. %files devel
  104. %defattr(-,root,root,-)
  105. %{_includedir}/*.h
  106. %{_libdir}/*.so
  107. %{python_sitelib}/*.py*
  108. %changelog
  109. * Sun Oct 10 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.4.8-1
  110. - initial build
  111. * Sat Sep 18 2010 Lubomir Rintel <lkundrak@v3.sk> - 2.4.4-1
  112. - Newer version
  113. - Package based on 2.3.11-1.20100831svn5385 by Tom "spot" Callaway
  114. * Wed Sep 15 2010 Lubomir Rintel <lkundrak@v3.sk> - 2.3.8-2
  115. - Package based on 2.3.11-1.20100831svn5385 by Tom "spot" Callaway