%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 6 %global node_minor 13 %global node_patch 0 %global node_abi %{node_major}.%{node_minor} %global node_version %{node_major}.%{node_minor}.%{node_patch} %global __provides_exclude_from ^%{_libdir}/libnode-shared.so.48 Name: node-shared Version: %{node_version} Release: 5%{?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 node-shared-tarball.sh script. Source0: %{name}-v%{node_version}-stripped.tar.xz Source1: %{name}-tarball.sh Patch0: 0001-nodejs-shared-node.patch Patch1: 0002-nodejs-uid-number-workaround.patch Patch2: 0003-nodejs-restore-signal-dispositions.patch Patch3: 0004-nodejs-do-not-build-bundled-deps.patch Patch4: 0005-nodejs-rename-soname-to-libnode-shared.patch Patch5: 0006-nodejs-explicitly-invoke-python2.patch BuildRequires: /usr/bin/git BuildRequires: gcc >= 4.8.5 BuildRequires: gcc-c++ >= 4.8.5 BuildRequires: python2 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: node-shared(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} # change python shebang find . -name '*.py' | xargs -n 1 sed -i 'sx#!/usr/bin/env\ pythonx#!/usr/bin/python2xg' sed -i 'sx#!/usr/bin/pythonx#!/usr/bin/python2xg' tools/gyp/samples/samples sed -i 'sx#!/usr/bin/pythonx#!/usr/bin/python2xg' deps/npm/node_modules/node-gyp/gyp/samples/samples %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 ./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.48#lib%{name}.so.48#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/node.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.48 %{buildroot}%{_libdir}/lib%{name}.so.48 rm -f %{buildroot}/%{_usr}/lib/lib%{name}.so.48 # remove man files rm -rf %{buildroot}%{_mandir} %files %license LICENSE %{_pkgdocdir} %exclude %{_pkgdocdir}/gdbinit %exclude %{_pkgdocdir}/lldbinit %exclude %{_pkgdocdir}/lldb_commands.py %exclude %{_bindir}/npm %exclude %{_prefix}/lib/node_modules %{_libdir}/lib%{name}.so.48 %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/node.pc %changelog * Wed Sep 26 2018 Damian Wrobel - 6.13.0-5 - Update python shebang to fix build on >=F29 * Tue Sep 25 2018 Damian Wrobel - 6.13.0-4 - Use PYTHON_DISALLOW_AMBIGUOUS_VERSION to fix build on >=F30 * Thu Sep 20 2018 Damian Wrobel - 6.13.0-3 - Add python2 BR to fix build error on >=F29 * 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