Blame packages/n/nodejs18/nodejs18.spec

356da3
#
356da3
# spec file for package nodejs18
356da3
#
356da3
# Copyright (c) 2022 SUSE LLC
356da3
#
356da3
# All modifications and additions to the file contributed by third parties
356da3
# remain the property of their copyright owners, unless otherwise agreed
356da3
# upon. The license for this file, and modifications and additions to the
356da3
# file, is the same license as for the pristine package itself (unless the
356da3
# license for the pristine package is not an Open Source License, in which
356da3
# case the license is the MIT License). An "Open Source License" is a
356da3
# license that conforms to the Open Source Definition (Version 1.9)
356da3
# published by the Open Source Initiative.
356da3
356da3
# Please submit bugfixes or comments via https://bugs.opensuse.org/
356da3
#
356da3
1d3ce1
###########################################################
1d3ce1
#
1d3ce1
#   WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
1d3ce1
#
1d3ce1
# This spec file is generated from a template hosted at
1d3ce1
# https://github.com/AdamMajer/nodejs-packaging
1d3ce1
#
1d3ce1
###########################################################
356da3
1d3ce1
# Fedora doesn't have rpm-config-SUSE which provides
1d3ce1
# ext_man in /usr/lib/rpm/macros.d/macros.obs
356da3
%if 0%{?fedora_version}
356da3
%define ext_man .gz
356da3
%endif
356da3
356da3
Name:           nodejs18
18d701
Version:        18.13.0
356da3
Release:        0
356da3
356da3
# Double DWZ memory limits
356da3
%define _dwz_low_mem_die_limit  20000000
356da3
%define _dwz_max_die_limit     100000000
356da3
356da3
%define node_version_number 18
356da3
356da3
# openssl bsc#1192489 - fix released
356da3
%bcond_without openssl_RSA_get0_pss_params
356da3
356da3
%if 0%{?suse_version} > 1500 || 0%{?fedora_version}
356da3
%bcond_without libalternatives
356da3
%else
356da3
%bcond_with libalternatives
356da3
%endif
356da3
356da3
%if %node_version_number >= 12
356da3
%define openssl_req_ver 1.1.1
356da3
%else
356da3
%if %node_version_number >= 10
356da3
%define openssl_req_ver 1.1.0
356da3
%else
356da3
%define openssl_req_ver 1.0.2
356da3
%endif
356da3
%endif
356da3
356da3
%bcond_with    valgrind_tests
356da3
356da3
%if %{node_version_number} >= 12
356da3
356da3
# turn on LTO only on non-32bit arches
356da3
%ifarch %{ix86} %{arm}
356da3
%bcond_with nodejs_lto
356da3
%else
356da3
%bcond_without nodejs_lto
356da3
%endif
356da3
356da3
%else
356da3
%bcond_with nodejs_lto
356da3
%endif
356da3
356da3
%if !0%{?with nodejs_lto}
356da3
%define _lto_cflags %{nil}
356da3
%endif
356da3
356da3
%if 0%{?suse_version} == 1110
356da3
%define _libexecdir %{_exec_prefix}/lib
356da3
%endif
356da3
463884
%if 0%{?suse_version} >= 1500 || 0%{?sle_version} >= 120400 || 0%{?fedora_version} >= 35
356da3
%bcond_with    intree_openssl
356da3
%else
356da3
%bcond_without intree_openssl
356da3
%endif
356da3
356da3
%if 0%{?suse_version} >= 1330 || 0%{?fedora_version} >= 35
356da3
%bcond_with    intree_cares
356da3
%else
356da3
%bcond_without intree_cares
356da3
%endif
356da3
356da3
%if 0%{?suse_version} >= 1330 || 0%{?fedora_version} >= 35
356da3
%bcond_with    intree_icu
356da3
%else
356da3
%bcond_without intree_icu
356da3
%endif
356da3
356da3
%if 0%{?suse_version} >= 1550
356da3
%bcond_with    intree_nghttp2
356da3
%else
356da3
%bcond_without intree_nghttp2
356da3
%endif
356da3
356da3
%if 0%{?suse_version} >= 1550
356da3
%bcond_with    intree_brotli
356da3
%else
356da3
%bcond_without intree_brotli
356da3
%endif
356da3
356da3
%ifnarch x86_64 %{ix86}
356da3
%bcond_with    gdb
356da3
%else
356da3
%bcond_without gdb
356da3
%endif
356da3
356da3
%define git_node 0
356da3
356da3
Summary:        Evented I/O for V8 JavaScript
356da3
License:        MIT
356da3
Group:          Development/Languages/NodeJS
356da3
URL:            https://nodejs.org
356da3
Source:         https://nodejs.org/dist/v%{version}/node-v%{version}.tar.xz
356da3
Source1:        https://nodejs.org/dist/v%{version}/SHASUMS256.txt
356da3
Source2:        https://nodejs.org/dist/v%{version}/SHASUMS256.txt.sig
356da3
Source3:        nodejs.keyring
356da3
1d3ce1
# Python 3.4 compatible node-gyp 
1d3ce1
### https://github.com/nodejs/node-gyp.git 
18d701
### git archive v7.1.2 | xz > node-gyp_7.1.2.tar.xz 
1d3ce1
Source5:        node-gyp_7.1.2.tar.xz 
1d3ce1
# Only required to run unit tests in NodeJS 10+ 
1d3ce1
Source10:       update_npm_tarball.sh 
356da3
Source11:       node_modules.tar.xz
356da3
Source20:       bash_output_helper.bash
356da3
356da3
## Patches not distribution specific
356da3
Patch1:         cares_public_headers.patch
356da3
Patch3:         fix_ci_tests.patch
356da3
Patch5:         sle12_python3_compat.patch
356da3
Patch7:         manual_configure.patch
356da3
Patch13:        openssl_binary_detection.patch
356da3
1d3ce1
1d3ce1
356da3
## Patches specific to SUSE and openSUSE
356da3
Patch100:       linker_lto_jobs.patch
356da3
# PATCH-FIX-OPENSUSE -- set correct path for dtrace if it is built
356da3
Patch101:       nodejs-libpath.patch
356da3
# PATCH-FIX-UPSTREAM -- use custom addon.gypi by default instead of
356da3
# downloading node source
356da3
Patch102:       node-gyp-addon-gypi.patch
356da3
# PATCH-FIX-SLE -- configure script uses Python check_output method
356da3
# which isn't included in Python 2.6 (used in SLE 11).
356da3
# PATCH-FIX-OPENSUSE -- install user global npm packages to /usr/local
356da3
# instead of /usr
356da3
Patch104:       npm_search_paths.patch
356da3
Patch106:       skip_no_console.patch
356da3
Patch110:       legacy_python.patch
356da3
356da3
Patch120:       flaky_test_rerun.patch
356da3
356da3
Patch132:       test-skip-y2038-on-32bit-time_t.patch
356da3
Patch133:       rsa-pss-revert.patch
356da3
356da3
# Use versioned binaries and paths
356da3
Patch200:       versioned.patch
356da3
0ecac8
Patch305:       qemu_timeouts_arches.patch
463884
Patch307:       s390.patch
356da3
01c163
BuildRequires:  pkg-config
1d3ce1
BuildRequires:  fdupes
356da3
BuildRequires:  procps
356da3
BuildRequires:  xz
356da3
BuildRequires:  zlib-devel
356da3
356da3
%if 0%{?suse_version}
356da3
BuildRequires:  config(netcfg)
356da3
%endif
356da3
356da3
# SLE-11 target only
356da3
# Node.js 6 requires GCC 4.8.5+.
356da3
#
356da3
# For Node.js 8.x, upstream requires GCC 4.9.4+, as GCC 4.8 may have
356da3
# slightly buggy C++11 support: https://github.com/nodejs/node/pull/13466
356da3
#
356da3
# If the default compiler is not supported, use the most recent compiler
356da3
# version available.
356da3
%if 0%{?suse_version} == 1110
356da3
# GCC 5 is only available in the SUSE:SLE-11:SP4:Update repository (SDK).
356da3
%if %node_version_number >= 8
1d3ce1
BuildRequires:   gcc5-c++
356da3
%define forced_gcc_version 5
356da3
%else
1d3ce1
BuildRequires:   gcc48-c++
356da3
%define forced_gcc_version 4.8
356da3
%endif
356da3
%endif
356da3
# sles == 11 block
356da3
356da3
# Pick and stick with "latest" compiler at time of LTS release
356da3
# for SLE-12:Update targets
356da3
%if 0%{?suse_version} == 1315
356da3
%if %node_version_number >= 17
1d3ce1
BuildRequires:   gcc12-c++
356da3
%define forced_gcc_version 12
356da3
%else
356da3
%if %node_version_number >= 14
1d3ce1
BuildRequires:   gcc9-c++
356da3
%define forced_gcc_version 9
356da3
%else
356da3
%if %node_version_number >= 8
1d3ce1
BuildRequires:   gcc7-c++
356da3
%define forced_gcc_version 7
356da3
%endif
356da3
%endif
356da3
%endif
356da3
%endif
356da3
356da3
%if 0%{?suse_version} == 1500
356da3
%if %node_version_number >= 17
1d3ce1
BuildRequires:   gcc12-c++
356da3
%define forced_gcc_version 12
356da3
%endif
356da3
%endif
356da3
# compiler selection
356da3
356da3
# No special version defined, use default.
356da3
%if ! 0%{?forced_gcc_version:1}
356da3
BuildRequires:  gcc-c++
356da3
%endif
356da3
1d3ce1
356da3
# Python dependencies
356da3
%if %node_version_number >= 16
356da3
356da3
%if 0%{?suse_version} && 0%{?suse_version} < 1500
356da3
BuildRequires:  python36
5e9c1e
%define forced_python_version 3.6m
356da3
%else
356da3
BuildRequires:  python3
356da3
%endif
356da3
356da3
%else
356da3
%if %node_version_number >= 12
356da3
BuildRequires:  python3
356da3
356da3
%else
356da3
%if 0%{?suse_version} >= 1500
356da3
BuildRequires:  python2
356da3
%else
356da3
BuildRequires:  python
356da3
%endif
356da3
356da3
%endif
356da3
%endif
356da3
356da3
%if 0%{?suse_version} >= 1500 && %{node_version_number} >= 10
01c163
BuildRequires:  user(nobody)
1d3ce1
BuildRequires:  group(nobody)
356da3
%endif
356da3
463884
# shared openssl
356da3
%if ! 0%{with intree_openssl}
356da3
463884
BuildRequires:  pkgconfig(openssl) >= %{openssl_req_ver}
356da3
356da3
# require patched openssl library on SLES for nodejs16
de6b16
%if 0%{?suse_version} && "%{pkg_version openssl-1_1}" != "~~~"
356da3
%if %node_version_number >= 16 && 0%{suse_version} <= 1500 && %{pkg_vcmp openssl-1_1 < '1.1.1e' } && 0%{with openssl_RSA_get0_pss_params}
356da3
BuildRequires:  openssl-has-RSA_get0_pss_params
356da3
Requires:       openssl-has-RSA_get0_pss_params
356da3
%endif
356da3
%endif
356da3
356da3
%if 0%{?suse_version}
463884
463884
%if 0%{?suse_version} >= 1500
463884
BuildRequires:  openssl >= %{openssl_req_ver}
Bernhard M. Wiedemann 514c2a
BuildRequires:  (libopenssl1_1-hmac if libopenssl-1_1-devel)
Bernhard M. Wiedemann 514c2a
BuildRequires:  (libopenssl3-hmac if libopenssl-3-devel)
463884
%else
356da3
BuildRequires:  openssl-1_1 >= %{openssl_req_ver}
356da3
BuildRequires:  libopenssl1_1-hmac
463884
%endif
463884
Bernhard M. Wiedemann 514c2a
356da3
# /suse_version
356da3
%endif
356da3
356da3
%if 0%{?fedora_version}
356da3
BuildRequires:  openssl >= %{openssl_req_ver}
356da3
%endif
356da3
356da3
%else
463884
# bundled openssl
356da3
%if %node_version_number <= 12 && 0%{?suse_version} == 1315 && 0%{?sle_version} < 120400
de6b16
Provides:       bundled(openssl) = 3.0.7
356da3
%else
356da3
BuildRequires:  bundled_openssl_should_not_be_required
356da3
%endif
463884
463884
# /bundled openssl
356da3
%endif
356da3
356da3
%if ! 0%{with intree_cares}
356da3
BuildRequires:  pkgconfig(libcares) >= 1.17.0
356da3
%else
356da3
Provides:       bundled(libcares2) = 1.18.1
356da3
%endif
356da3
356da3
%if ! 0%{with intree_icu}
356da3
BuildRequires:  pkgconfig(icu-i18n) >= 69
356da3
%else
18d701
Provides:       bundled(icu) = 72.1
356da3
%endif
356da3
356da3
%if ! 0%{with intree_nghttp2}
356da3
BuildRequires:  libnghttp2-devel >= 1.41.0
356da3
%else
18d701
Provides:       bundled(nghttp2) = 1.51.0
356da3
%endif
356da3
356da3
%if 0%{with valgrind_tests}
356da3
BuildRequires:  valgrind
356da3
%endif
356da3
356da3
%if %{with libalternatives}
356da3
Requires:       alts
356da3
%else
1d3ce1
Requires(postun): %{_sbindir}/update-alternatives
356da3
%endif
356da3
# either for update-alternatives, or their removal
356da3
Requires(post): %{_sbindir}/update-alternatives
356da3
356da3
Recommends:     npm18
356da3
356da3
#we need ABI virtual provides where SONAMEs aren't enough/not present so deps
356da3
#break when binary compatibility is broken
356da3
%global nodejs_abi 18.0
356da3
Provides:       nodejs(abi) = %{nodejs_abi}
356da3
356da3
#this corresponds to the "engine" requirement in package.json
356da3
Provides:       nodejs(engine) = %{version}
356da3
356da3
# Multiple versions of NodeJS can be installed at a time, but
356da3
# to properly allow correct version execution from 3rd party
356da3
# npm software, `env node` requires further help than only
356da3
# update-alternatives can provide.
356da3
Provides:       nodejs = %{version}
356da3
%if %{with libalternatives}
356da3
Requires:       nodejs-common >= 5.0
356da3
%else
356da3
Requires:       nodejs-common
356da3
%endif
356da3
356da3
# For SLE11, to be able to use the certificate store we need to have properly
356da3
# symlinked certificates. The compatability symlinks are provided by the
356da3
# openssl1 library in the Security Module
356da3
%if 0%{?suse_version} == 1110
356da3
Requires:       openssl1
356da3
%endif
356da3
356da3
%if %node_version_number >= 12
356da3
%ifarch s390
356da3
ExclusiveArch:  not_buildable
356da3
%endif
356da3
%endif
356da3
01c163
Provides:       bundled(uvwasi) = 0.0.13
18d701
Provides:       bundled(libuv) = 1.44.2
18d701
Provides:       bundled(v8) = 10.2.154.23
356da3
%if %{with intree_brotli}
356da3
Provides:       bundled(brotli) = 1.0.9
356da3
%else
356da3
BuildRequires:  pkgconfig(libbrotlidec)
356da3
%endif
356da3
1d3ce1
21adda
Provides:       bundled(llhttp) = 6.0.10
21adda
Provides:       bundled(ngtcp2) = 0.8.1
18d701
Provides:       bundled(base64) = 0.5.0
18d701
356da3
18d701
Provides:       bundled(node-acorn) = 8.8.1
356da3
Provides:       bundled(node-acorn-walk) = 8.2.0
01c163
Provides:       bundled(node-busboy) = 1.6.0
356da3
Provides:       bundled(node-cjs-module-lexer) = 1.2.2
18d701
Provides:       bundled(node-corepack) = 0.15.2
01c163
Provides:       bundled(node-streamsearch) = 1.1.0
18d701
Provides:       bundled(node-undici) = 5.13.0
356da3
356da3
%description
356da3
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js
356da3
uses an event-driven, non-blocking I/O model. Node.js has a package ecosystem
356da3
provided by npm.
356da3
356da3
%package devel
356da3
Summary:        Development headers for NodeJS 18.x
356da3
Group:          Development/Languages/NodeJS
356da3
Provides:       nodejs-devel = %{version}
01c163
Requires:       npm18 = %{version}
1d3ce1
Requires:       %{name} = %{version}
356da3
356da3
%description devel
356da3
This package provides development headers for Node.js needed for creation
356da3
of binary modules.
356da3
356da3
%package -n npm18
356da3
Summary:        Package manager for Node.js
356da3
Group:          Development/Languages/NodeJS
356da3
%if %{with libalternatives}
356da3
Requires:       nodejs-common >= 5.0
356da3
%else
356da3
Requires:       nodejs-common
356da3
%endif
356da3
Requires:       nodejs18 = %{version}
356da3
Provides:       nodejs-npm = %{version}
356da3
Obsoletes:      nodejs-npm < 4.0.0
18d701
Provides:       npm(npm) = 8.19.3
1d3ce1
Provides:       npm = %{version}
356da3
%if 0%{?suse_version} >= 1500
356da3
%if %{node_version_number} >= 10
01c163
Requires:       user(nobody)
1d3ce1
Requires:       group(nobody)
356da3
%endif
356da3
%endif
356da3
Provides:       bundled(node-abbrev) = 1.1.1
356da3
Provides:       bundled(node-agent-base) = 6.0.2
356da3
Provides:       bundled(node-agentkeepalive) = 4.2.1
356da3
Provides:       bundled(node-aggregate-error) = 3.1.0
356da3
Provides:       bundled(node-ansi-regex) = 5.0.1
356da3
Provides:       bundled(node-ansi-styles) = 4.3.0
356da3
Provides:       bundled(node-aproba) = 2.0.0
356da3
Provides:       bundled(node-archy) = 1.0.0
356da3
Provides:       bundled(node-are-we-there-yet) = 3.0.1
356da3
Provides:       bundled(node-asap) = 2.0.6
356da3
Provides:       bundled(node-balanced-match) = 1.0.2
356da3
Provides:       bundled(node-bin-links) = 3.0.3
356da3
Provides:       bundled(node-binary-extensions) = 2.2.0
356da3
Provides:       bundled(node-brace-expansion) = 1.1.11
356da3
Provides:       bundled(node-brace-expansion) = 2.0.1
356da3
Provides:       bundled(node-builtins) = 5.0.1
356da3
Provides:       bundled(node-cacache) = 16.1.3
356da3
Provides:       bundled(node-chalk) = 4.1.2
356da3
Provides:       bundled(node-chownr) = 2.0.0
356da3
Provides:       bundled(node-cidr-regex) = 3.1.1
356da3
Provides:       bundled(node-clean-stack) = 2.2.0
356da3
Provides:       bundled(node-cli-columns) = 4.0.0
356da3
Provides:       bundled(node-cli-table3) = 0.6.2
356da3
Provides:       bundled(node-clone) = 1.0.4
356da3
Provides:       bundled(node-cmd-shim) = 5.0.0
356da3
Provides:       bundled(node-color-convert) = 2.0.1
356da3
Provides:       bundled(node-color-name) = 1.1.4
356da3
Provides:       bundled(node-color-support) = 1.1.3
356da3
Provides:       bundled(node-columnify) = 1.6.0
356da3
Provides:       bundled(node-common-ancestor-path) = 1.0.1
356da3
Provides:       bundled(node-concat-map) = 0.0.1
356da3
Provides:       bundled(node-console-control-strings) = 1.1.0
356da3
Provides:       bundled(node-cssesc) = 3.0.0
356da3
Provides:       bundled(node-debug) = 4.3.4
356da3
Provides:       bundled(node-debuglog) = 1.0.1
356da3
Provides:       bundled(node-defaults) = 1.0.3
356da3
Provides:       bundled(node-delegates) = 1.0.0
356da3
Provides:       bundled(node-depd) = 1.1.2
356da3
Provides:       bundled(node-dezalgo) = 1.0.4
356da3
Provides:       bundled(node-diff) = 5.1.0
356da3
Provides:       bundled(node-emoji-regex) = 8.0.0
356da3
Provides:       bundled(node-encoding) = 0.1.13
356da3
Provides:       bundled(node-env-paths) = 2.2.1
356da3
Provides:       bundled(node-err-code) = 2.0.3
356da3
Provides:       bundled(node-fastest-levenshtein) = 1.0.12
356da3
Provides:       bundled(node-fs-minipass) = 2.1.0
356da3
Provides:       bundled(node-fs.realpath) = 1.0.0
356da3
Provides:       bundled(node-function-bind) = 1.1.1
356da3
Provides:       bundled(node-gauge) = 4.0.4
356da3
Provides:       bundled(node-glob) = 7.2.3
356da3
Provides:       bundled(node-glob) = 8.0.3
356da3
Provides:       bundled(node-graceful-fs) = 4.2.10
356da3
Provides:       bundled(node-has) = 1.0.3
356da3
Provides:       bundled(node-has-flag) = 4.0.0
356da3
Provides:       bundled(node-has-unicode) = 2.0.1
18d701
Provides:       bundled(node-hosted-git-info) = 5.2.1
356da3
Provides:       bundled(node-http-cache-semantics) = 4.1.0
356da3
Provides:       bundled(node-http-proxy-agent) = 5.0.0
356da3
Provides:       bundled(node-https-proxy-agent) = 5.0.1
356da3
Provides:       bundled(node-humanize-ms) = 1.2.1
356da3
Provides:       bundled(node-iconv-lite) = 0.6.3
356da3
Provides:       bundled(node-ignore-walk) = 5.0.1
356da3
Provides:       bundled(node-imurmurhash) = 0.1.4
356da3
Provides:       bundled(node-indent-string) = 4.0.0
356da3
Provides:       bundled(node-infer-owner) = 1.0.4
356da3
Provides:       bundled(node-inflight) = 1.0.6
356da3
Provides:       bundled(node-inherits) = 2.0.4
356da3
Provides:       bundled(node-ini) = 3.0.1
356da3
Provides:       bundled(node-init-package-json) = 3.0.2
356da3
Provides:       bundled(node-ip) = 2.0.0
356da3
Provides:       bundled(node-ip-regex) = 4.3.0
356da3
Provides:       bundled(node-is-cidr) = 4.0.2
356da3
Provides:       bundled(node-is-core-module) = 2.10.0
356da3
Provides:       bundled(node-is-fullwidth-code-point) = 3.0.0
356da3
Provides:       bundled(node-is-lambda) = 1.0.1
356da3
Provides:       bundled(node-isexe) = 2.0.0
356da3
Provides:       bundled(node-json-parse-even-better-errors) = 2.3.1
356da3
Provides:       bundled(node-json-stringify-nice) = 1.1.4
356da3
Provides:       bundled(node-jsonparse) = 1.3.1
356da3
Provides:       bundled(node-just-diff) = 5.1.1
356da3
Provides:       bundled(node-just-diff-apply) = 5.4.1
356da3
Provides:       bundled(node-libnpmaccess) = 6.0.4
356da3
Provides:       bundled(node-libnpmdiff) = 4.0.5
18d701
Provides:       bundled(node-libnpmexec) = 4.0.14
18d701
Provides:       bundled(node-libnpmfund) = 3.0.5
356da3
Provides:       bundled(node-libnpmhook) = 8.0.4
356da3
Provides:       bundled(node-libnpmorg) = 4.0.4
356da3
Provides:       bundled(node-libnpmpack) = 4.1.3
356da3
Provides:       bundled(node-libnpmpublish) = 6.0.5
356da3
Provides:       bundled(node-libnpmsearch) = 5.0.4
356da3
Provides:       bundled(node-libnpmteam) = 4.0.4
356da3
Provides:       bundled(node-libnpmversion) = 3.0.7
356da3
Provides:       bundled(node-lru-cache) = 6.0.0
356da3
Provides:       bundled(node-lru-cache) = 7.13.2
356da3
Provides:       bundled(node-make-fetch-happen) = 10.2.1
356da3
Provides:       bundled(node-minimatch) = 3.1.2
356da3
Provides:       bundled(node-minimatch) = 5.1.0
356da3
Provides:       bundled(node-minipass) = 3.3.4
356da3
Provides:       bundled(node-minipass-collect) = 1.0.2
356da3
Provides:       bundled(node-minipass-fetch) = 2.1.1
356da3
Provides:       bundled(node-minipass-flush) = 1.0.5
356da3
Provides:       bundled(node-minipass-json-stream) = 1.0.1
356da3
Provides:       bundled(node-minipass-pipeline) = 1.2.4
356da3
Provides:       bundled(node-minipass-sized) = 1.0.3
356da3
Provides:       bundled(node-minizlib) = 2.1.2
356da3
Provides:       bundled(node-mkdirp) = 1.0.4
356da3
Provides:       bundled(node-mkdirp-infer-owner) = 2.0.0
356da3
Provides:       bundled(node-ms) = 2.1.2
356da3
Provides:       bundled(node-ms) = 2.1.3
356da3
Provides:       bundled(node-mute-stream) = 0.0.8
356da3
Provides:       bundled(node-negotiator) = 0.6.3
356da3
Provides:       bundled(node-node-gyp) = 9.1.0
356da3
Provides:       bundled(node-nopt) = 5.0.0
356da3
Provides:       bundled(node-nopt) = 6.0.0
356da3
Provides:       bundled(node-normalize-package-data) = 4.0.1
356da3
Provides:       bundled(node-npm-audit-report) = 3.0.0
356da3
Provides:       bundled(node-npm-bundled) = 1.1.2
356da3
Provides:       bundled(node-npm-bundled) = 2.0.1
356da3
Provides:       bundled(node-npm-install-checks) = 5.0.0
356da3
Provides:       bundled(node-npm-normalize-package-bin) = 1.0.1
356da3
Provides:       bundled(node-npm-normalize-package-bin) = 2.0.0
356da3
Provides:       bundled(node-npm-package-arg) = 9.1.0
356da3
Provides:       bundled(node-npm-packlist) = 5.1.3
356da3
Provides:       bundled(node-npm-pick-manifest) = 7.0.2
356da3
Provides:       bundled(node-npm-profile) = 6.2.1
356da3
Provides:       bundled(node-npm-registry-fetch) = 13.3.1
356da3
Provides:       bundled(node-npm-user-validate) = 1.0.1
356da3
Provides:       bundled(node-npmlog) = 6.0.2
356da3
Provides:       bundled(node-once) = 1.4.0
356da3
Provides:       bundled(node-opener) = 1.5.2
356da3
Provides:       bundled(node-p-map) = 4.0.0
356da3
Provides:       bundled(node-pacote) = 13.6.2
356da3
Provides:       bundled(node-parse-conflict-json) = 2.0.2
356da3
Provides:       bundled(node-path-is-absolute) = 1.0.1
356da3
Provides:       bundled(node-postcss-selector-parser) = 6.0.10
356da3
Provides:       bundled(node-proc-log) = 2.0.1
356da3
Provides:       bundled(node-promise-all-reject-late) = 1.0.1
356da3
Provides:       bundled(node-promise-call-limit) = 1.0.1
356da3
Provides:       bundled(node-promise-inflight) = 1.0.1
356da3
Provides:       bundled(node-promise-retry) = 2.0.1
356da3
Provides:       bundled(node-promzard) = 0.3.0
356da3
Provides:       bundled(node-qrcode-terminal) = 0.12.0
356da3
Provides:       bundled(node-read) = 1.0.7
356da3
Provides:       bundled(node-read-cmd-shim) = 3.0.0
356da3
Provides:       bundled(node-read-package-json) = 5.0.2
356da3
Provides:       bundled(node-read-package-json-fast) = 2.0.3
356da3
Provides:       bundled(node-readable-stream) = 3.6.0
356da3
Provides:       bundled(node-readdir-scoped-modules) = 1.1.0
356da3
Provides:       bundled(node-retry) = 0.12.0
356da3
Provides:       bundled(node-rimraf) = 3.0.2
356da3
Provides:       bundled(node-safe-buffer) = 5.2.1
356da3
Provides:       bundled(node-safer-buffer) = 2.1.2
356da3
Provides:       bundled(node-semver) = 7.3.7
356da3
Provides:       bundled(node-set-blocking) = 2.0.0
356da3
Provides:       bundled(node-signal-exit) = 3.0.7
356da3
Provides:       bundled(node-smart-buffer) = 4.2.0
356da3
Provides:       bundled(node-socks) = 2.7.0
356da3
Provides:       bundled(node-socks-proxy-agent) = 7.0.0
356da3
Provides:       bundled(node-spdx-correct) = 3.1.1
356da3
Provides:       bundled(node-spdx-exceptions) = 2.3.0
356da3
Provides:       bundled(node-spdx-expression-parse) = 3.0.1
356da3
Provides:       bundled(node-spdx-license-ids) = 3.0.11
356da3
Provides:       bundled(node-ssri) = 9.0.1
01c163
Provides:       bundled(node-string_decoder) = 1.3.0
1d3ce1
Provides:       bundled(node-string-width) = 4.2.3
356da3
Provides:       bundled(node-strip-ansi) = 6.0.1
356da3
Provides:       bundled(node-supports-color) = 7.2.0
356da3
Provides:       bundled(node-tar) = 6.1.11
356da3
Provides:       bundled(node-text-table) = 0.2.0
356da3
Provides:       bundled(node-tiny-relative-date) = 1.3.0
356da3
Provides:       bundled(node-treeverse) = 2.0.0
356da3
Provides:       bundled(node-unique-filename) = 2.0.1
356da3
Provides:       bundled(node-unique-slug) = 3.0.0
356da3
Provides:       bundled(node-util-deprecate) = 1.0.2
356da3
Provides:       bundled(node-validate-npm-package-license) = 3.0.4
356da3
Provides:       bundled(node-validate-npm-package-name) = 4.0.0
356da3
Provides:       bundled(node-walk-up-path) = 1.0.0
356da3
Provides:       bundled(node-wcwidth) = 1.0.1
356da3
Provides:       bundled(node-which) = 2.0.2
356da3
Provides:       bundled(node-wide-align) = 1.1.5
356da3
Provides:       bundled(node-wrappy) = 1.0.2
356da3
Provides:       bundled(node-write-file-atomic) = 4.0.2
356da3
Provides:       bundled(node-yallist) = 4.0.0
356da3
356da3
%description -n npm18
356da3
A package manager for Node.js that allows developers to install and
356da3
publish packages to a package registry.
356da3
356da3
%package -n corepack18
356da3
Summary:        Helper bridge between NodeJS projects and their dependencies
356da3
Group:          Development/Languages/NodeJS
356da3
Requires:       nodejs-common >= 5.0
356da3
356da3
%description -n corepack18
356da3
Zero-runtime-dependency package acting as bridge between Node projects
356da3
and their package managers.
356da3
356da3
%package docs
356da3
Summary:        Node.js API documentation
356da3
Group:          Documentation/Other
356da3
%if 0%{?suse_version} >= 1200
356da3
# using noarch subpackage seems to break debuginfo on older releases
356da3
BuildArch:      noarch
356da3
%endif
356da3
356da3
%description docs
356da3
The API documentation for the Node.js JavaScript runtime.
356da3
356da3
%prep
356da3
%if ! %{git_node}
356da3
echo "`grep node-v%{version}.tar.xz %{S:1} | head -n1 | cut -c1-64`  %{S:0}" | sha256sum -c
356da3
%setup -q -n node-v%{version}
356da3
%else
356da3
%setup -q -n node-%{version}
356da3
%endif
356da3
356da3
%if %{node_version_number} <= 10
356da3
rm -r deps/npm/*
18d701
pushd deps/npm
18d701
tar zxf %{SOURCE9} --strip-components=1
18d701
tar Jxf %{SOURCE90}
356da3
%endif
356da3
356da3
%if %{node_version_number} >= 10
356da3
tar Jxf %{SOURCE11}
356da3
%endif
356da3
18d701
# downgrade node-gyp to last version that supports python 3.4 for SLE12
18d701
%if 0%{?suse_version} && 0%{?suse_version} < 1500 && 0%{node_version_number} >= 16
18d701
rm -r  deps/npm/node_modules/node-gyp
18d701
mkdir deps/npm/node_modules/node-gyp
18d701
pushd deps/npm/node_modules/node-gyp
18d701
tar Jxf %{SOURCE5}
18d701
popd
18d701
%endif
18d701
356da3
%patch1 -p1
356da3
%patch3 -p1
18d701
%if %{node_version_number} <= 12 && 0%{?suse_version} < 1500
356da3
%patch5 -p1
18d701
%endif
356da3
%patch7 -p1
356da3
%if 0%{with valgrind_tests}
356da3
%endif
356da3
%patch13 -p1
356da3
%patch100 -p1
356da3
%patch101 -p1
356da3
%patch102 -p1
356da3
# Add check_output to configure script (not part of Python 2.6 in SLE11).
356da3
%if 0%{?suse_version} == 1110
356da3
%endif
356da3
%patch104 -p1
356da3
%patch106 -p1
356da3
%patch110 -p1
356da3
%patch120 -p1
356da3
%patch132 -p1
356da3
%if ! 0%{with openssl_RSA_get0_pss_params}
356da3
%patch133 -p1
356da3
%endif
356da3
%patch200 -p1
356da3
0ecac8
%patch305 -p1
463884
%patch307 -p1
356da3
356da3
%if %{node_version_number} <= 12
356da3
# minimist security update - patch50
356da3
rm -r deps/npm/node_modules/mkdirp/node_modules/minimist
356da3
rmdir ./deps/npm/node_modules/mkdirp/node_modules
356da3
%endif
356da3
356da3
# remove backup files, if any
356da3
find -name \*~ -print0 -delete
356da3
356da3
# abnormalities from patching
356da3
find \( -name \*.js.orig -or -name \*.md.orig -or -name \*.1.orig \) -delete
356da3
356da3
1d3ce1
356da3
%build
356da3
# normalize shebang
356da3
%if %{node_version_number} >= 12
356da3
find -type f -exec sed -i -e '1 s,^#!\s\?/usr/bin/env python\d*$,#!/usr/bin/python3,' -e '1 s,^#!\s\?/usr/bin/python$,#!/usr/bin/python3,' {} +
356da3
%else
356da3
find -type f -exec sed -i '1 s,^#!\s\?/usr/bin/env python$,#!/usr/bin/python,' {} +
356da3
%endif
356da3
find deps/npm -type f -exec sed -i '1 s,^#!\s\?/usr/bin/env node$,#!/usr/bin/node%{node_version_number},' {} +
356da3
find deps/npm -type f -exec sed -i '1 s,^#!\s\?/usr/bin/env \(bash\|sh\)\?$,#!/bin/bash,' {} +
356da3
356da3
. %{SOURCE20}
356da3
# Make sure nothing gets included from bundled deps:
356da3
# We only delete the source and header files, because
356da3
# the remaining build scripts are still used.
356da3
%if ! 0%{with intree_openssl}
356da3
find deps/openssl -name *.[ch] -delete
356da3
%endif
356da3
356da3
%if ! 0%{with intree_icu}
356da3
rm -rf deps/icu-small
356da3
%endif
356da3
356da3
%if ! 0%{with intree_cares}
356da3
find deps/cares -name *.[ch] -delete
356da3
%endif
356da3
356da3
find deps/zlib -name *.[ch] -delete
356da3
356da3
cat > spec.build.config <
356da3
export PREFIX=/usr
356da3
export CFLAGS="%{?build_cflags:%build_cflags}%{?!build_cflags:%optflags} -fno-strict-aliasing"
356da3
# -Wno-class-memaccess is not available in gcc < 8 (= system compiler on Leap until at least 15.3 is gcc7)
356da3
export CXXFLAGS="%{?build_cxxflags:%build_cxxflags}%{?!build_cxxflags:%optflags} -Wno-error=return-type -fno-strict-aliasing"
356da3
%if 0%{?forced_gcc_version} >= 8 || 0%{?suse_version} > 1500 || 0%{?fedora_version} >= 35
356da3
export CXXFLAGS="\${CXXFLAGS} -Wno-class-memaccess"
356da3
%endif
356da3
export LDFLAGS="%{?build_ldflags}"
356da3
356da3
%if !0%{?with nodejs_lto}
356da3
export LDFLAGS="\${LDFLAGS} -fno-lto"
356da3
%endif
356da3
356da3
# reduce disk space pressure
356da3
export CFLAGS="\${CFLAGS} -g1"
356da3
export CXXFLAGS="\${CXXFLAGS} -g1"
356da3
export LDFLAGS="\${LDFLAGS} -Wl,--reduce-memory-overhead"
356da3
356da3
%if 0%{?forced_gcc_version:1}
356da3
export CC=gcc-%{forced_gcc_version}
356da3
export CXX=g++-%{forced_gcc_version}
356da3
%endif
356da3
356da3
EOF
356da3
356da3
. ./spec.build.config
356da3
356da3
# Node.js 4.x does not include the ICU database in the source tarball.
356da3
%define has_small_icu %(test -d "deps/icu-small" && echo 1 || echo 0)
356da3
356da3
./configure \
356da3
    --prefix=%{_prefix} \
356da3
%if 0%{?with nodejs_lto}
356da3
    --enable-lto \
356da3
%endif
356da3
%if ! 0%{with intree_openssl}
356da3
    --shared-openssl \
356da3
%endif
356da3
    --shared-zlib \
356da3
%if ! 0%{with intree_cares}
356da3
    --shared-cares \
356da3
%endif
356da3
%if ! 0%{with intree_icu}
356da3
    --with-intl=system-icu \
356da3
%else
356da3
%if %{has_small_icu}
356da3
    --with-intl=small-icu \
356da3
    --with-icu-source=deps/icu-small \
356da3
%endif
356da3
%endif
356da3
%if ! 0%{with intree_nghttp2}
356da3
    --shared-nghttp2 \
356da3
%endif
356da3
%if ! 0%{with intree_brotli}
356da3
    --shared-brotli \
356da3
%endif
356da3
%if 0%{with gdb}
356da3
    --gdb \
356da3
%endif
1d3ce1
%if %{node_version_number} < 19
356da3
    --without-dtrace \
1d3ce1
%endif
356da3
%if %{node_version_number} >= 16 && (0%{?suse_version} > 1550 || 0%{?sle_version} >= 150400)
356da3
    --openssl-default-cipher-list=PROFILE=SYSTEM \
356da3
%endif
356da3
    --openssl-use-def-ca-store
356da3
356da3
decoupled_cmd make %{?_smp_mflags}
356da3
356da3
# Fix documentation permissions
356da3
find doc/api -type f -exec chmod 0644 {} +
356da3
356da3
%install
356da3
. %{SOURCE20}
356da3
. ./spec.build.config
356da3
356da3
decoupled_cmd %make_install %{?_smp_mflags}
356da3
rm %{buildroot}%{_datadir}/doc/node/gdbinit
356da3
rm -f %{buildroot}%{_datadir}/doc/node/lldbinit
356da3
rm -f %{buildroot}%{_datadir}/doc/node/lldb_commands.py
356da3
356da3
# remove .bak files, if any
356da3
find %{buildroot} -name \*.bak -print -delete
356da3
356da3
# npm/npx man page
356da3
install -D -m 644 deps/npm/man/man1/npm.1 %{buildroot}%{_mandir}/man1/npm%{node_version_number}.1
356da3
install -D -m 644 deps/npm/man/man1/npx.1 %{buildroot}%{_mandir}/man1/npx%{node_version_number}.1
356da3
356da3
#node-gyp needs common.gypi too
356da3
install -D -m 644 common.gypi \
356da3
        %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules/node-gyp/common.gypi
356da3
#       %%{buildroot}%%{_datadir}/node/common.gypi
356da3
# install addon-rpm.gypi
356da3
install -D -m 644 addon-rpm.gypi \
356da3
       %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules/node-gyp/addon-rpm.gypi
356da3
356da3
# clean
356da3
# hidden files and directories
356da3
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number} -name ".*" -exec rm -Rf -- {} +
356da3
# windows stuff
356da3
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number} -name "*.bat" -delete
356da3
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number} -name "*.cmd" -delete
356da3
# build stuff
356da3
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number} -name "Makefile" -delete
356da3
rm -rf %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/{test,scripts}
356da3
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules -name "*.sh" -delete
356da3
rm -rf %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules/node-gyp/src
356da3
# remove examples/tests/benchmark stuff
356da3
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules -name "example*" -exec rm -Rf -- {} +
356da3
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules -name "*_test.*" -delete
356da3
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules -type d -name "benchmark" -exec rm -Rf -- {} +
356da3
356da3
# fix permissions
356da3
chmod 0755 %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/bin/np*-cli.js
356da3
! test -f %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/bin/node-gyp-bin/node-gyp || \
356da3
    chmod 0755 %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/bin/node-gyp-bin/node-gyp
356da3
chmod 0755 %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules/node-gyp/bin/node-gyp.js
356da3
! test -f %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules/npm-lifecycle/node-gyp-bin/node-gyp || \
356da3
    chmod 0755 %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules/npm-lifecycle/node-gyp-bin/node-gyp
356da3
356da3
# browser.js is useless for npm cli
356da3
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number} -name "browser.js" -delete
356da3
356da3
# file duplicates
356da3
%fdupes %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}
356da3
%fdupes %{buildroot}%{_includedir}/node%{node_version_number}
356da3
356da3
# Update alternatives
356da3
%if ! %{with libalternatives}
356da3
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
356da3
ln -s -f node-default     %{buildroot}%{_sysconfdir}/alternatives/node-default
356da3
ln -s -f node.1%{ext_man} %{buildroot}%{_sysconfdir}/alternatives/node.1%{ext_man}
356da3
ln -s -f npm-default      %{buildroot}%{_sysconfdir}/alternatives/npm-default
356da3
ln -s -f npm.1%{ext_man}  %{buildroot}%{_sysconfdir}/alternatives/npm.1%{ext_man}
356da3
ln -s %{_sysconfdir}/alternatives/node-default         %{buildroot}%{_bindir}/node-default
356da3
ln -s %{_sysconfdir}/alternatives/node.1%{ext_man}     %{buildroot}%{_mandir}/man1/node.1%{ext_man}
356da3
ln -s %{_sysconfdir}/alternatives/npm-default          %{buildroot}%{_bindir}/npm-default
356da3
ln -s %{_sysconfdir}/alternatives/npm.1%{ext_man}      %{buildroot}%{_mandir}/man1/npm.1%{ext_man}
356da3
ln -s -f npx-default      %{buildroot}%{_sysconfdir}/alternatives/npx-default
356da3
ln -s -f npx.1%{ext_man}  %{buildroot}%{_sysconfdir}/alternatives/npx.1%{ext_man}
356da3
ln -s %{_sysconfdir}/alternatives/npx-default          %{buildroot}%{_bindir}/npx-default
356da3
ln -s %{_sysconfdir}/alternatives/npx.1%{ext_man}      %{buildroot}%{_mandir}/man1/npx.1%{ext_man}
356da3
%endif
356da3
356da3
# libalternatives - can always ship
356da3
mkdir -p %{buildroot}%{_datadir}/libalternatives/{node,npm,npx};
356da3
cat > %{buildroot}%{_datadir}/libalternatives/node/%{node_version_number}.conf <
356da3
binary=%{_bindir}/node%{node_version_number}
356da3
man=node%{node_version_number}.1
356da3
EOF
356da3
cat > %{buildroot}%{_datadir}/libalternatives/npm/%{node_version_number}.conf <
356da3
binary=%{_bindir}/npm%{node_version_number}
356da3
man=npm%{node_version_number}.1
356da3
group=npm,npx
356da3
EOF
356da3
cat > %{buildroot}%{_datadir}/libalternatives/npx/%{node_version_number}.conf <
356da3
binary=%{_bindir}/npx%{node_version_number}
356da3
man=npx%{node_version_number}.1
356da3
group=npm,npx
356da3
EOF
356da3
356da3
# We need to own license directory on old versions of SLE
356da3
%if 0%{?suse_version} < 1500
356da3
mkdir -p %{buildroot}%{_defaultlicensedir}
356da3
%endif
356da3
356da3
%check
356da3
. ./spec.build.config
356da3
356da3
# Relax the crypto policies for the test-suite
356da3
export OPENSSL_SYSTEM_CIPHERS_OVERRIDE=xyz_nonexistent_file
356da3
export OPENSSL_CONF=''
356da3
356da3
export CI_JS_SUITES=default
356da3
export NODE_TEST_NO_INTERNET=1
356da3
356da3
%if %{node_version_number} >= 12
356da3
find test \( -name \*.out -or -name \*.js \) -exec sed -i 's,Use `node ,Use `node%{node_version_number} ,' {} \;
356da3
%endif
356da3
5e9c1e
# Update the python3 executable name to point at forced python version
5e9c1e
# needed to fix build on SLE12 SP5
5e9c1e
%if 0%{?forced_python_version:1}
5e9c1e
sed -i -e "s,'python3','python%{forced_python_version}'," test/parallel/test-child-process-set-blocking.js
5e9c1e
%endif
5e9c1e
356da3
ln addon-rpm.gypi deps/npm/node_modules/node-gyp/addon-rpm.gypi
356da3
# Tarball doesn't have eslint package distributed, so disable some tests
356da3
find test -name \*-eslint-\* -print -delete
21adda
# No documentation is generated, don't bother checking it, and check broken on older nodejs
21adda
%if %{node_version_number} <= 10
21adda
rm test/doctool/test-make-doc.js
21adda
%endif
356da3
# DNS lookup doesn't work in build root
356da3
rm test/parallel/test-dns-cancel-reverse-lookup.js \
356da3
   test/parallel/test-dns-resolveany.js
356da3
# multicast test fail since no socket?
356da3
rm test/parallel/test-dgram-membership.js
356da3
356da3
%if %{node_version_number} >= 18
356da3
# OBS broken /etc/hosts -- https://github.com/openSUSE/open-build-service/issues/13104
356da3
rm test/parallel/test-net-socket-connect-without-cb.js test/parallel/test-tcp-wrap-listen.js
356da3
%endif
356da3
356da3
%if 0%{?fedora_version}
356da3
# test/parallel/test-crypto-certificate.js requires OPENSSL_ENABLE_MD5_VERIFY=1
356da3
# as SPKAC required MD5 for verification
356da3
# https://src.fedoraproject.org/rpms/openssl/blob/rawhide/f/0006-Disable-signature-verification-with-totally-unsafe-h.patch
356da3
export OPENSSL_ENABLE_MD5_VERIFY=1
356da3
356da3
# test failures
356da3
# error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake
356da3
# failure:ssl/record/rec_layer_s3.c:1543:SSL alert number 40
356da3
rm test/parallel/test-tls-no-sslv3.js
356da3
%if %{node_version_number} >= 18
356da3
rm -r test/addons/openssl-providers
356da3
rm test/parallel/test-crypto-fips.js
356da3
%endif
356da3
356da3
%endif
356da3
# fedora
356da3
0ecac8
# qemu test failures
0ecac8
%if %{node_version_number} >= 18 && 0%{?qemu_user_space_build}
0ecac8
# sequential/test-debugger-*: timeout hit?
0ecac8
rm -v test/*/test-debugger-*.js
0ecac8
# parallel tests are not parallel under qemu
0ecac8
rm -v test/parallel/test-*.js test/parallel/test-*.mjs
0ecac8
# RuntimeError: memory access out of bounds
0ecac8
rm -v test/wasi/test-*.js
0ecac8
# ESM import hits assertion, timeout error?
0ecac8
rm -v test/es-module/test-esm-*.js
0ecac8
# AssertionError [ERR_ASSERTION]: Missing expected exception
0ecac8
rm -v test/js-native-api/test_constructor/test*.js
0ecac8
# Too slow for performance tests
0ecac8
rm -v test/sequential/test-perf-*.js test/sequential/test-diagnostic-*.js
0ecac8
%endif
0ecac8
356da3
# Run CI tests
356da3
%if 0%{with valgrind_tests}
356da3
# valgrind may have false positives, so do not fail on these by default
356da3
make test-valgrind ||:
356da3
%endif
356da3
make test-ci
356da3
356da3
%files
356da3
%defattr(-, root, root)
356da3
%license LICENSE
18d701
%doc doc/changelogs/CHANGELOG_V%{node_version_number}.md
356da3
%doc AUTHORS *.md
356da3
%doc deps/v8/tools/gdbinit
356da3
%dir %{_libdir}/node_modules
356da3
%dir %{_datadir}/libalternatives
356da3
%dir %{_datadir}/libalternatives/node
356da3
%{_datadir}/libalternatives/node/%{node_version_number}.conf
356da3
%{_bindir}/node%{node_version_number}
356da3
%{_mandir}/man1/node%{node_version_number}.1%{ext_man}
356da3
%if ! 0%{with libalternatives}
356da3
%ghost %{_bindir}/node-default
356da3
%ghost %{_mandir}/man1/node.1%{ext_man}
356da3
%ghost %{_sysconfdir}/alternatives/node-default
356da3
%ghost %{_sysconfdir}/alternatives/node.1%{ext_man}
356da3
%endif
356da3
%exclude %{_libdir}/node_modules/npm%{node_version_number}
356da3
# We need to own directory on old versions of SLE
356da3
%if 0%{?suse_version} < 1500
356da3
%dir %{_defaultlicensedir}
356da3
%endif
356da3
356da3
%files -n npm%{node_version_number}
356da3
%defattr(-, root, root)
356da3
%dir %{_datadir}/libalternatives
356da3
%dir %{_datadir}/libalternatives/npm
356da3
%dir %{_datadir}/libalternatives/npx
356da3
%{_datadir}/libalternatives/npm/%{node_version_number}.conf
356da3
%{_datadir}/libalternatives/npx/%{node_version_number}.conf
356da3
%{_bindir}/npm%{node_version_number}
356da3
%{_libdir}/node_modules/npm%{node_version_number}
356da3
%{_mandir}/man1/npm%{node_version_number}.1%{ext_man}
356da3
%if ! 0%{with libalternatives}
356da3
%ghost %{_bindir}/npm-default
356da3
%ghost %{_mandir}/man1/npm.1%{ext_man}
356da3
%ghost %{_sysconfdir}/alternatives/npm-default
356da3
%ghost %{_sysconfdir}/alternatives/npm.1%{ext_man}
356da3
%endif
356da3
356da3
%{_bindir}/npx%{node_version_number}
356da3
%{_mandir}/man1/npx%{node_version_number}.1%{ext_man}
356da3
%if ! %{with libalternatives}
356da3
%ghost %{_bindir}/npx-default
356da3
%ghost %{_mandir}/man1/npx.1%{ext_man}
356da3
%ghost %{_sysconfdir}/alternatives/npx-default
356da3
%ghost %{_sysconfdir}/alternatives/npx.1%{ext_man}
356da3
%endif
356da3
356da3
%if %{node_version_number} >= 14
356da3
%files -n corepack%{node_version_number}
356da3
%defattr(-, root, root)
356da3
%{_bindir}/corepack%{node_version_number}
356da3
%{_libdir}/node_modules/corepack%{node_version_number}
356da3
%endif
356da3
356da3
%files devel
356da3
%defattr(-, root, root)
356da3
%{_includedir}/node%{node_version_number}
1d3ce1
%if %{node_version_number} < 19
356da3
%dir %{_datadir}/systemtap
356da3
%dir %{_datadir}/systemtap/tapset
356da3
%{_datadir}/systemtap/tapset/node%{node_version_number}.stp
1d3ce1
%endif
356da3
356da3
%files docs
356da3
%defattr(-,root,root)
356da3
%doc doc/api
356da3
356da3
%if %{with libalternatives}
356da3
356da3
%post
356da3
update-alternatives --remove node-default %{_bindir}/node%{node_version_number}
356da3
356da3
%post -n npm%{node_version_number}
356da3
update-alternatives --remove npm-default %{_bindir}/npm%{node_version_number}
356da3
update-alternatives --remove npx-default %{_bindir}/npx%{node_version_number}
356da3
356da3
%else
356da3
%pre
356da3
# remove files that are no longer owned but provided by update-alternatives
356da3
if ! [ -L %{_mandir}/man1/node.1%{ext_man} ]; then
356da3
    rm -f %{_mandir}/man1/node.1%{ext_man}
