Blame packages/n/nodejs19/nodejs19.spec

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