1 # NOTE: JavaScript version is 1.8.7, implementation version is 1.0.0; what should be package version?
2 # Some paths (library name, .pc file) seem intentionally not conflict with js < 1.8,
3 # but some still do (includes path, js-config, js shell).
4 # It's somehow messy, so let's put this version in separate js187 package for now,
5 # until upstream decides which way to go in the future.
8 %bcond_without default_js # build as default js package
10 Summary: SpiderMonkey JavaScript 1.8.7 implementation
11 Summary(pl.UTF-8): Implementacja SpiderMonkey języka JavaScript 1.8.7
15 License: MPL 1.1 or GPL v2+ or LGPL v2.1+
16 Group: Development/Languages
17 #Source0: http://ftp.mozilla.org/pub/mozilla.org/js/%{name}-%{version}.tar.gz
18 Source0: %{name}-%{version}.tar.gz
19 # Source0-md5: 9399466aa36e98e157cb3780c3f96dde
20 Patch0: %{name}-install.patch
21 Patch1: %{name}-x32.patch
22 URL: http://www.mozilla.org/js/
23 BuildRequires: libstdc++-devel
24 BuildRequires: nspr-devel >= 4.7.0
25 BuildRequires: perl-base >= 1:5.6
26 BuildRequires: python >= 1:2.5
27 BuildRequires: readline-devel
28 BuildRequires: rpm-perlprov
29 BuildRequires: rpmbuild(macros) >= 1.294
30 BuildRequires: sed >= 4.0
31 Requires: %{name}-libs = %{version}-%{release}
32 %if %{with default_js}
33 Provides: js = 2:1.8.7
34 Obsoletes: js < 2:1.8.7
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 JavaScript Reference Implementation (codename SpiderMonkey). The
40 package contains JavaScript runtime (compiler, interpreter,
41 decompiler, garbage collector, atom manager, standard classes) and
42 small "shell" program that can be used interactively and with .js
45 %description -l pl.UTF-8
46 Wzorcowa implementacja JavaScriptu (o nazwie kodowej SpiderMonkey).
47 Pakiet zawiera środowisko uruchomieniowe (kompilator, interpreter,
48 dekompilator, odśmiecacz, standardowe klasy) i niewielką powłokę,
49 która może być używana interaktywnie lub z plikami .js do uruchamiania
53 Summary: SpiderMonkey JavaScript 1.8.7 library
54 Summary(pl.UTF-8): Biblioteka SpiderMonkey JavaScript 1.8.7
56 Requires: nspr >= 4.7.0
57 Conflicts: js187 < 1.0.0-2
60 SpiderMonkey JavaScript 1.8.7 library.
62 %description libs -l pl.UTF-8
63 Biblioteka SpiderMonkey JavaScript 1.8.7.
66 Summary: Header files for JavaScript 1.8.7 reference library
67 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki JavaScript 1.8.7
68 Group: Development/Libraries
69 Requires: %{name}-libs = %{version}-%{release}
70 Requires: libstdc++-devel
71 Requires: nspr-devel >= 4.7.0
72 %if %{with default_js}
73 Provides: js-devel = 2:1.8.7
74 Obsoletes: js-devel < 2:1.8.7
78 Header files for JavaScript 1.8.7 reference library.
80 %description devel -l pl.UTF-8
81 Pliki nagłówkowe biblioteki JavaScript 1.8.7.
84 Summary: Static JavaScript 1.8.7 reference library
85 Summary(pl.UTF-8): Statyczna biblioteka JavaScript 1.8.7
86 Group: Development/Libraries
87 Requires: %{name}-devel = %{version}-%{release}
88 %if %{with default_js}
89 Provides: js-static = 2:1.8.7
90 Obsoletes: js-static < 2:1.8.7
94 Static version of JavaScript 1.8.7 reference library.
96 %description static -l pl.UTF-8
97 Statyczna wersja biblioteki JavaScript 1.8.7.
100 %setup -q -n js-1.8.7
104 sed -i -e 's/-O3//' js/src/Makefile.in js/src/config/Makefile.in
107 export CXXFLAGS="%{rpmcxxflags} -fpermissive"
111 --enable-threadsafe \
112 --enable-system-ffi \
113 --disable-methodjit \
117 HOST_OPTIMIZE_FLAGS= \
118 MOZILLA_VERSION=%{version}
121 rm -rf $RPM_BUILD_ROOT
123 %{__make} -j1 -C js/src install \
124 DESTDIR=$RPM_BUILD_ROOT \
125 MOZILLA_VERSION=%{version} \
128 # not installed by make install
129 cp -aL js/src/dist/include/{ds,gc,js,mozilla,vm} $RPM_BUILD_ROOT%{_includedir}/js187
131 # not installed by make install in new buildsystem
132 install js/src/shell/js $RPM_BUILD_ROOT%{_bindir}/js187
134 %{__mv} $RPM_BUILD_ROOT%{_bindir}/js-config $RPM_BUILD_ROOT%{_bindir}/js187-config
136 # fix symlinks pointing to buildroot
137 ln -sf libmozjs187.so.1.0 $RPM_BUILD_ROOT%{_libdir}/libmozjs187.so
138 ln -sf libmozjs187.so.1.0.0 $RPM_BUILD_ROOT%{_libdir}/libmozjs187.so.1.0
140 %if %{with default_js}
141 # provide symlinks as default js implementation
142 # (don't provide libjs.so.1 as the libraries are not binary-compatible)
143 ln -sf libmozjs187.so $RPM_BUILD_ROOT%{_libdir}/libjs.so
144 ln -sf libmozjs187-1.0.a $RPM_BUILD_ROOT%{_libdir}/libjs.a
145 ln -sf js187 $RPM_BUILD_ROOT%{_includedir}/js
146 ln -sf js187 $RPM_BUILD_ROOT%{_bindir}/js
147 ln -sf js187-config $RPM_BUILD_ROOT%{_bindir}/js-config
149 %{__sed} -i -e 's,/js$,/js187,' $RPM_BUILD_ROOT%{_pkgconfigdir}/mozjs187.pc
153 rm -rf $RPM_BUILD_ROOT
155 %post libs -p /sbin/ldconfig
156 %postun libs -p /sbin/ldconfig
158 %if %{with default_js}
160 if [ -d %{_includedir}/js ] && [ ! -L %{_includedir}/js ]; then
161 rm -rf /usr/include/js
166 %defattr(644,root,root,755)
167 %doc js/src/README.html
168 %attr(755,root,root) %{_bindir}/js187
169 %if %{with default_js}
170 %attr(755,root,root) %{_bindir}/js
174 %defattr(644,root,root,755)
175 %attr(755,root,root) %{_libdir}/libmozjs187.so.*.*.*
176 %attr(755,root,root) %ghost %{_libdir}/libmozjs187.so.1.0
179 %defattr(644,root,root,755)
180 %attr(755,root,root) %{_bindir}/js187-config
181 %attr(755,root,root) %{_libdir}/libmozjs187.so
183 %{_pkgconfigdir}/mozjs187.pc
184 %if %{with default_js}
185 %attr(755,root,root) %{_bindir}/js-config
186 %attr(755,root,root) %{_libdir}/libjs.so
191 %defattr(644,root,root,755)
192 %{_libdir}/libmozjs187-1.0.a
193 %if %{with default_js}