Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-updates-src > by-pkgid > ee29d99103e9d68cd43a1e4eaf42db12 > files > 12

mozjs60-60.9.0-1.mga7.src.rpm

# Big endian platforms
%ifarch ppc ppc64 s390 s390x
%global big_endian 1
%endif

%define	pkgname	mozjs
%define	api	60
%define major	%{api}
%define libname	%mklibname %{pkgname} %{api}
%define libdev	%mklibname %{pkgname} %{api} -d

Summary:	JavaScript interpreter and libraries
Name:		mozjs%{api}
Version:	%{api}.9.0
Release:	%mkrel 1
License:	GPLv2+ or LGPLv2+ or MPLv1.1
Group:		Development/Other
URL:		http://www.mozilla.org/js/
Source0:	https://ftp.mozilla.org/pub/firefox/releases/%{version}esr/source/firefox-%{version}esr.source.tar.xz
# Patches from Debian mozjs52_52.3.1-4.debian.tar.xz:
Patch0001:      fix-soname.patch
Patch0002:      copy-headers.patch
Patch0003:      tests-increase-timeout.patch
Patch0008:      Always-use-the-equivalent-year-to-determine-the-time-zone.patch
Patch0009:      icu_sources_data.py-Decouple-from-Mozilla-build-system.patch
Patch0010:      icu_sources_data-Write-command-output-to-our-stderr.patch
Patch0011:      tests-For-tests-that-are-skipped-on-64-bit-mips64-is-also.patch

# Build fixes - https://hg.mozilla.org/mozilla-central/rev/ca36a6c4f8a4a0ddaa033fdbe20836d87bbfb873
Patch12:        emitter.patch
Patch13:        emitter_test.patch
Patch14:        init_patch.patch

# Patches from Fedora firefox package:
Patch26:        build-icu-big-endian.patch

# (martinw) don't check for cmov support when running on older CPUs
Patch1000:      bypass-cmov-assert-on-i586.patch

BuildRequires:	autoconf2.1
BuildRequires:	pkgconfig(nspr)
BuildRequires:	pkgconfig(libffi)
BuildRequires:	pkgconfig(zlib)
BuildRequires:	pkgconfig(python3)
BuildRequires:	pkgconfig(icu-i18n)
BuildRequires:	readline-devel
BuildRequires:	pkgconfig(python2)
BuildRequires:	perl-devel
BuildRequires:	coreutils

# Firefox does not allow to build with system version of jemalloc
Provides:	bundled(jemalloc) = 4.3.1

%description
JavaScript is the Netscape-developed object scripting language used in millions
of web pages and server applications worldwide. Netscape's JavaScript is a
superset of the ECMA-262 Edition 3 (ECMAScript) standard scripting language,
with only mild differences from the published standard.

%package -n %{libname}
Summary:	JavaScript engine library
Group:		System/Libraries

%description -n %{libname}
JavaScript is the Netscape-developed object scripting languages. This
package has been created for purposes of Sablotron and is suitable for
embedding in applications. See http://www.mozilla.org/js for details
and sources.

%package -n %{libdev}
Summary:	The header files for %{name}
Group:		Development/Other
Provides:	%{name}-devel = %{version}-%{release}
Requires:	%{libname} = %{version}-%{release}
%if "%{?_lib}" == "lib64"
Provides:       devel(libmozjs-%{api}(64bit)) = %{version}-%{release}
%else
Provides:       devel(libmozjs-%{api}) = %{version}-%{release}
%endif

%description -n %{libdev}
This package contains the header files, static libraries and development
documentation for %{name}. If you like to develop programs using %{name},
you will need to install %{libdev}.

%prep
%setup -q -n firefox-%{version}/js/src

pushd ../..
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
%patch0008 -p1
%patch0009 -p1
%patch0010 -p1
%patch0011 -p1

%patch12 -p1
%patch13 -p1
%patch14 -p1

# Patch for big endian platforms only
%if 0%{?big_endian}
%patch26 -p1 -b .icu
%endif

%patch1000 -p1

# make sure we don't ever accidentally link against bundled security libs
rm -rf security/
popd

# Remove zlib directory (to be sure using system version)
rm -rf ../../modules/zlib

%ifarch %arm
# This test is too slow and times out
rm -f jit-test/tests/basic/testBug686274.js
%endif

%build
# Disable null pointer gcc6 optimization in gcc6 (rhbz#1328045)
export CFLAGS="%{optflags} -fno-tree-vrp -fno-strict-aliasing -fno-delete-null-pointer-checks"
export CXXFLAGS="$CFLAGS"
LINKFLAGS="%{ldflags}"
export PYTHON="%{__python2}"

autoconf-2.13
%configure2_5x \
	--without-system-icu \
	--enable-posix-nspr-emulation \
	--with-system-zlib \
	--enable-tests \
	--disable-strip \
	--with-intl-api \
	--enable-readline \
	--enable-shared-js \
	--disable-optimize \
	--enable-pie \
	--disable-jemalloc

%if 0%{?big_endian}
echo "Generate big endian version of config/external/icu/data/icud58l.dat"
pushd ../..
  ./mach python intl/icu_sources_data.py .
  ls -l config/external/icu/data
  rm -f config/external/icu/data/icudt*l.dat
popd
%endif

%make_build

%install
%make_install

# Fix permissions
chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc

# Remove unneeded files
rm %{buildroot}%{_bindir}/js%{major}-config
rm %{buildroot}%{_libdir}/libjs_static.ajs

# Rename library and create symlinks, following fix-soname.patch
mv %{buildroot}%{_libdir}/libmozjs-%{major}.so \
   %{buildroot}%{_libdir}/libmozjs-%{major}.so.0.0.0
ln -s libmozjs-%{major}.so.0.0.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so.0
ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so

%check

%files -n %{libname}
%doc README.html
%{_libdir}/libmozjs-%{major}.so.0*

%files -n %{libdev}
%{_bindir}/js%{major}
%{_libdir}/libmozjs-%{major}.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/mozjs-%{api}/


%changelog
* Sun Dec 29 2019 ns80 <ns80> 60.9.0-1.mga7
+ Revision: 1474729
- new version 60.9.0 for CVE-2019-1170[78] (mga#25910)

* Tue May 21 2019 martinw <martinw> 60.4.0-2.mga7
+ Revision: 1398799
- fix segfault due to assertion failure when running on real i586 CPU

* Tue Jan 01 2019 tmb <tmb> 60.4.0-1.mga7
+ Revision: 1348028
- update to 60.4.0

* Mon Dec 31 2018 daviddavid <daviddavid> 60.3.0-1.mga7
+ Revision: 1347470
- new version: 60.3.0
- drop upstreamed tests-snans-be.patch

* Fri Sep 07 2018 tv <tv> 60.1.0-1.mga7
+ Revision: 1257649
- imported package mozjs60