%global pre_release .rc0 %global major 38 Summary: JavaScript interpreter and libraries Name: mozjs38 Version: %{major}.2.1 Release: 2%{?dist} License: MPLv2.0 and BSD and GPLv2+ and GPLv3+ and LGPLv2.1 and LGPLv2.1+ and AFL and ASL 2.0 URL: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/38 Source0: https://people.mozilla.org/~sstangl/mozjs-%{version}%{pre_release}.tar.bz2 BuildRequires: pkgconfig(icu-i18n) BuildRequires: pkgconfig(nspr) BuildRequires: pkgconfig(libffi) BuildRequires: pkgconfig(zlib) BuildRequires: readline-devel BuildRequires: /usr/bin/zip BuildRequires: python-devel %description JavaScript is the Netscape-developed object scripting language used in millions of web pages and server applications worldwide. Netscape's JavaScript is a super set of the ECMA-262 Edition 3 (ECMAScript) standard scripting language, with only mild differences from the published standard. %package devel Summary: Header files, libraries and development documentation for %{name} Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description devel 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 %{name}-devel. %prep %setup -q -n mozjs-%{major}.0.0/js/src %if 0%{?fedora} > 22 # Correct failed to link tests due to hardened build sed -i 's|"-O2"|"-O2 -fPIC"|' configure %endif # Remove zlib directory (to be sure using system version) rm -rf ../../modules/zlib # Fix release number head -n -1 ../../config/milestone.txt > ../../config/milestone.txt echo "%{version}%{pre_release}" >> ../../config/milestone.txt %build # Need -fpermissive due to some macros using nullptr as bool false export CFLAGS="%{optflags} -fpermissive" export CXXFLAGS="$CFLAGS" export PYTHON=/usr/bin/python2 %configure \ --with-system-nspr \ --enable-threadsafe \ --enable-readline \ --enable-xterm-updates \ --enable-shared-js \ --enable-gcgenerational \ --enable-optimize \ --with-system-zlib \ --enable-system-ffi \ --with-system-icu \ --without-intl-api \ --enable-pie make %{?_smp_mflags} %install make install DESTDIR=%{buildroot} mv %{buildroot}%{_libdir}/pkgconfig/js.pc %{buildroot}%{_libdir}/pkgconfig/mozjs-%{major}.pc chmod a-x %{buildroot}%{_libdir}/pkgconfig/*.pc # Do not install binaries or static libraries rm -f %{buildroot}%{_libdir}/*.a %{buildroot}%{_libdir}/*.ajs %{buildroot}%{_bindir}/js* # Install files, not symlinks to build directory pushd %{buildroot}%{_includedir} for link in `find . -type l`; do header=`readlink $link` rm -f $link cp -p $header $link done popd cp -p js/src/js-config.h %{buildroot}%{_includedir}/mozjs-%{major} %check tests/jstests.py -d -s --no-progress ../../js/src/js/src/shell/js %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %license ../../LICENSE %doc ../../README %{_libdir}/*.so %files devel %{_libdir}/pkgconfig/*.pc %{_includedir}/mozjs-%{major} %changelog * Tue Oct 13 2015 Marek Skalicky - 38.2.1-2 - Fixed inaccuracies from package review (paraller build, tests don't fail,...) * Tue Oct 6 2015 Marek Skalicky - 38.2.1-1 - Initial mozjs38 spec (based on mozjs31)