%global with_debug 1 %{?!_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} # ARM builds currently break on the Debug builds, so we'll just # build the standard runtime until that gets sorted out. %ifarch %{arm} aarch64 %{power64} %global with_debug 0 %endif # == Node.js Version == %global node_epoch 1 %global node_major 8 %global node_minor 11 %global node_patch 1 %global node_abi %{node_major}.%{node_minor} %global node_version %{node_major}.%{node_minor}.%{node_patch} %global __provides_exclude_from ^%{_libdir}/libnode8-shared.so.57 Name: node8-shared Version: %{node_version} Release: 2%{?dist} Summary: JavaScript runtime (shared library version) License: MIT and ASL 2.0 and ISC and BSD URL: http://nodejs.org/ # Stripped down version without {openssl,icu-small,uv,zlib,http_parser} # generated by node8-shared-tarball.sh script. Source0: %{name}-v%{node_version}-stripped.tar.xz Source1: %{name}-tarball.sh Patch1: 0001-node8-shared-library.patch Patch2: 0002-node8-uid-number-workaround.patch Patch3: 0003-node8-do-not-build-bundled-deps.patch Patch4: 0004-node8-rename-soname-to-libnode8-shared.patch Patch5: 0005-node8-explicitly-invoke-python2.patch Patch6: 0006-node8-deps-turn-in-std-string-for-ICU.patch Patch7: 0007-node8-deps-v8-remove-unnecessary-toUCharPtr.patch Patch8: 0008-node8-fix-for-supporting-older-libuv-library-1.18.patch Patch9: 0009-node8-fix-overloaded-virtual-error.patch Patch10: 0010-node8-add-icu-prefix-before-ICU-symbols.patch BuildRequires: /usr/bin/git BuildRequires: gcc >= 4.8.5 BuildRequires: gcc-c++ >= 4.8.5 BuildRequires: python2-devel BuildRequires: systemtap-sdt-devel %if 0%{?fedora} > 25 BuildRequires: compat-openssl10-devel >= 1:1.0.2 %else BuildRequires: openssl-devel >= 1:1.0.2 %endif BuildRequires: libicu-devel BuildRequires: libuv-devel >= 1:1.9.1 BuildRequires: zlib-devel BuildRequires: http-parser-devel >= 2.7.0 Requires: libuv >= 1:1.9.1 Requires: ca-certificates # This corresponds to the "engine" requirement in package.json Provides: %{name}(engine) = %{node_version} ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 %{power64} s390x %description Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. %package devel Summary: JavaScript runtime (shared library version) - development headers Requires: %{name}%{?_isa} = %{node_version}-%{release} %if 0%{?fedora} > 25 Requires: compat-openssl10-devel%{?_isa} >= 1:1.0.2 %else Requires: openssl-devel%{?_isa} >= 1:1.0.2 %endif Requires: libicu-devel%{?_isa} Requires: libuv-devel%{?_isa} Requires: zlib-devel%{?_isa} Requires: http-parser-devel%{?_isa} %description devel Development headers for the Node.js JavaScript runtime (shared library version). %prep %autosetup -S git -n node-v%{node_version} %build # build with debugging symbols and add defines from libuv (#892601) # Node's v8 breaks with GCC 6 because of incorrect usage of methods on # NULL objects. We need to pass -fno-delete-null-pointer-checks export CFLAGS='%{optflags} -g \ -D_LARGEFILE_SOURCE \ -D_FILE_OFFSET_BITS=64 \ -DZLIB_CONST \ -fno-delete-null-pointer-checks' export CXXFLAGS='%{optflags} -g \ -D_LARGEFILE_SOURCE \ -D_FILE_OFFSET_BITS=64 \ -DZLIB_CONST \ -fno-delete-null-pointer-checks' # Explicit new lines in C(XX)FLAGS can break naive build scripts export CFLAGS="$(echo ${CFLAGS} | tr '\n\\' ' ')" export CXXFLAGS="$(echo ${CXXFLAGS} | tr '\n\\' ' ')" ./configure --prefix=%{_prefix} \ --shared \ --shared-openssl \ --shared-zlib \ --shared-libuv \ --shared-http-parser \ --with-dtrace \ --with-intl=system-icu \ --openssl-use-def-ca-store %if %{?with_debug} == 1 # Setting BUILDTYPE=Debug builds both release and debug binaries make BUILDTYPE=Debug %{?_smp_mflags} %else make BUILDTYPE=Release %{?_smp_mflags} %endif %install # stopgap for /usr/bin/env python ln -sf /usr/bin/python2 python export PATH=.:$PATH ./tools/install.py install %{buildroot} %{_prefix} # install docs install -p -m 0755 -d %{buildroot}%{_pkgdocdir} install -p -m 0644 AUTHORS CHANGELOG.md COLLABORATOR_GUIDE.md GOVERNANCE.md README.md %{buildroot}%{_pkgdocdir} mv %{buildroot}%{_prefix}/share/doc/node/* %{buildroot}%{_pkgdocdir}/ rm -rf %{buildroot}%{_prefix}/share/doc/node # rename files to add -shared part mv %{buildroot}%{_datadir}/systemtap/tapset/node.stp %{buildroot}%{_datadir}/systemtap/tapset/%{name}.stp mv %{buildroot}%{_usr}/lib/dtrace/node.d %{buildroot}%{_usr}/lib/dtrace/%{name}.d # .pc file install -p -m 0755 -d %{buildroot}/%{_libdir}/pkgconfig sed -e "s#libnode.so.57#lib%{name}.so.57#g" \ -e "s#libdir=\${prefix}/lib#libdir=%{_libdir}#g" \ -e "s#includedir=\${prefix}/include/node/#includedir=\${prefix}/include/%{name}/#g" \ -e "s#Name: v8#Name: %{name}#g" \ -e "s#Version: 6.9.0#Version: %{node_major}.%{node_minor}.%{node_patch}#g" \ -e "s#%PREFIX%#%{_prefix}#g" \ %{buildroot}%{_libdir}/pkgconfig/node8.pc # header files mv %{buildroot}%{_includedir}/node %{buildroot}/%{_includedir}/%{name} # .so install -p -m 0755 -d %{buildroot}%{_libdir}/ install -p -m 0755 -T %{buildroot}%{_usr}/lib/lib%{name}.so.57 %{buildroot}%{_libdir}/lib%{name}.so.57 rm -f %{buildroot}/%{_usr}/lib/lib%{name}.so.57 # remove man files rm -rf %{buildroot}%{_mandir} %files %license LICENSE %{_pkgdocdir} %exclude %{_pkgdocdir}/gdbinit %exclude %{_pkgdocdir}/lldbinit %exclude %{_pkgdocdir}/lldb_commands.py %exclude %{_bindir}/np* %exclude %{_prefix}/lib/node_modules %{_libdir}/lib%{name}.so.57 %dir %{_datadir}/systemtap %dir %{_datadir}/systemtap/tapset %{_datadir}/systemtap/tapset/%{name}.stp %dir %{_usr}/lib/dtrace %{_usr}/lib/dtrace/%{name}.d %files devel %{_includedir}/%{name} %{_pkgdocdir}/gdbinit %{_pkgdocdir}/lldbinit %{_pkgdocdir}/lldb_commands.py %{_libdir}/pkgconfig/node8.pc %changelog * Thu Sep 20 2018 Damian Wrobel - 8.11.1-2 - Cherrypick b8f47b2 to fix build error on >=f29 * Fri Apr 13 2018 Damian Wrobel - 8.11.1-1 - Update to 8.11.1 * Tue Mar 27 2018 Damian Wrobel - 8.10.0-2 - Add patch for overloaded-virtual, - Modified version of shared-library patch. * Thu Mar 15 2018 Damian Wrobel - 8.10.0-1 - Update to 8.10.0 * Thu Mar 08 2018 Damian Wrobel - 6.13.0-2 - Add missing BR git * Mon Mar 05 2018 Damian Wrobel - 6.13.0-1 - Update to 6.13.0