356da3
fi
356da3
356da3
%post
356da3
update-alternatives \
356da3
        --install %{_bindir}/node-default node-default %{_bindir}/node%{node_version_number} %{node_version_number} \
356da3
        --slave %{_mandir}/man1/node.1%{ext_man} node.1%{ext_man} %{_mandir}/man1/node%{node_version_number}.1%{ext_man}
356da3
356da3
%postun
356da3
if [ ! -f %{_bindir}/node%{node_version_number} ] ; then
356da3
    update-alternatives --remove node-default %{_bindir}/node%{node_version_number}
356da3
fi
356da3
356da3
%pre -n npm%{node_version_number}
356da3
# remove files that are no longer owned but provided by update-alternatives
356da3
if ! [ -L %{_mandir}/man1/npm.1%{ext_man} ]; then
356da3
    rm -f %{_mandir}/man1/npm.1%{ext_man}
356da3
fi
356da3
356da3
%post -n npm%{node_version_number}
356da3
update-alternatives \
356da3
        --install %{_bindir}/npm-default npm-default %{_bindir}/npm%{node_version_number} %{node_version_number} \
356da3
        --slave %{_mandir}/man1/npm.1%{ext_man} npm.1%{ext_man} %{_mandir}/man1/npm%{node_version_number}.1%{ext_man}
356da3
update-alternatives \
356da3
        --install %{_bindir}/npx-default npx-default %{_bindir}/npx%{node_version_number} %{node_version_number} \
356da3
        --slave %{_mandir}/man1/npx.1%{ext_man} npx.1%{ext_man} %{_mandir}/man1/npx%{node_version_number}.1%{ext_man}
356da3
356da3
%postun -n npm%{node_version_number}
356da3
if [ ! -f %{_bindir}/npm%{node_version_number} ] ; then
356da3
    update-alternatives --remove npm-default %{_bindir}/npm%{node_version_number}
356da3
fi
356da3
if [ ! -f %{_bindir}/npx%{node_version_number} ] ; then
356da3
    update-alternatives --remove npx-default %{_bindir}/npx%{node_version_number}
356da3
fi
356da3
356da3
%endif
356da3
356da3
%changelog