File nodejs16.spec of Package nodejs16
1018
1
#
2
# spec file for package nodejs16
3
#
4
# Copyright (c) 2022 SUSE LLC
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via https://bugs.opensuse.org/
16
#
17
18
###########################################################
19
#
20
# WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
21
#
22
# This spec file is generated from a template hosted at
23
# https://github.com/AdamMajer/nodejs-packaging
24
#
25
###########################################################
26
27
# Fedora doesn't have rpm-config-SUSE which provides
28
# ext_man in /usr/lib/rpm/macros.d/macros.obs
29
%if 0%{?fedora_version}
30
%define ext_man .gz
31
%endif
32
33
Name: nodejs16
34
Version: 16.14.1
35
Release: 0
36
37
# Double DWZ memory limits
38
%define _dwz_low_mem_die_limit 20000000
39
%define _dwz_max_die_limit 100000000
40
41
%define node_version_number 16
42
43
# openssl bsc#1192489 - fix released
44
%bcond_without openssl_RSA_get0_pss_params
45
46
%if 0%{?suse_version} > 1500 || 0%{?fedora_version}
47
%bcond_without libalternatives
48
%else
49
%bcond_with libalternatives
50
%endif
51
52
%if %node_version_number >= 12
53
%define openssl_req_ver 1.1.1
54
%else
55
%if %node_version_number >= 10
56
%define openssl_req_ver 1.1.0
57
%else
58
%define openssl_req_ver 1.0.2
59
%endif
60
%endif
61
62
%bcond_with valgrind_tests
63
64
%if %{node_version_number} >= 12
65
66
# turn on LTO only on non-32bit arches
67
%ifarch %{ix86} %{arm}
68
%bcond_with nodejs_lto
69
%else
70
%bcond_without nodejs_lto
71
%endif
72
73
%else
74
%bcond_with nodejs_lto
75
%endif
76
77
%if !0%{?with nodejs_lto}
78
%define _lto_cflags %{nil}
79
%endif
80
81
%if 0%{?suse_version} == 1110
82
%define _libexecdir %{_exec_prefix}/lib
83
%endif
84
85
%if 0%{?suse_version} >= 1500 || 0%{?sle_version} >= 120400 || 0%{?fedora_version} >= 35
86
%bcond_with intree_openssl
87
%else
88
%bcond_without intree_openssl
89
%endif
90
91
%if 0%{?suse_version} >= 1330 || 0%{?fedora_version} >= 35
92
%bcond_with intree_cares
93
%else
94
%bcond_without intree_cares
95
%endif
96
97
%if 0%{?suse_version} >= 1500 || 0%{?fedora_version} >= 35
98
%bcond_with intree_icu
99
%else
100
%bcond_without intree_icu
101
%endif
102
103
%if 0%{?suse_version} >= 1550 || 0%{?fedora_version} >= 35
104
%bcond_with intree_nghttp2
105
%else
106
%bcond_without intree_nghttp2
107
%endif
108
109
%ifnarch x86_64 %{ix86}
110
%bcond_with gdb
111
%else
112
%bcond_without gdb
113
%endif
114
115
%define git_node 0
116
117
Summary: Evented I/O for V8 JavaScript
118
License: MIT
119
Group: Development/Languages/NodeJS
120
URL: https://nodejs.org
121
Source: https://nodejs.org/dist/v%{version}/node-v%{version}.tar.xz
122
Source1: https://nodejs.org/dist/v%{version}/SHASUMS256.txt
123
Source2: https://nodejs.org/dist/v%{version}/SHASUMS256.txt.sig
124
Source3: nodejs.keyring
125
126
# Only required to run unit tests in NodeJS 10+
127
Source10: update_npm_tarball.sh
128
Source11: node_modules.tar.xz
129
Source20: bash_output_helper.bash
130
131
## Patches not distribution specific
132
Patch1: cares_public_headers.patch
133
Patch3: fix_ci_tests.patch
134
Patch5: sle12_python3_compat.patch
135
Patch7: manual_configure.patch
136
Patch13: openssl_binary_detection.patch
137
138
139
140
## Patches specific to SUSE and openSUSE
141
Patch100: linker_lto_jobs.patch
142
# PATCH-FIX-OPENSUSE -- set correct path for dtrace if it is built
143
Patch101: nodejs-libpath.patch
144
# PATCH-FIX-UPSTREAM -- use custom addon.gypi by default instead of
145
# downloading node source
146
Patch102: node-gyp-addon-gypi.patch
147
# PATCH-FIX-SLE -- configure script uses Python check_output method
148
# which isn't included in Python 2.6 (used in SLE 11).
149
# PATCH-FIX-OPENSUSE -- install user global npm packages to /usr/local
150
# instead of /usr
151
Patch104: npm_search_paths.patch
152
Patch106: skip_no_console.patch
153
Patch110: legacy_python.patch
154
155
Patch120: flaky_test_rerun.patch
156
157
Patch132: test-skip-y2038-on-32bit-time_t.patch
158
Patch133: rsa-pss-revert.patch
159
160
# Use versioned binaries and paths
161
Patch200: versioned.patch
162
163
BuildRequires: pkg-config
164
BuildRequires: fdupes
165
BuildRequires: procps
166
BuildRequires: xz
167
BuildRequires: zlib-devel
168
169
%if 0%{?suse_version}
170
BuildRequires: config(netcfg)
171
%endif
172
173
# SLE-11 target only
174
# Node.js 6 requires GCC 4.8.5+.
175
#
176
# For Node.js 8.x, upstream requires GCC 4.9.4+, as GCC 4.8 may have
177
# slightly buggy C++11 support: https://github.com/nodejs/node/pull/13466
178
#
179
# If the default compiler is not supported, use the most recent compiler
180
# version available.
181
%if 0%{?suse_version} == 1110
182
# GCC 5 is only available in the SUSE:SLE-11:SP4:Update repository (SDK).
183
%if %node_version_number >= 8
184
BuildRequires: gcc5-c++
185
%define forced_gcc_version 5
186
%else
187
BuildRequires: gcc48-c++
188
%define forced_gcc_version 4.8
189
%endif
190
%endif
191
# sles == 11 block
192
193
# Pick and stick with "latest" compiler at time of LTS release
194
# for SLE-12:Update targets
195
%if 0%{?suse_version} == 1315
196
%if %node_version_number >= 17
197
BuildRequires: gcc10-c++
198
%define forced_gcc_version 10
199
%else
200
%if %node_version_number >= 14
201
BuildRequires: gcc9-c++
202
%define forced_gcc_version 9
203
%else
204
%if %node_version_number >= 8
205
BuildRequires: gcc7-c++
206
%define forced_gcc_version 7
207
%endif
208
%endif
209
%endif
210
%endif
211
212
%if 0%{?suse_version} == 1500
213
%if %node_version_number >= 17
214
BuildRequires: gcc10-c++
215
%define forced_gcc_version 10
216
%endif
217
%endif
218
# compiler selection
219
220
# No special version defined, use default.
221
%if ! 0%{?forced_gcc_version:1}
222
BuildRequires: gcc-c++
223
%endif
224
225
226
# Python dependencies
227
%if %node_version_number >= 16
228
229
%if 0%{?suse_version} && 0%{?suse_version} < 1500
230
BuildRequires: python36
231
%else
232
BuildRequires: python3
233
%endif
234
235
%else
236
%if %node_version_number >= 12
237
BuildRequires: python3
238
239
%else
240
%if 0%{?suse_version} >= 1500
241
BuildRequires: python2
242
%else
243
BuildRequires: python
244
%endif
245
246
%endif
247
%endif
248
249
%if 0%{?suse_version} >= 1500 && %{node_version_number} >= 10
250
BuildRequires: user(nobody)
251
BuildRequires: group(nobody)
252
%endif
253
254
%if ! 0%{with intree_openssl}
255
256
BuildRequires: pkgconfig(openssl) >= %{openssl_req_ver}
257
258
# require patched openssl library on SLES for nodejs16
259
%if %node_version_number >= 16 && 0%{?suse_version} <= 1500 && 0%{?suse_version} && %{pkg_vcmp openssl-1_1 < '1.1.1e' } && 0%{with openssl_RSA_get0_pss_params}
260
BuildRequires: openssl-has-RSA_get0_pss_params
261
Requires: openssl-has-RSA_get0_pss_params
262
%endif
263
264
%if 0%{?suse_version}
265
%if 0%{?suse_version} >= 1500
266
BuildRequires: openssl >= %{openssl_req_ver}
267
%else
268
BuildRequires: openssl-1_1 >= %{openssl_req_ver}
269
%endif
270
271
BuildRequires: libopenssl1_1-hmac
272
# /suse_version
273
%endif
274
275
%if 0%{?fedora_version}
276
BuildRequires: openssl >= %{openssl_req_ver}
277
%endif
278
279
%else
280
%if %node_version_number <= 12 && 0%{?suse_version} == 1315 && 0%{?sle_version} < 120400
281
Provides: bundled(openssl) = 1.1.1m
282
%else
283
BuildRequires: bundled_openssl_should_not_be_required
284
%endif
285
%endif
286
287
%if ! 0%{with intree_cares}
288
BuildRequires: pkgconfig(libcares) >= 1.17.0
289
%else
290
Provides: bundled(libcares2) = 1.18.1
291
%endif
292
293
%if ! 0%{with intree_icu}
294
BuildRequires: pkgconfig(icu-i18n) >= 69
295
%else
296
Provides: bundled(icu) = 70.1
297
%endif
298
299
%if ! 0%{with intree_nghttp2}
300
BuildRequires: libnghttp2-devel >= 1.41.0
301
%else
302
Provides: bundled(nghttp2) = 1.45.1
303
%endif
304
305
%if 0%{with valgrind_tests}
306
BuildRequires: valgrind
307
%endif
308
309
%if %{with libalternatives}
310
Requires: alts
311
%else
312
Requires(postun): %{_sbindir}/update-alternatives
313
%endif
314
# either for update-alternatives, or their removal
315
Requires(post): %{_sbindir}/update-alternatives
316
317
Recommends: npm16
318
319
#we need ABI virtual provides where SONAMEs aren't enough/not present so deps
320
#break when binary compatibility is broken
321
%global nodejs_abi 16.0
322
Provides: nodejs(abi) = %{nodejs_abi}
323
324
#this corresponds to the "engine" requirement in package.json
325
Provides: nodejs(engine) = %{version}
326
327
# Multiple versions of NodeJS can be installed at a time, but
328
# to properly allow correct version execution from 3rd party
329
# npm software, `env node` requires further help than only
330
# update-alternatives can provide.
331
Provides: nodejs = %{version}
332
%if %{with libalternatives}
333
Requires: nodejs-common >= 5.0
334
%else
335
Requires: nodejs-common
336
%endif
337
338
# For SLE11, to be able to use the certificate store we need to have properly
339
# symlinked certificates. The compatability symlinks are provided by the
340
# openssl1 library in the Security Module
341
%if 0%{?suse_version} == 1110
342
Requires: openssl1
343
%endif
344
345
%if %node_version_number >= 12
346
%ifarch s390
347
ExclusiveArch: not_buildable
348
%endif
349
%endif
350
351
Provides: bundled(uvwasi) = 0.0.12
352
Provides: bundled(libuv) = 1.43.0
353
Provides: bundled(v8) = 9.4.146.24
354
Provides: bundled(brotli) = 1.0.9
355
356
357
Provides: bundled(llhttp) = 6.0.4
358
Provides: bundled(ngtcp2) = 0.1.0-DEV
359
360
Provides: bundled(node-acorn) = 8.6.0
361
Provides: bundled(node-acorn-walk) = 8.2.0
362
Provides: bundled(node-cjs-module-lexer) = 1.2.2
363
Provides: bundled(node-corepack) = 0.10.0
364
365
%description
366
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js
367
uses an event-driven, non-blocking I/O model. Node.js has a package ecosystem
368
provided by npm.
369
370
%package devel
371
Summary: Development headers for NodeJS 16.x
372
Group: Development/Languages/NodeJS
373
Provides: nodejs-devel = %{version}
374
Requires: npm16 = %{version}
375
Requires: %{name} = %{version}
376
377
%description devel
378
This package provides development headers for Node.js needed for creation
379
of binary modules.
380
381
%package -n npm16
382
Summary: Package manager for Node.js
383
Group: Development/Languages/NodeJS
384
%if %{with libalternatives}
385
Requires: nodejs-common >= 5.0
386
%else
387
Requires: nodejs-common
388
%endif
389
Requires: nodejs16 = %{version}
390
Provides: nodejs-npm = %{version}
391
Obsoletes: nodejs-npm < 4.0.0
392
Provides: npm(npm) = 8.5.0
393
Provides: npm = %{version}
394
%if 0%{?suse_version} >= 1500
395
%if %{node_version_number} >= 10
396
Requires: user(nobody)
397
Requires: group(nobody)
398
%endif
399
%endif
400
Provides: bundled(node-abbrev) = 1.1.1
401
Provides: bundled(node-agent-base) = 6.0.2
402
Provides: bundled(node-agentkeepalive) = 4.2.0
403
Provides: bundled(node-aggregate-error) = 3.1.0
404
Provides: bundled(node-ansi-regex) = 2.1.1
405
Provides: bundled(node-ansi-regex) = 3.0.0
406
Provides: bundled(node-ansi-regex) = 5.0.0
407
Provides: bundled(node-ansi-regex) = 5.0.1
408
Provides: bundled(node-ansi-styles) = 4.3.0
409
Provides: bundled(node-ansicolors) = 0.3.2
410
Provides: bundled(node-ansistyles) = 0.1.3
411
Provides: bundled(node-aproba) = 2.0.0
412
Provides: bundled(node-archy) = 1.0.0
413
Provides: bundled(node-are-we-there-yet) = 3.0.0
414
Provides: bundled(node-asap) = 2.0.6
415
Provides: bundled(node-balanced-match) = 1.0.2
416
Provides: bundled(node-bin-links) = 3.0.0
417
Provides: bundled(node-binary-extensions) = 2.2.0
418
Provides: bundled(node-brace-expansion) = 1.1.11
419
Provides: bundled(node-builtins) = 1.0.3
420
Provides: bundled(node-cacache) = 15.3.0
421
Provides: bundled(node-chalk) = 4.1.2
422
Provides: bundled(node-chownr) = 2.0.0
423
Provides: bundled(node-cidr-regex) = 3.1.1
424
Provides: bundled(node-clean-stack) = 2.2.0
425
Provides: bundled(node-cli-columns) = 4.0.0
426
Provides: bundled(node-cli-table3) = 0.6.1
427
Provides: bundled(node-clone) = 1.0.4
428
Provides: bundled(node-cmd-shim) = 4.1.0
429
Provides: bundled(node-color-convert) = 2.0.1
430
Provides: bundled(node-color-name) = 1.1.4
431
Provides: bundled(node-color-support) = 1.1.3
432
Provides: bundled(node-colors) = 1.4.0
433
Provides: bundled(node-columnify) = 1.5.4
434
Provides: bundled(node-common-ancestor-path) = 1.0.1
435
Provides: bundled(node-concat-map) = 0.0.1
436
Provides: bundled(node-console-control-strings) = 1.1.0
437
Provides: bundled(node-debug) = 4.3.3
438
Provides: bundled(node-debuglog) = 1.0.1
439
Provides: bundled(node-defaults) = 1.0.3
440
Provides: bundled(node-delegates) = 1.0.0
441
Provides: bundled(node-depd) = 1.1.2
442
Provides: bundled(node-dezalgo) = 1.0.3
443
Provides: bundled(node-diff) = 5.0.0
444
Provides: bundled(node-emoji-regex) = 8.0.0
445
Provides: bundled(node-encoding) = 0.1.13
446
Provides: bundled(node-env-paths) = 2.2.1
447
Provides: bundled(node-err-code) = 2.0.3
448
Provides: bundled(node-fastest-levenshtein) = 1.0.12
449
Provides: bundled(node-fs-minipass) = 2.1.0
450
Provides: bundled(node-fs.realpath) = 1.0.0
451
Provides: bundled(node-function-bind) = 1.1.1
452
Provides: bundled(node-gauge) = 4.0.0
453
Provides: bundled(node-glob) = 7.2.0
454
Provides: bundled(node-graceful-fs) = 4.2.9
455
Provides: bundled(node-has) = 1.0.3
456
Provides: bundled(node-has-flag) = 4.0.0
457
Provides: bundled(node-has-unicode) = 2.0.1
458
Provides: bundled(node-hosted-git-info) = 4.1.0
459
Provides: bundled(node-http-cache-semantics) = 4.1.0
460
Provides: bundled(node-http-proxy-agent) = 4.0.1
461
Provides: bundled(node-http-proxy-agent) = 5.0.0
462
Provides: bundled(node-https-proxy-agent) = 5.0.0
463
Provides: bundled(node-humanize-ms) = 1.2.1
464
Provides: bundled(node-iconv-lite) = 0.6.3
465
Provides: bundled(node-ignore-walk) = 4.0.1
466
Provides: bundled(node-imurmurhash) = 0.1.4
467
Provides: bundled(node-indent-string) = 4.0.0
468
Provides: bundled(node-infer-owner) = 1.0.4
469
Provides: bundled(node-inflight) = 1.0.6
470
Provides: bundled(node-inherits) = 2.0.4
471
Provides: bundled(node-ini) = 2.0.0
472
Provides: bundled(node-init-package-json) = 2.0.5
473
Provides: bundled(node-ip) = 1.1.5
474
Provides: bundled(node-ip-regex) = 4.3.0
475
Provides: bundled(node-is-cidr) = 4.0.2
476
Provides: bundled(node-is-core-module) = 2.8.1
477
Provides: bundled(node-is-fullwidth-code-point) = 2.0.0
478
Provides: bundled(node-is-fullwidth-code-point) = 3.0.0
479
Provides: bundled(node-is-lambda) = 1.0.1
480
Provides: bundled(node-is-typedarray) = 1.0.0
481
Provides: bundled(node-isexe) = 2.0.0
482
Provides: bundled(node-json-parse-even-better-errors) = 2.3.1
483
Provides: bundled(node-json-stringify-nice) = 1.1.4
484
Provides: bundled(node-jsonparse) = 1.3.1
485
Provides: bundled(node-just-diff) = 5.0.1
486
Provides: bundled(node-just-diff-apply) = 4.0.1
487
Provides: bundled(node-libnpmaccess) = 5.0.1
488
Provides: bundled(node-libnpmdiff) = 3.0.0
489
Provides: bundled(node-libnpmexec) = 3.0.3
490
Provides: bundled(node-libnpmfund) = 2.0.2
491
Provides: bundled(node-libnpmhook) = 7.0.1
492
Provides: bundled(node-libnpmorg) = 3.0.1
493
Provides: bundled(node-libnpmpack) = 3.1.0
494
Provides: bundled(node-libnpmpublish) = 5.0.1
495
Provides: bundled(node-libnpmsearch) = 4.0.1
496
Provides: bundled(node-libnpmteam) = 3.0.1
497
Provides: bundled(node-libnpmversion) = 2.0.2
498
Provides: bundled(node-lru-cache) = 6.0.0
499
Provides: bundled(node-lru-cache) = 7.3.1
500
Provides: bundled(node-make-fetch-happen) = 10.0.2
501
Provides: bundled(node-make-fetch-happen) = 9.1.0
502
Provides: bundled(node-minimatch) = 3.0.4
503
Provides: bundled(node-minipass) = 3.1.6
504
Provides: bundled(node-minipass-collect) = 1.0.2
505
Provides: bundled(node-minipass-fetch) = 1.4.1
506
Provides: bundled(node-minipass-flush) = 1.0.5
507
Provides: bundled(node-minipass-json-stream) = 1.0.1
508
Provides: bundled(node-minipass-pipeline) = 1.2.4
509
Provides: bundled(node-minipass-sized) = 1.0.3
510
Provides: bundled(node-minizlib) = 2.1.2
511
Provides: bundled(node-mkdirp) = 1.0.4
512
Provides: bundled(node-mkdirp-infer-owner) = 2.0.0
513
Provides: bundled(node-ms) = 2.1.2
514
Provides: bundled(node-ms) = 2.1.3
515
Provides: bundled(node-mute-stream) = 0.0.8
516
Provides: bundled(node-negotiator) = 0.6.3
517
Provides: bundled(node-node-gyp) = 8.4.1
518
Provides: bundled(node-nopt) = 5.0.0
519
Provides: bundled(node-normalize-package-data) = 3.0.3
520
Provides: bundled(node-npm-audit-report) = 2.1.5
521
Provides: bundled(node-npm-bundled) = 1.1.2
522
Provides: bundled(node-npm-install-checks) = 4.0.0
523
Provides: bundled(node-npm-normalize-package-bin) = 1.0.1
524
Provides: bundled(node-npm-package-arg) = 8.1.5
525
Provides: bundled(node-npm-packlist) = 3.0.0
526
Provides: bundled(node-npm-pick-manifest) = 6.1.1
527
Provides: bundled(node-npm-profile) = 6.0.0
528
Provides: bundled(node-npm-registry-fetch) = 12.0.2
529
Provides: bundled(node-npm-user-validate) = 1.0.1
530
Provides: bundled(node-npmlog) = 6.0.1
531
Provides: bundled(node-once) = 1.4.0
532
Provides: bundled(node-opener) = 1.5.2
533
Provides: bundled(node-p-map) = 4.0.0
534
Provides: bundled(node-pacote) = 12.0.3
535
Provides: bundled(node-parse-conflict-json) = 2.0.1
536
Provides: bundled(node-path-is-absolute) = 1.0.1
537
Provides: bundled(node-proc-log) = 1.0.0
538
Provides: bundled(node-promise-all-reject-late) = 1.0.1
539
Provides: bundled(node-promise-call-limit) = 1.0.1
540
Provides: bundled(node-promise-inflight) = 1.0.1
541
Provides: bundled(node-promise-retry) = 2.0.1
542
Provides: bundled(node-promzard) = 0.3.0
543
Provides: bundled(node-qrcode-terminal) = 0.12.0
544
Provides: bundled(node-read) = 1.0.7
545
Provides: bundled(node-read-cmd-shim) = 2.0.0
546
Provides: bundled(node-read-package-json) = 4.1.1
547
Provides: bundled(node-read-package-json-fast) = 2.0.3
548
Provides: bundled(node-readable-stream) = 3.6.0
549
Provides: bundled(node-readdir-scoped-modules) = 1.1.0
550
Provides: bundled(node-retry) = 0.12.0
551
Provides: bundled(node-rimraf) = 3.0.2
552
Provides: bundled(node-safe-buffer) = 5.2.1
553
Provides: bundled(node-safer-buffer) = 2.1.2
554
Provides: bundled(node-semver) = 7.3.5
555
Provides: bundled(node-set-blocking) = 2.0.0
556
Provides: bundled(node-signal-exit) = 3.0.6
557
Provides: bundled(node-smart-buffer) = 4.2.0
558
Provides: bundled(node-socks) = 2.6.1
559
Provides: bundled(node-socks-proxy-agent) = 6.1.1
560
Provides: bundled(node-spdx-correct) = 3.1.1
561
Provides: bundled(node-spdx-exceptions) = 2.3.0
562
Provides: bundled(node-spdx-expression-parse) = 3.0.1
563
Provides: bundled(node-spdx-license-ids) = 3.0.11
564
Provides: bundled(node-ssri) = 8.0.1
565
Provides: bundled(node-string_decoder) = 1.3.0
566
Provides: bundled(node-string-width) = 2.1.1
567
Provides: bundled(node-string-width) = 4.2.2
568
Provides: bundled(node-string-width) = 4.2.3
569
Provides: bundled(node-stringify-package) = 1.0.1
570
Provides: bundled(node-strip-ansi) = 3.0.1
571
Provides: bundled(node-strip-ansi) = 4.0.0
572
Provides: bundled(node-strip-ansi) = 6.0.0
573
Provides: bundled(node-strip-ansi) = 6.0.1
574
Provides: bundled(node-supports-color) = 7.2.0
575
Provides: bundled(node-tar) = 6.1.11
576
Provides: bundled(node-text-table) = 0.2.0
577
Provides: bundled(node-tiny-relative-date) = 1.3.0
578
Provides: bundled(node-treeverse) = 1.0.4
579
Provides: bundled(node-typedarray-to-buffer) = 4.0.0
580
Provides: bundled(node-unique-filename) = 1.1.1
581
Provides: bundled(node-unique-slug) = 2.0.2
582
Provides: bundled(node-util-deprecate) = 1.0.2
583
Provides: bundled(node-validate-npm-package-license) = 3.0.4
584
Provides: bundled(node-validate-npm-package-name) = 3.0.0
585
Provides: bundled(node-walk-up-path) = 1.0.0
586
Provides: bundled(node-wcwidth) = 1.0.1
587
Provides: bundled(node-which) = 2.0.2
588
Provides: bundled(node-wide-align) = 1.1.5
589
Provides: bundled(node-wrappy) = 1.0.2
590
Provides: bundled(node-write-file-atomic) = 4.0.0
591
Provides: bundled(node-yallist) = 4.0.0
592
593
%description -n npm16
594
A package manager for Node.js that allows developers to install and
595
publish packages to a package registry.
596
597
%package -n corepack16
598
Summary: Helper bridge between NodeJS projects and their dependencies
599
Group: Development/Languages/NodeJS
600
Requires: nodejs-common >= 5.0
601
602
%description -n corepack16
603
Zero-runtime-dependency package acting as bridge between Node projects
604
and their package managers.
605
606
%package docs
607
Summary: Node.js API documentation
608
Group: Documentation/Other
609
%if 0%{?suse_version} >= 1200
610
# using noarch subpackage seems to break debuginfo on older releases
611
BuildArch: noarch
612
%endif
613
614
%description docs
615
The API documentation for the Node.js JavaScript runtime.
616
617
%prep
618
%if ! %{git_node}
619
echo "`grep node-v%{version}.tar.xz %{S:1} | head -n1 | cut -c1-64` %{S:0}" | sha256sum -c
620
%setup -q -n node-v%{version}
621
%else
622
%setup -q -n node-%{version}
623
%endif
624
625
%if %{node_version_number} <= 10
626
rm -r deps/npm/*
627
tar zxf %{SOURCE9} -C deps/npm --strip-components=1
628
tar Jxf %{SOURCE90} -C deps/npm
629
%endif
630
631
%if %{node_version_number} >= 10
632
tar Jxf %{SOURCE11}
633
%endif
634
635
%patch1 -p1
636
%patch3 -p1
637
%patch5 -p1
638
%patch7 -p1
639
%if 0%{with valgrind_tests}
640
%endif
641
%patch13 -p1
642
%patch100 -p1
643
%patch101 -p1
644
%patch102 -p1
645
# Add check_output to configure script (not part of Python 2.6 in SLE11).
646
%if 0%{?suse_version} == 1110
647
%endif
648
%patch104 -p1
649
%patch106 -p1
650
%patch110 -p1
651
%patch120 -p1
652
%patch132 -p1
653
%if ! 0%{with openssl_RSA_get0_pss_params}
654
%patch133 -p1
655
%endif
656
%patch200 -p1
657
658
# remove backup files, if any
659
find -name \*~ -print0 -delete
660
661
# abnormalities from patching
662
find \( -name \*.js.orig -or -name \*.md.orig -or -name \*.1.orig \) -delete
663
664
# downgrade node-gyp to last version that supports python 3.4 for SLE12
665
%if 0%{?use_version} && 0%{?suse_version} < 1500
666
rm -r deps/npm/node_modules/node-gyp
667
mkdir deps/npm/node_modules/node-gyp
668
tar -C deps/npm/node_modules/node-gyp Jxf %{SOURCE5}
669
%endif
670
671
672
%build
673
# normalize shebang
674
%if %{node_version_number} >= 12
675
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,' {} +
676
%else
677
find -type f -exec sed -i '1 s,^#!\s\?/usr/bin/env python$,#!/usr/bin/python,' {} +
678
%endif
679
find deps/npm -type f -exec sed -i '1 s,^#!\s\?/usr/bin/env node$,#!/usr/bin/node%{node_version_number},' {} +
680
find deps/npm -type f -exec sed -i '1 s,^#!\s\?/usr/bin/env \(bash\|sh\)\?$,#!/bin/bash,' {} +
681
682
. %{SOURCE20}
683
# Make sure nothing gets included from bundled deps:
684
# We only delete the source and header files, because
685
# the remaining build scripts are still used.
686
%if ! 0%{with intree_openssl}
687
find deps/openssl -name *.[ch] -delete
688
%endif
689
690
%if ! 0%{with intree_icu}
691
rm -rf deps/icu-small
692
%endif
693
694
%if ! 0%{with intree_cares}
695
find deps/cares -name *.[ch] -delete
696
%endif
697
698
find deps/zlib -name *.[ch] -delete
699
700
cat > spec.build.config <<EOF
701
export PREFIX=/usr
702
export CFLAGS="%{?build_cflags:%build_cflags}%{?!build_cflags:%optflags} -fno-strict-aliasing"
703
# -Wno-class-memaccess is not available in gcc < 8 (= system compiler on Leap until at least 15.3 is gcc7)
704
export CXXFLAGS="%{?build_cxxflags:%build_cxxflags}%{?!build_cxxflags:%optflags} -Wno-error=return-type -fno-strict-aliasing"
705
%if 0%{?forced_gcc_version} >= 8 || 0%{?suse_version} > 1500 || 0%{?fedora_version} >= 35
706
export CXXFLAGS="\${CXXFLAGS} -Wno-class-memaccess"
707
%endif
708
export LDFLAGS="%{?build_ldflags}"
709
710
%if !0%{?with nodejs_lto}
711
export LDFLAGS="\${LDFLAGS} -fno-lto"
712
%endif
713
714
# reduce disk space pressure
715
export CFLAGS="\${CFLAGS} -g1"
716
export CXXFLAGS="\${CXXFLAGS} -g1"
717
export LDFLAGS="\${LDFLAGS} -Wl,--reduce-memory-overhead"
718
719
%if 0%{?forced_gcc_version:1}
720
export CC=gcc-%{forced_gcc_version}
721
export CXX=g++-%{forced_gcc_version}
722
%endif
723
724
EOF
725
726
. ./spec.build.config
727
728
# Node.js 4.x does not include the ICU database in the source tarball.
729
%define has_small_icu %(test -d "deps/icu-small" && echo 1 || echo 0)
730
731
./configure \
732
--prefix=%{_prefix} \
733
%if 0%{?with nodejs_lto}
734
--enable-lto \
735
%endif
736
%if ! 0%{with intree_openssl}
737
--shared-openssl \
738
%endif
739
--shared-zlib \
740
%if ! 0%{with intree_cares}
741
--shared-cares \
742
%endif
743
%if ! 0%{with intree_icu}
744
--with-intl=system-icu \
745
%else
746
%if %{has_small_icu}
747
--with-intl=small-icu \
748
--with-icu-source=deps/icu-small \
749
%endif
750
%endif
751
%if ! 0%{with intree_nghttp2}
752
--shared-nghttp2 \
753
%endif
754
%if 0%{with gdb}
755
--gdb \
756
%endif
757
--without-dtrace \
758
--openssl-use-def-ca-store
759
760
decoupled_cmd make %{?_smp_mflags}
761
762
# Fix documentation permissions
763
find doc/api -type f -exec chmod 0644 {} +
764
765
%install
766
. %{SOURCE20}
767
. ./spec.build.config
768
769
decoupled_cmd %make_install %{?_smp_mflags}
770
rm %{buildroot}%{_datadir}/doc/node/gdbinit
771
rm -f %{buildroot}%{_datadir}/doc/node/lldbinit
772
rm -f %{buildroot}%{_datadir}/doc/node/lldb_commands.py
773
774
# remove .bak files, if any
775
find %{buildroot} -name \*.bak -print -delete
776
777
# npm/npx man page
778
install -D -m 644 deps/npm/man/man1/npm.1 %{buildroot}%{_mandir}/man1/npm%{node_version_number}.1
779
install -D -m 644 deps/npm/man/man1/npx.1 %{buildroot}%{_mandir}/man1/npx%{node_version_number}.1
780
781
#node-gyp needs common.gypi too
782
install -D -m 644 common.gypi \
783
%{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules/node-gyp/common.gypi
784
# %%{buildroot}%%{_datadir}/node/common.gypi
785
# install addon-rpm.gypi
786
install -D -m 644 addon-rpm.gypi \
787
%{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules/node-gyp/addon-rpm.gypi
788
789
# clean
790
# hidden files and directories
791
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number} -name ".*" -exec rm -Rf -- {} +
792
# windows stuff
793
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number} -name "*.bat" -delete
794
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number} -name "*.cmd" -delete
795
# build stuff
796
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number} -name "Makefile" -delete
797
rm -rf %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/{test,scripts}
798
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules -name "*.sh" -delete
799
rm -rf %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules/node-gyp/src
800
# remove examples/tests/benchmark stuff
801
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules -name "example*" -exec rm -Rf -- {} +
802
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules -name "*_test.*" -delete
803
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules -type d -name "benchmark" -exec rm -Rf -- {} +
804
805
# fix permissions
806
chmod 0755 %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/bin/np*-cli.js
807
! test -f %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/bin/node-gyp-bin/node-gyp || \
808
chmod 0755 %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/bin/node-gyp-bin/node-gyp
809
chmod 0755 %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules/node-gyp/bin/node-gyp.js
810
! test -f %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules/npm-lifecycle/node-gyp-bin/node-gyp || \
811
chmod 0755 %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}/node_modules/npm-lifecycle/node-gyp-bin/node-gyp
812
813
# browser.js is useless for npm cli
814
find %{buildroot}%{_libdir}/node_modules/npm%{node_version_number} -name "browser.js" -delete
815
816
# file duplicates
817
%fdupes %{buildroot}%{_libdir}/node_modules/npm%{node_version_number}
818
%fdupes %{buildroot}%{_includedir}/node%{node_version_number}
819
820
# Update alternatives
821
%if ! %{with libalternatives}
822
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
823
ln -s -f node-default %{buildroot}%{_sysconfdir}/alternatives/node-default
824
ln -s -f node.1%{ext_man} %{buildroot}%{_sysconfdir}/alternatives/node.1%{ext_man}
825
ln -s -f npm-default %{buildroot}%{_sysconfdir}/alternatives/npm-default
826
ln -s -f npm.1%{ext_man} %{buildroot}%{_sysconfdir}/alternatives/npm.1%{ext_man}
827
ln -s %{_sysconfdir}/alternatives/node-default %{buildroot}%{_bindir}/node-default
828
ln -s %{_sysconfdir}/alternatives/node.1%{ext_man} %{buildroot}%{_mandir}/man1/node.1%{ext_man}
829
ln -s %{_sysconfdir}/alternatives/npm-default %{buildroot}%{_bindir}/npm-default
830
ln -s %{_sysconfdir}/alternatives/npm.1%{ext_man} %{buildroot}%{_mandir}/man1/npm.1%{ext_man}
831
ln -s -f npx-default %{buildroot}%{_sysconfdir}/alternatives/npx-default
832
ln -s -f npx.1%{ext_man} %{buildroot}%{_sysconfdir}/alternatives/npx.1%{ext_man}
833
ln -s %{_sysconfdir}/alternatives/npx-default %{buildroot}%{_bindir}/npx-default
834
ln -s %{_sysconfdir}/alternatives/npx.1%{ext_man} %{buildroot}%{_mandir}/man1/npx.1%{ext_man}
835
%endif
836
837
# libalternatives - can always ship
838
mkdir -p %{buildroot}%{_datadir}/libalternatives/{node,npm,npx};
839
cat > %{buildroot}%{_datadir}/libalternatives/node/%{node_version_number}.conf <<EOF
840
binary=%{_bindir}/node%{node_version_number}
841
man=node%{node_version_number}.1
842
EOF
843
cat > %{buildroot}%{_datadir}/libalternatives/npm/%{node_version_number}.conf <<EOF
844
binary=%{_bindir}/npm%{node_version_number}
845
man=npm%{node_version_number}.1
846
group=npm,npx
847
EOF
848
cat > %{buildroot}%{_datadir}/libalternatives/npx/%{node_version_number}.conf <<EOF
849
binary=%{_bindir}/npx%{node_version_number}
850
man=npx%{node_version_number}.1
851
group=npm,npx
852
EOF
853
854
# We need to own license directory on old versions of SLE
855
%if 0%{?suse_version} < 1500
856
mkdir -p %{buildroot}%{_defaultlicensedir}
857
%endif
858
859
%check
860
. ./spec.build.config
861
862
# Relax the crypto policies for the test-suite
863
export OPENSSL_SYSTEM_CIPHERS_OVERRIDE=xyz_nonexistent_file
864
export OPENSSL_CONF=''
865
866
export CI_JS_SUITES=default
867
export NODE_TEST_NO_INTERNET=1
868
869
%if %{node_version_number} >= 12
870
find test \( -name \*.out -or -name \*.js \) -exec sed -i 's,Use `node ,Use `node%{node_version_number} ,' {} \;
871
%endif
872
873
ln addon-rpm.gypi deps/npm/node_modules/node-gyp/addon-rpm.gypi
874
# Tarball doesn't have eslint package distributed, so disable some tests
875
find test -name \*-eslint-\* -print -delete
876
# No documentation is generated, don't bother checking it
877
rm -f test/doctool/test-make-doc.js
878
# DNS lookup doesn't work in build root
879
rm -f test/parallel/test-dns-cancel-reverse-lookup.js \
880
test/parallel/test-dns-resolveany.js
881
# multicast test fail since no socket?
882
rm -f test/parallel/test-dgram-membership.js
883
%if 0%{?fedora_version}
884
# test/parallel/test-crypto-certificate.js requires OPENSSL_ENABLE_MD5_VERIFY=1
885
# as SPKAC required MD5 for verification
886
# https://src.fedoraproject.org/rpms/openssl/blob/rawhide/f/0006-Disable-signature-verification-with-totally-unsafe-h.patch
887
export OPENSSL_ENABLE_MD5_VERIFY=1
888
889
# error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake
890
# failure:ssl/record/rec_layer_s3.c:1543:SSL alert number 40
891
rm -f test/parallel/test-tls-no-sslv3.js
892
%endif
893
# Run CI tests
894
%if 0%{with valgrind_tests}
895
# valgrind may have false positives, so do not fail on these by default
896
make test-valgrind ||:
897
%endif
898
make test-ci
899
900
%files
901
%defattr(-, root, root)
902
%license LICENSE
903
%doc AUTHORS *.md
904
%doc deps/v8/tools/gdbinit
905
%dir %{_libdir}/node_modules
906
%dir %{_datadir}/libalternatives
907
%dir %{_datadir}/libalternatives/node
908
%{_datadir}/libalternatives/node/%{node_version_number}.conf
909
%{_bindir}/node%{node_version_number}
910
%{_mandir}/man1/node%{node_version_number}.1%{ext_man}
911
%if ! 0%{with libalternatives}
912
%ghost %{_bindir}/node-default
913
%ghost %{_mandir}/man1/node.1%{ext_man}
914
%ghost %{_sysconfdir}/alternatives/node-default
915
%ghost %{_sysconfdir}/alternatives/node.1%{ext_man}
916
%endif
917
%exclude %{_libdir}/node_modules/npm%{node_version_number}
918
# We need to own directory on old versions of SLE
919
%if 0%{?suse_version} < 1500
920
%dir %{_defaultlicensedir}
921
%endif
922
923
%files -n npm%{node_version_number}
924
%defattr(-, root, root)
925
%dir %{_datadir}/libalternatives
926
%dir %{_datadir}/libalternatives/npm
927
%dir %{_datadir}/libalternatives/npx
928
%{_datadir}/libalternatives/npm/%{node_version_number}.conf
929
%{_datadir}/libalternatives/npx/%{node_version_number}.conf
930
%{_bindir}/npm%{node_version_number}
931
%{_libdir}/node_modules/npm%{node_version_number}
932
%{_mandir}/man1/npm%{node_version_number}.1%{ext_man}
933
%if ! 0%{with libalternatives}
934
%ghost %{_bindir}/npm-default
935
%ghost %{_mandir}/man1/npm.1%{ext_man}
936
%ghost %{_sysconfdir}/alternatives/npm-default
937
%ghost %{_sysconfdir}/alternatives/npm.1%{ext_man}
938
%endif
939
940
%{_bindir}/npx%{node_version_number}
941
%{_mandir}/man1/npx%{node_version_number}.1%{ext_man}
942
%if ! %{with libalternatives}
943
%ghost %{_bindir}/npx-default
944
%ghost %{_mandir}/man1/npx.1%{ext_man}
945
%ghost %{_sysconfdir}/alternatives/npx-default
946
%ghost %{_sysconfdir}/alternatives/npx.1%{ext_man}
947
%endif
948
949
%if %{node_version_number} >= 14
950
%files -n corepack%{node_version_number}
951
%defattr(-, root, root)
952
%{_bindir}/corepack%{node_version_number}
953
%{_libdir}/node_modules/corepack%{node_version_number}
954
%endif
955
956
%files devel
957
%defattr(-, root, root)
958
%{_includedir}/node%{node_version_number}
959
%dir %{_datadir}/systemtap
960
%dir %{_datadir}/systemtap/tapset
961
%{_datadir}/systemtap/tapset/node%{node_version_number}.stp
962
963
%files docs
964
%defattr(-,root,root)
965
%doc doc/api
966
967
%if %{with libalternatives}
968
969
%post
970
update-alternatives --remove node-default %{_bindir}/node%{node_version_number}
971
972
%post -n npm%{node_version_number}
973
update-alternatives --remove npm-default %{_bindir}/npm%{node_version_number}
974
update-alternatives --remove npx-default %{_bindir}/npx%{node_version_number}
975
976
%else
977
%pre
978
# remove files that are no longer owned but provided by update-alternatives
979
if ! [ -L %{_mandir}/man1/node.1%{ext_man} ]; then
980
rm -f %{_mandir}/man1/node.1%{ext_man}
981
fi
982
983
%post
984
update-alternatives \
985
--install %{_bindir}/node-default node-default %{_bindir}/node%{node_version_number} %{node_version_number} \
986
--slave %{_mandir}/man1/node.1%{ext_man} node.1%{ext_man} %{_mandir}/man1/node%{node_version_number}.1%{ext_man}
987
988
%postun
989
if [ ! -f %{_bindir}/node%{node_version_number} ] ; then
990
update-alternatives --remove node-default %{_bindir}/node%{node_version_number}
991
fi
992
993
%pre -n npm%{node_version_number}
994
# remove files that are no longer owned but provided by update-alternatives
995
if ! [ -L %{_mandir}/man1/npm.1%{ext_man} ]; then
996
rm -f %{_mandir}/man1/npm.1%{ext_man}
997
fi
998
999
%post -n npm%{node_version_number}
1000
update-alternatives \
1001
--install %{_bindir}/npm-default npm-default %{_bindir}/npm%{node_version_number} %{node_version_number} \
1002
--slave %{_mandir}/man1/npm.1%{ext_man} npm.1%{ext_man} %{_mandir}/man1/npm%{node_version_number}.1%{ext_man}
1003
update-alternatives \
1004
--install %{_bindir}/npx-default npx-default %{_bindir}/npx%{node_version_number} %{node_version_number} \
1005
--slave %{_mandir}/man1/npx.1%{ext_man} npx.1%{ext_man} %{_mandir}/man1/npx%{node_version_number}.1%{ext_man}
1006
1007
%postun -n npm%{node_version_number}
1008
if [ ! -f %{_bindir}/npm%{node_version_number} ] ; then
1009
update-alternatives --remove npm-default %{_bindir}/npm%{node_version_number}
1010
fi
1011
if [ ! -f %{_bindir}/npx%{node_version_number} ] ; then
1012
update-alternatives --remove npx-default %{_bindir}/npx%{node_version_number}
1013
fi
1014
1015
%endif
1016
1017
%changelog
1018