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