]>
Commit | Line | Data |
---|---|---|
adb1d2b8 | 1 | # |
2 | # TODO: fix readline | |
3 | # | |
4 | ||
ce2a821c | 5 | %define sover %(v=%{version}; echo ${v%.*}) |
d782de0a | 6 | %define somajor %(v=%{version}; echo ${v%%%%.*}) |
b8bbb50f AM |
7 | Summary: JavaScript Engine |
8 | Name: v8 | |
adb1d2b8 | 9 | Version: 3.3.6.1 |
072048aa | 10 | Release: 1 |
ce2a821c | 11 | License: New BSD License |
b8bbb50f AM |
12 | Group: Libraries |
13 | URL: http://code.google.com/p/v8 | |
14 | # No tarballs, pulled from svn | |
adb1d2b8 | 15 | # svn export http://v8.googlecode.com/svn/tags/%{version} v8-%{version} |
ce2a821c | 16 | Source0: http://distfiles.gentoo.org/distfiles/%{name}-%{version}.tar.gz |
adb1d2b8 | 17 | # Source0-md5: b8504e98681669c95738724717c4e93f |
18 | #Patch1: %{name}-2.0.0-d8-allocation.patch | |
ffa963bd | 19 | Patch2: %{name}-cstdio.patch |
20 | Patch3: %{name}-strndup.patch | |
adb1d2b8 | 21 | Patch4: %{name}-soname.patch |
22 | Patch5: %{name}-dynlink.patch | |
982929a0 | 23 | BuildRequires: libstdc++-devel >= 5:4.0 |
7594b47f | 24 | BuildRequires: readline-devel |
b8bbb50f | 25 | BuildRequires: scons |
c894b44e | 26 | ExclusiveArch: %{ix86} %{x8664} arm |
b8bbb50f AM |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
28 | ||
29 | %description | |
30 | V8 is Google's open source JavaScript engine. V8 is written in C++ and | |
31 | is used in Google Chrome, the open source browser from Google. V8 | |
32 | implements ECMAScript as specified in ECMA-262, 3rd edition. | |
33 | ||
37bf3af8 ER |
34 | This package contains the command line program. |
35 | ||
36 | %package libs | |
37 | Summary: V8 JavaScript Engine shared library | |
38 | Group: Libraries | |
39 | Conflicts: v8 < 2.0.0 | |
40 | ||
41 | %description libs | |
42 | V8 is Google's open source JavaScript engine. V8 is written in C++ and | |
43 | is used in Google Chrome, the open source browser from Google. V8 | |
44 | implements ECMAScript as specified in ECMA-262, 3rd edition. | |
45 | ||
46 | This package contains the shared library. | |
47 | ||
b8bbb50f AM |
48 | %package devel |
49 | Summary: Development headers and libraries for v8 | |
50 | Group: Development/Libraries | |
37bf3af8 | 51 | Requires: %{name}-libs = %{version}-%{release} |
b8bbb50f AM |
52 | |
53 | %description devel | |
54 | Development headers and libraries for v8. | |
55 | ||
56 | %prep | |
ce2a821c | 57 | %setup -q |
ffa963bd | 58 | %patch2 -p1 |
59 | %patch3 -p1 | |
adb1d2b8 | 60 | %patch4 -p1 |
61 | %patch5 -p1 | |
7594b47f | 62 | %{__sed} -i -e "s,'-O3','%{rpmcxxflags}'.split(' ')," SConstruct |
b8bbb50f AM |
63 | |
64 | %build | |
5e90f260 | 65 | # build library |
ffa963bd | 66 | |
67 | CFLAGS="%{rpmcflags}" | |
68 | CXXFLAGS="%{rpmcxxflags}" | |
69 | LDFLAGS="%{rpmcflags}" | |
70 | %if "%{pld_release}" == "ac" | |
ce2a821c ER |
71 | CC="%{__cc}4" |
72 | CXX="%{__cxx}4" | |
ffa963bd | 73 | %else |
ce2a821c ER |
74 | CC="%{__cc}" |
75 | CXX="%{__cxx}" | |
ffa963bd | 76 | %endif |
77 | export CFLAGS LDFLAGS CXXFLAGS CC CXX | |
b8bbb50f | 78 | %scons \ |
c894b44e ER |
79 | library=shared \ |
80 | snapshots=on \ | |
adb1d2b8 | 81 | soname=on \ |
7594b47f | 82 | console=readline \ |
5e90f260 | 83 | visibility=default \ |
b8bbb50f | 84 | %ifarch x86_64 |
c894b44e | 85 | arch=x64 \ |
b8bbb50f | 86 | %endif |
c894b44e ER |
87 | env=CCFLAGS:"-fPIC" |
88 | ||
adb1d2b8 | 89 | mv libv8.so libv8.so.%{sover} |
b8bbb50f | 90 | |
5e90f260 ER |
91 | # We need to do this so d8 binary can link against it. |
92 | ln -sf libv8.so.%{sover} libv8.so | |
93 | ||
94 | # build binary | |
95 | %scons d8 \ | |
96 | library=shared \ | |
97 | snapshots=on \ | |
adb1d2b8 | 98 | console=dumb \ |
5e90f260 ER |
99 | visibility=default \ |
100 | %ifarch x86_64 | |
101 | arch=x64 \ | |
102 | %endif | |
103 | env=CCFLAGS:"-fPIC" | |
104 | ||
b8bbb50f AM |
105 | %install |
106 | rm -rf $RPM_BUILD_ROOT | |
5e90f260 | 107 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir},%{_libdir}} |
adb1d2b8 | 108 | install -p d8 $RPM_BUILD_ROOT%{_bindir}/v8 |
c894b44e ER |
109 | cp -a include/*.h $RPM_BUILD_ROOT%{_includedir} |
110 | install -p libv8.so.*.*.* $RPM_BUILD_ROOT%{_libdir} | |
b8bbb50f | 111 | |
c894b44e ER |
112 | lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libv8.so.*.*.*) |
113 | ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libv8.so | |
d782de0a | 114 | ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libv8.so.%{somajor} |
b8bbb50f AM |
115 | |
116 | %clean | |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | ||
37bf3af8 ER |
119 | %post libs -p /sbin/ldconfig |
120 | %postun libs -p /sbin/ldconfig | |
b8bbb50f AM |
121 | |
122 | %files | |
123 | %defattr(644,root,root,755) | |
124 | %doc AUTHORS ChangeLog LICENSE | |
5e90f260 | 125 | %attr(755,root,root) %{_bindir}/v8 |
37bf3af8 ER |
126 | |
127 | %files libs | |
982929a0 | 128 | %defattr(644,root,root,755) |
c894b44e | 129 | %attr(755,root,root) %{_libdir}/libv8.so.*.*.* |
d782de0a | 130 | %attr(755,root,root) %ghost %{_libdir}/libv8.so.3 |
b8bbb50f AM |
131 | |
132 | %files devel | |
133 | %defattr(644,root,root,755) | |
c894b44e | 134 | %attr(755,root,root) %{_libdir}/libv8.so |
b8bbb50f | 135 | %{_includedir}/*.h |