1 | %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} |
---|
2 | |
---|
3 | %global somajor 3 |
---|
4 | %global sominor 0 |
---|
5 | %global sobuild 4 |
---|
6 | %global sover %{somajor}.%{sominor}.%{sobuild} |
---|
7 | |
---|
8 | %define svnrevision 6102 |
---|
9 | |
---|
10 | Name: v8 |
---|
11 | Version: %{sover} |
---|
12 | Release: 1%{?svnrevision:.svn%svnrevision}%{?_dist_release} |
---|
13 | Provides: lib%{name} = %{version}-%{release} |
---|
14 | Summary: JavaScript Engine |
---|
15 | Summary(ja): JavaScript エンジン |
---|
16 | Group: System Environment/Libraries |
---|
17 | License: BSD |
---|
18 | URL: http://code.google.com/p/v8 |
---|
19 | Source0: %{name}-%{version}%{?svnrevision:.svn%svnrevision}.tar.bz2 |
---|
20 | Source10: v8-snapshot.sh |
---|
21 | Patch0: v8-2.5.9-buildfix.patch |
---|
22 | |
---|
23 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
---|
24 | ExclusiveArch: %{ix86} x86_64 arm |
---|
25 | |
---|
26 | BuildRequires: scons |
---|
27 | BuildRequires: readline-devel |
---|
28 | |
---|
29 | %description |
---|
30 | V8 is Google's open source JavaScript engine. V8 is written in C++ and is used |
---|
31 | in Google Chrome, the open source browser from Google. V8 implements ECMAScript |
---|
32 | as specified in ECMA-262, 3rd edition. |
---|
33 | #' |
---|
34 | |
---|
35 | %description -l ja |
---|
36 | V8 は Google のオープンソース JavaScript エンジンです。 |
---|
37 | V8 で C++ 書かれており、Google 発のオープンソースブラウザである |
---|
38 | Google Chrome で使われています。 |
---|
39 | V8 は ECMA-262 第 3 版で指定されている ECMAScript を満たしています。 |
---|
40 | |
---|
41 | %package devel |
---|
42 | Group: Development/Libraries |
---|
43 | Summary: Development headers and libraries for v8 |
---|
44 | Requires: %{name} = %{version}-%{release} |
---|
45 | Provides: lib%{name}-devel = %{version}-%{release} |
---|
46 | |
---|
47 | %description devel |
---|
48 | Development headers, libraries and tools for v8. |
---|
49 | |
---|
50 | |
---|
51 | %prep |
---|
52 | %setup -q |
---|
53 | %patch0 -p0 -b .orig |
---|
54 | |
---|
55 | # -fno-strict-aliasing is needed with gcc 4.4 to get past some ugly code |
---|
56 | PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS \' | %__sed "s/ /',/g" | %__sed "s/',/', '/g"` |
---|
57 | %__sed -i "s|'-O3',|$PARSED_OPT_FLAGS '-fno-strict-aliasing',|g" SConstruct |
---|
58 | |
---|
59 | |
---|
60 | %build |
---|
61 | %if %{?_dist_release} == "vl6" |
---|
62 | export GCC_VERSION="44" |
---|
63 | %endif |
---|
64 | scons library=shared snapshots=on %{_smp_mflags} \ |
---|
65 | %ifarch x86_64 |
---|
66 | arch=x64 \ |
---|
67 | %endif |
---|
68 | visibility=default \ |
---|
69 | env=CCFLAGS:"-fPIC" |
---|
70 | |
---|
71 | # When will people learn to create versioned shared libraries by default? |
---|
72 | # first, lets get rid of the old .so |
---|
73 | %__rm -f libv8.so |
---|
74 | # Now, lets make it right. |
---|
75 | %__cxx $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared \ |
---|
76 | -Wl,-soname,libv8.so.%{somajor} \ |
---|
77 | obj/release/*.os \ |
---|
78 | obj/release/extensions/*.os \ |
---|
79 | %ifarch arm |
---|
80 | obj/release/arm/*.os \ |
---|
81 | %endif |
---|
82 | %ifarch %{ix86} |
---|
83 | obj/release/ia32/*.os \ |
---|
84 | %endif |
---|
85 | %ifarch x86_64 |
---|
86 | obj/release/x64/*.os \ |
---|
87 | %endif |
---|
88 | ; |
---|
89 | # We need to do this so d8 can link against it. |
---|
90 | %__ln_s -f libv8.so.%{sover} libv8.so |
---|
91 | |
---|
92 | scons d8 %{_smp_mflags} \ |
---|
93 | %ifarch x86_64 |
---|
94 | arch=x64 \ |
---|
95 | %endif |
---|
96 | library=shared snapshots=on console=readline visibility=default |
---|
97 | |
---|
98 | # Ahem |
---|
99 | %__rm -f d8 |
---|
100 | |
---|
101 | %__cxx $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 |
---|
102 | |
---|
103 | |
---|
104 | %install |
---|
105 | %__rm -rf %{buildroot} |
---|
106 | |
---|
107 | [ -f libv8.so ] && [ ! -f libv8.so.%{sover} ] && %__mv libv8.so libv8.so.%{sover} |
---|
108 | %__mkdir_p %{buildroot}%{_includedir} |
---|
109 | %__mkdir_p %{buildroot}%{_libdir} |
---|
110 | %__install -p include/*.h %{buildroot}%{_includedir} |
---|
111 | %__install -p libv8.so.%{sover} %{buildroot}%{_libdir} |
---|
112 | %__mkdir_p %{buildroot}%{_bindir} |
---|
113 | %__install -p -m0755 d8 %{buildroot}%{_bindir} |
---|
114 | |
---|
115 | %__install -d %{buildroot}%{python_sitelib} |
---|
116 | %__install -pm644 tools/js2c.py %{buildroot}%{python_sitelib} |
---|
117 | %__install -pm644 tools/jsmin.py %{buildroot}%{python_sitelib} |
---|
118 | |
---|
119 | cd %{buildroot}%{_libdir} |
---|
120 | %__ln_s -f libv8.so.%{sover} libv8.so |
---|
121 | %__ln_s -f libv8.so.%{sover} libv8.so.%{somajor} |
---|
122 | %__ln_s -f libv8.so.%{sover} libv8.so.%{somajor}.%{sominor} |
---|
123 | |
---|
124 | %__chmod -x %{buildroot}%{_includedir}/v8*.h |
---|
125 | |
---|
126 | |
---|
127 | # %check |
---|
128 | # tools/test.py --no-build -p dots --shell d8 |
---|
129 | |
---|
130 | %clean |
---|
131 | %__rm -rf %{buildroot} |
---|
132 | |
---|
133 | |
---|
134 | %post -p /sbin/ldconfig |
---|
135 | %postun -p /sbin/ldconfig |
---|
136 | |
---|
137 | |
---|
138 | %files |
---|
139 | %defattr(-,root,root,-) |
---|
140 | %doc AUTHORS ChangeLog LICENSE |
---|
141 | %{_bindir}/d8 |
---|
142 | %{_libdir}/*.so.* |
---|
143 | |
---|
144 | |
---|
145 | %files devel |
---|
146 | %defattr(-,root,root,-) |
---|
147 | %{_includedir}/*.h |
---|
148 | %{_libdir}/*.so |
---|
149 | %{python_sitelib}/*.py* |
---|
150 | |
---|
151 | |
---|
152 | %changelog |
---|
153 | * Thu Dec 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.4-1.svn6102 |
---|
154 | - source 3.0.4 rev.6102 |
---|
155 | |
---|
156 | * Sat Dec 11 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.0-1.svn5932 |
---|
157 | - source 3.0.0 rev.5932 |
---|
158 | |
---|
159 | * Sat Dec 04 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.9-1.svn5896 |
---|
160 | - source 2.5.9 rev.5896 |
---|
161 | |
---|
162 | * Fri Nov 26 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.8-1.svn5891 |
---|
163 | - source 2.5.8 rev.5891 |
---|
164 | |
---|
165 | * Thu Nov 11 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.6-1.svn5808 |
---|
166 | - source 2.5.6 rev.5808 |
---|
167 | |
---|
168 | * Sun Oct 31 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.2-1.svn5743 |
---|
169 | - source 2.5.2 rev.5743 |
---|
170 | |
---|
171 | * Sat Oct 16 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.4.9-1.svn5631 |
---|
172 | - source 2.4.9 rev.5631 |
---|
173 | |
---|
174 | * Sun Oct 10 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.4.8-1 |
---|
175 | - initial build |
---|
176 | |
---|
177 | * Sat Sep 18 2010 Lubomir Rintel <lkundrak@v3.sk> - 2.4.4-1 |
---|
178 | - Newer version |
---|
179 | |
---|
180 | - Package based on 2.3.11-1.20100831svn5385 by Tom "spot" Callaway |
---|
181 | * Wed Sep 15 2010 Lubomir Rintel <lkundrak@v3.sk> - 2.3.8-2 |
---|
182 | - Package based on 2.3.11-1.20100831svn5385 by Tom "spot" Callaway |
---|