[2038] | 1 | %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} |
---|
| 2 | |
---|
[2346] | 3 | %global somajor 3 |
---|
[6992] | 4 | %global sominor 10 |
---|
| 5 | %global sobuild 8 |
---|
[2038] | 6 | %global sover %{somajor}.%{sominor}.%{sobuild} |
---|
| 7 | |
---|
[6992] | 8 | #define svnrevision 6522 |
---|
[2076] | 9 | |
---|
[2038] | 10 | Name: v8 |
---|
[2076] | 11 | Version: %{sover} |
---|
| 12 | Release: 1%{?svnrevision:.svn%svnrevision}%{?_dist_release} |
---|
[2277] | 13 | Provides: lib%{name} = %{version}-%{release} |
---|
[2038] | 14 | Summary: JavaScript Engine |
---|
| 15 | Summary(ja): JavaScript エンジン |
---|
| 16 | Group: System Environment/Libraries |
---|
| 17 | License: BSD |
---|
| 18 | URL: http://code.google.com/p/v8 |
---|
[2076] | 19 | Source0: %{name}-%{version}%{?svnrevision:.svn%svnrevision}.tar.bz2 |
---|
| 20 | Source10: v8-snapshot.sh |
---|
[6992] | 21 | #Patch0: v8-2.5.9-buildfix.patch |
---|
[2076] | 22 | |
---|
[2038] | 23 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
---|
| 24 | ExclusiveArch: %{ix86} x86_64 arm |
---|
| 25 | |
---|
[2076] | 26 | BuildRequires: scons |
---|
| 27 | BuildRequires: readline-devel |
---|
[6992] | 28 | #BuildRequires: libicu-devel |
---|
[2076] | 29 | |
---|
[2038] | 30 | %description |
---|
| 31 | V8 is Google's open source JavaScript engine. V8 is written in C++ and is used |
---|
| 32 | in Google Chrome, the open source browser from Google. V8 implements ECMAScript |
---|
| 33 | as specified in ECMA-262, 3rd edition. |
---|
| 34 | #' |
---|
| 35 | |
---|
| 36 | %description -l ja |
---|
| 37 | V8 は Google のオープンソース JavaScript エンジンです。 |
---|
| 38 | V8 で C++ 書かれており、Google 発のオープンソースブラウザである |
---|
| 39 | Google Chrome で使われています。 |
---|
| 40 | V8 は ECMA-262 第 3 版で指定されている ECMAScript を満たしています。 |
---|
| 41 | |
---|
| 42 | %package devel |
---|
| 43 | Group: Development/Libraries |
---|
| 44 | Summary: Development headers and libraries for v8 |
---|
| 45 | Requires: %{name} = %{version}-%{release} |
---|
[2277] | 46 | Provides: lib%{name}-devel = %{version}-%{release} |
---|
[2038] | 47 | |
---|
| 48 | %description devel |
---|
| 49 | Development headers, libraries and tools for v8. |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | %prep |
---|
| 53 | %setup -q |
---|
[6992] | 54 | #%patch0 -p0 -b .orig |
---|
[2038] | 55 | |
---|
| 56 | # -fno-strict-aliasing is needed with gcc 4.4 to get past some ugly code |
---|
[6992] | 57 | PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS -fPIC -fno-strict-aliasing -Wno-unused-parameter -Wno-error=strict-overflow -Wno-unused-but-set-variable\'| \ |
---|
| 58 | sed "s/ /',/g" | \ |
---|
| 59 | sed "s/',/', '/g"` |
---|
| 60 | %__sed -i "s|'-O3',|$PARSED_OPT_FLAGS,|g" SConstruct |
---|
[2038] | 61 | |
---|
[6992] | 62 | # clear spurious executable bits |
---|
| 63 | find . \( -name \*.cc -o -name \*.h -o -name \*.py \) -a -executable \ |
---|
| 64 | |while read FILE ; do |
---|
| 65 | echo $FILE |
---|
| 66 | chmod -x $FILE |
---|
| 67 | done |
---|
| 68 | |
---|
[2038] | 69 | %build |
---|
| 70 | export GCC_VERSION="44" |
---|
[6992] | 71 | scons library=shared snapshots=on \ |
---|
| 72 | %{_smp_mflags} \ |
---|
[2038] | 73 | %ifarch x86_64 |
---|
[2277] | 74 | arch=x64 \ |
---|
[2038] | 75 | %endif |
---|
[6992] | 76 | %ifarch armv7hl armv7hnl |
---|
| 77 | armeabi=hard \ |
---|
| 78 | %endif |
---|
| 79 | %ifarch armv5tel armv6l armv7l |
---|
| 80 | armeabi=soft \ |
---|
| 81 | %endif |
---|
[2277] | 82 | visibility=default \ |
---|
| 83 | env=CCFLAGS:"-fPIC" |
---|
[2038] | 84 | |
---|
| 85 | # When will people learn to create versioned shared libraries by default? |
---|
[6992] | 86 | # first, lets get rid of the old .so file |
---|
| 87 | rm -rf libv8.so libv8preparser.so |
---|
[2038] | 88 | # Now, lets make it right. |
---|
[6992] | 89 | g++ $RPM_OPT_FLAGS -fPIC -o libv8preparser.so.%{sover} -shared -Wl,-soname,libv8preparser.so.%{somajor} \ |
---|
| 90 | obj/release/allocation.os \ |
---|
| 91 | obj/release/bignum.os \ |
---|
| 92 | obj/release/bignum-dtoa.os \ |
---|
| 93 | obj/release/cached-powers.os \ |
---|
| 94 | obj/release/diy-fp.os \ |
---|
| 95 | obj/release/dtoa.os \ |
---|
| 96 | obj/release/fast-dtoa.os \ |
---|
| 97 | obj/release/fixed-dtoa.os \ |
---|
| 98 | obj/release/preparse-data.os \ |
---|
| 99 | obj/release/preparser-api.os \ |
---|
| 100 | obj/release/preparser.os \ |
---|
| 101 | obj/release/scanner.os \ |
---|
| 102 | obj/release/strtod.os \ |
---|
| 103 | obj/release/token.os \ |
---|
| 104 | obj/release/unicode.os \ |
---|
| 105 | obj/release/utils.os |
---|
| 106 | |
---|
| 107 | # "obj/release/preparser-api.os" should not be included in the libv8.so file. |
---|
| 108 | export RELEASE_BUILD_OBJS=`echo obj/release/*.os | sed 's|obj/release/preparser-api.os||g'` |
---|
| 109 | |
---|
| 110 | %ifarch %{arm} |
---|
| 111 | g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} $RELEASE_BUILD_OBJS obj/release/extensions/*.os obj/release/arm/*.os $ICU_LINK_FLAGS |
---|
| 112 | %endif |
---|
| 113 | %ifarch %{ix86} |
---|
| 114 | g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} $RELEASE_BUILD_OBJS obj/release/extensions/*.os obj/release/ia32/*.os $ICU_LINK_FLAGS |
---|
| 115 | %endif |
---|
| 116 | %ifarch x86_64 |
---|
| 117 | g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} $RELEASE_BUILD_OBJS obj/release/extensions/*.os obj/release/x64/*.os $ICU_LINK_FLAGS |
---|
| 118 | %endif |
---|
| 119 | |
---|
[2038] | 120 | # We need to do this so d8 can link against it. |
---|
[6992] | 121 | ln -sf libv8.so.%{sover} libv8.so |
---|
| 122 | ln -sf libv8preparser.so.%{sover} libv8preparser.so |
---|
[2038] | 123 | |
---|
[6992] | 124 | # This will fail to link d8 because it doesn't use the icu libs. |
---|
| 125 | scons d8 \ |
---|
[2038] | 126 | %ifarch x86_64 |
---|
[6992] | 127 | arch=x64 \ |
---|
[2038] | 128 | %endif |
---|
[6992] | 129 | %ifarch armv7hl armv7hnl |
---|
| 130 | armeabi=hard \ |
---|
| 131 | %endif |
---|
| 132 | %ifarch armv5tel armv6l armv7l |
---|
| 133 | armeabi=soft \ |
---|
| 134 | %endif |
---|
| 135 | library=shared snapshots=on console=readline visibility=default || : |
---|
[2038] | 136 | |
---|
| 137 | # Ahem |
---|
[2277] | 138 | %__rm -f d8 |
---|
[2038] | 139 | |
---|
[6992] | 140 | g++ $RPM_OPT_FLAGS -o d8 obj/release/d8.os -lreadline -lpthread -L. -lv8 $ICU_LINK_FLAGS |
---|
[2038] | 141 | |
---|
| 142 | |
---|
| 143 | %install |
---|
[6992] | 144 | rm -rf %{buildroot} |
---|
| 145 | mkdir -p %{buildroot}%{_includedir} |
---|
| 146 | mkdir -p %{buildroot}%{_libdir} |
---|
| 147 | install -p include/*.h %{buildroot}%{_includedir} |
---|
| 148 | install -p libv8.so.%{sover} %{buildroot}%{_libdir} |
---|
| 149 | install -p libv8preparser.so.%{sover} %{buildroot}%{_libdir} |
---|
| 150 | mkdir -p %{buildroot}%{_bindir} |
---|
| 151 | install -p -m0755 d8 %{buildroot}%{_bindir} |
---|
[2277] | 152 | |
---|
[6992] | 153 | pushd %{buildroot}%{_libdir} |
---|
| 154 | ln -sf libv8.so.%{sover} libv8.so |
---|
| 155 | ln -sf libv8.so.%{sover} libv8.so.%{somajor} |
---|
| 156 | ln -sf libv8.so.%{sover} libv8.so.%{somajor}.%{sominor} |
---|
| 157 | ln -sf libv8preparser.so.%{sover} libv8preparser.so |
---|
| 158 | ln -sf libv8preparser.so.%{sover} libv8preparser.so.%{somajor} |
---|
| 159 | ln -sf libv8preparser.so.%{sover} libv8preparser.so.%{somajor}.%{sominor} |
---|
| 160 | popd |
---|
[2038] | 161 | |
---|
[6992] | 162 | chmod -x %{buildroot}%{_includedir}/v8*.h |
---|
[2038] | 163 | |
---|
[6992] | 164 | mkdir -p %{buildroot}%{_includedir}/v8/extensions/ |
---|
| 165 | install -p src/extensions/*.h %{buildroot}%{_includedir}/v8/extensions/ |
---|
[2038] | 166 | |
---|
[6992] | 167 | chmod -x %{buildroot}%{_includedir}/v8/extensions/*.h |
---|
[2038] | 168 | |
---|
[6992] | 169 | # install Python JS minifier scripts for nodejs |
---|
| 170 | install -d %{buildroot}%{python_sitelib} |
---|
| 171 | sed -i 's|/usr/bin/python2.4|/usr/bin/env python|g' tools/jsmin.py |
---|
| 172 | sed -i 's|/usr/bin/python2.4|/usr/bin/env python|g' tools/js2c.py |
---|
| 173 | install -p -m0744 tools/jsmin.py %{buildroot}%{python_sitelib}/ |
---|
| 174 | install -p -m0744 tools/js2c.py %{buildroot}%{python_sitelib}/ |
---|
| 175 | chmod -R -x %{buildroot}%{python_sitelib}/*.py* |
---|
[2038] | 176 | |
---|
[2277] | 177 | |
---|
[2038] | 178 | %clean |
---|
| 179 | %__rm -rf %{buildroot} |
---|
| 180 | |
---|
| 181 | |
---|
| 182 | %post -p /sbin/ldconfig |
---|
[6992] | 183 | |
---|
[2038] | 184 | %postun -p /sbin/ldconfig |
---|
| 185 | |
---|
| 186 | |
---|
| 187 | %files |
---|
| 188 | %defattr(-,root,root,-) |
---|
| 189 | %doc AUTHORS ChangeLog LICENSE |
---|
| 190 | %{_bindir}/d8 |
---|
| 191 | %{_libdir}/*.so.* |
---|
| 192 | |
---|
| 193 | |
---|
| 194 | %files devel |
---|
| 195 | %defattr(-,root,root,-) |
---|
| 196 | %{_includedir}/*.h |
---|
[6992] | 197 | %{_includedir}/v8/extensions/ |
---|
[2038] | 198 | %{_libdir}/*.so |
---|
| 199 | %{python_sitelib}/*.py* |
---|
| 200 | |
---|
| 201 | |
---|
| 202 | %changelog |
---|
[6992] | 203 | * Wed Oct 24 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.10.8-1 |
---|
| 204 | - update to 3.10.8 |
---|
| 205 | |
---|
[2595] | 206 | * Sat Jan 29 2011 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.12-1.svn6522 |
---|
| 207 | - source 3.0.12 rev.6387 |
---|
| 208 | |
---|
| 209 | * Sat Jan 22 2011 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.9-1.svn6387 |
---|
| 210 | - source 3.0.9 rev.6387 |
---|
| 211 | |
---|
[2405] | 212 | * Thu Dec 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.4-1.svn6102 |
---|
| 213 | - source 3.0.4 rev.6102 |
---|
| 214 | |
---|
[2346] | 215 | * Sat Dec 11 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.0-1.svn5932 |
---|
| 216 | - source 3.0.0 rev.5932 |
---|
| 217 | |
---|
[2277] | 218 | * Sat Dec 04 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.9-1.svn5896 |
---|
| 219 | - source 2.5.9 rev.5896 |
---|
| 220 | |
---|
| 221 | * Fri Nov 26 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.8-1.svn5891 |
---|
| 222 | - source 2.5.8 rev.5891 |
---|
| 223 | |
---|
| 224 | * Thu Nov 11 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.6-1.svn5808 |
---|
| 225 | - source 2.5.6 rev.5808 |
---|
| 226 | |
---|
| 227 | * Sun Oct 31 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.2-1.svn5743 |
---|
| 228 | - source 2.5.2 rev.5743 |
---|
| 229 | |
---|
[2076] | 230 | * Sat Oct 16 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.4.9-1.svn5631 |
---|
| 231 | - source 2.4.9 rev.5631 |
---|
| 232 | |
---|
[2038] | 233 | * Sun Oct 10 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.4.8-1 |
---|
| 234 | - initial build |
---|
| 235 | |
---|
| 236 | * Sat Sep 18 2010 Lubomir Rintel <lkundrak@v3.sk> - 2.4.4-1 |
---|
| 237 | - Newer version |
---|
| 238 | |
---|
| 239 | - Package based on 2.3.11-1.20100831svn5385 by Tom "spot" Callaway |
---|
| 240 | * Wed Sep 15 2010 Lubomir Rintel <lkundrak@v3.sk> - 2.3.8-2 |
---|
| 241 | - Package based on 2.3.11-1.20100831svn5385 by Tom "spot" Callaway |
---|