v8.spec 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. ##
  2. ## v8.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package information
  24. Name: v8
  25. Summary: V8 JavaScript Engine
  26. URL: http://code.google.com/p/v8/
  27. Vendor: Google Inc.
  28. Packager: OpenPKG Foundation e.V.
  29. Distribution: OpenPKG Community
  30. Class: EVAL
  31. Group: Language
  32. License: BSD
  33. Version: 3.13.5
  34. Release: 20120830
  35. # package options
  36. %option with_gyp yes
  37. # list of sources
  38. Source0: http://download.openpkg.org/components/versioned/v8/v8-%{version}.tar.bz2
  39. Patch0: v8.patch
  40. # build information
  41. BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, gcc::with_cxx = yes
  42. PreReq: OpenPKG, openpkg >= 20100101
  43. BuildPreReq: libexecinfo
  44. PreReq: libexecinfo
  45. %if "%{with_gyp}" == "yes"
  46. BuildPreReq: gyp
  47. %else
  48. BuildPreReq: scons
  49. %endif
  50. %description
  51. V8 is Google's Open-Source JavaScript engine. V8 is written in C++
  52. and is used in Google Chrome, the Open Source browser from Google.
  53. V8 implements ECMAScript as specified in ECMA-262, 5th edition, and
  54. runs on all major platform that use IA32, x64 or ARM processors. V8
  55. can run standalone, or can be embedded into any C++ application.
  56. %track
  57. prog v8 = {
  58. version = %{version}
  59. url = http://download.openpkg.org/components/versioned/v8/
  60. regex = v8-(__VER__)\.tar\.bz2
  61. }
  62. %prep
  63. %setup -q -n v8
  64. %patch -p0
  65. %build
  66. %if "%{with_gyp}" == "yes"
  67. %{l_shtool} subst -e 's;build/gyp/gyp;gyp;g' Makefile
  68. CC="%{l_cc} %{l_cflags -O} -I`pwd`/src %{l_cppflags}" \
  69. CXX="%{l_cxx} %{l_cxxflags -O} -I`pwd`/src %{l_cppflags}" \
  70. %{l_make} %{l_mflags} \
  71. native \
  72. snapshot=off \
  73. werror=no \
  74. strictaliasing=off
  75. %else
  76. %{l_shtool} subst \
  77. -e 's;/usr/local;%{l_prefix};g' \
  78. SConstruct
  79. CC="%{l_cc}" \
  80. CCFLAGS="%{l_cflags -O}" \
  81. CXX="%{l_cxx}" \
  82. CXXFLAGS="%{l_cxxflags -O}" \
  83. CPPFLAGS="-Isrc" \
  84. scons .
  85. %endif
  86. %install
  87. %{l_shtool} mkdir -f -p -m 755 \
  88. $RPM_BUILD_ROOT%{l_prefix}/bin \
  89. $RPM_BUILD_ROOT%{l_prefix}/include \
  90. $RPM_BUILD_ROOT%{l_prefix}/lib
  91. %if "%{with_gyp}" == "yes"
  92. %{l_shtool} install -c -s -m 755 \
  93. out/native/d8 $RPM_BUILD_ROOT%{l_prefix}/bin/
  94. %else
  95. %{l_shtool} install -c -s -m 755 \
  96. d8 $RPM_BUILD_ROOT%{l_prefix}/bin/
  97. %endif
  98. %{l_shtool} install -c -m 644 \
  99. include/*.h $RPM_BUILD_ROOT%{l_prefix}/include/
  100. %if "%{with_gyp}" == "yes"
  101. %{l_shtool} install -c -m 644 \
  102. out/native/obj.target/tools/gyp/libv8_base.a \
  103. $RPM_BUILD_ROOT%{l_prefix}/lib/libv8.a
  104. %else
  105. %{l_shtool} install -c -m 644 \
  106. libv8.a \
  107. $RPM_BUILD_ROOT%{l_prefix}/lib/
  108. %endif
  109. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  110. %files -f files
  111. %clean