1 |
# This package is synced with Fedora. |
2 |
|
3 |
# This package is tricky since it requires a working nodejs to build nodejs |
4 |
# This causes problems if a broken nodejs gets into the repo |
5 |
|
6 |
# To build it from bootstrap |
7 |
# build a version with bootstrap. Change nodejs-tarball.sh to not strip out |
8 |
# the bundled libraries |
9 |
# |
10 |
# Once you have a working bootstrapped version, turn off bootstrap and |
11 |
# build with a nodejs-tarball.sh that strips out the bundled directories |
12 |
|
13 |
# bundle dependencies that are not available as Mageia modules |
14 |
# %%{!?_with_bootstrap: %%global bootstrap 1} |
15 |
# use bcond for building modules |
16 |
%bcond_without bootstrap |
17 |
|
18 |
%{?!_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} |
19 |
|
20 |
# increment both of these together |
21 |
%define rel 1 |
22 |
%global v8_release 3 |
23 |
|
24 |
# == Node.js Version == |
25 |
# Note: Mageia should only ship LTS versions of Node.js (currently expected |
26 |
# to be major versions with even numbers). The odd-numbered versions are new |
27 |
# feature releases that are only supported for nine months, which is shorter |
28 |
# than a Mageia release lifecycle. |
29 |
%global nodejs_epoch 1 |
30 |
%global nodejs_major 14 |
31 |
%global nodejs_minor 19 |
32 |
%global nodejs_patch 0 |
33 |
%global nodejs_abi %{nodejs_major}.%{nodejs_minor} |
34 |
%global nodejs_soversion 83 |
35 |
%global nodejs_version %{nodejs_major}.%{nodejs_minor}.%{nodejs_patch} |
36 |
%global nodejs_release %{rel} |
37 |
|
38 |
# == Bundled Dependency Versions == |
39 |
# v8 - from deps/v8/include/v8-version.h |
40 |
# Epoch is set to ensure clean upgrades from the old v8 package |
41 |
%global v8_epoch 2 |
42 |
%global v8_major 8 |
43 |
%global v8_minor 4 |
44 |
%global v8_build 371 |
45 |
%global v8_patch 23 |
46 |
# V8 presently breaks ABI at least every x.y release while never bumping SONAME |
47 |
%global v8_abi %{v8_major}.%{v8_minor} |
48 |
%global v8_version %{v8_major}.%{v8_minor}.%{v8_build}.%{v8_patch} |
49 |
|
50 |
# c-ares - from deps/cares/include/ares_version.h |
51 |
# https://github.com/nodejs/node/pull/9332 |
52 |
%global c_ares_major 1 |
53 |
%global c_ares_minor 18 |
54 |
%global c_ares_patch 1 |
55 |
%global c_ares_version %{c_ares_major}.%{c_ares_minor}.%{c_ares_patch} |
56 |
|
57 |
# llhttp - from deps/llhttp/include/llhttp.h |
58 |
%global llhttp_major 2 |
59 |
%global llhttp_minor 1 |
60 |
%global llhttp_patch 2 |
61 |
%global llhttp_version %{llhttp_major}.%{llhttp_minor}.%{llhttp_patch} |
62 |
|
63 |
# libuv - from deps/uv/include/uv/version.h |
64 |
%global libuv_major 1 |
65 |
%global libuv_minor 39 |
66 |
%global libuv_patch 0 |
67 |
%global libuv_version %{libuv_major}.%{libuv_minor}.%{libuv_patch} |
68 |
|
69 |
# nghttp2 - from deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h |
70 |
%global nghttp2_major 1 |
71 |
%global nghttp2_minor 41 |
72 |
%global nghttp2_patch 0 |
73 |
%global nghttp2_version %{nghttp2_major}.%{nghttp2_minor}.%{nghttp2_patch} |
74 |
|
75 |
# ICU - from tools/icu/current_ver.dep |
76 |
%global icu_major 67 |
77 |
%global icu_minor 1 |
78 |
%global icu_version %{icu_major}.%{icu_minor} |
79 |
|
80 |
# uvwasi - from deps/uvwasi/include/uvwasi.h |
81 |
%global uvwasi_major 0 |
82 |
%global uvwasi_minor 0 |
83 |
%global uvwasi_patch 11 |
84 |
%global uvwasi_version %{uvwasi_major}.%{uvwasi_minor}.%{uvwasi_patch} |
85 |
|
86 |
# histogram_c - assumed from timestamps |
87 |
%global histogram_major 0 |
88 |
%global histogram_minor 9 |
89 |
%global histogram_patch 7 |
90 |
%global histogram_version %{histogram_major}.%{histogram_minor}.%{histogram_patch} |
91 |
|
92 |
|
93 |
#%if 0%{?mageia} >= 7 |
94 |
#%global icu_flag system-icu |
95 |
#%else |
96 |
%global icu_flag small-icu |
97 |
#%endif |
98 |
|
99 |
|
100 |
# punycode - from lib/punycode.js |
101 |
# Note: this was merged into the mainline since 0.6.x |
102 |
# Note: this will be unmerged in an upcoming major release |
103 |
%global punycode_major 2 |
104 |
%global punycode_minor 1 |
105 |
%global punycode_patch 0 |
106 |
%global punycode_version %{punycode_major}.%{punycode_minor}.%{punycode_patch} |
107 |
|
108 |
# npm - from deps/npm/package.json |
109 |
%global npm_epoch 1 |
110 |
%global npm_major 6 |
111 |
%global npm_minor 14 |
112 |
%global npm_patch 16 |
113 |
%global npm_version %{npm_major}.%{npm_minor}.%{npm_patch} |
114 |
|
115 |
# In order to avoid needing to keep incrementing the release version for the |
116 |
# main package forever, we will just construct one for npm that is guaranteed |
117 |
# to increment safely. Changing this can only be done during an update when the |
118 |
# base npm version number is increasing. |
119 |
%global npm_release %{nodejs_epoch}.%{nodejs_major}.%{nodejs_minor}.%{nodejs_patch}.%{nodejs_release} |
120 |
|
121 |
|
122 |
Name: nodejs |
123 |
Epoch: %{nodejs_epoch} |
124 |
Version: %{nodejs_version} |
125 |
%define subrel 1 |
126 |
Release: %mkrel %{nodejs_release} |
127 |
Summary: JavaScript runtime |
128 |
License: MIT and ASL 2.0 and ISC and BSD |
129 |
Group: Development/Other |
130 |
URL: https://nodejs.org/ |
131 |
|
132 |
# ExclusiveArch: %{nodejs_arches} |
133 |
|
134 |
# nodejs bundles openssl, but we use the system version in Mageia |
135 |
# because openssl contains prohibited code, we remove openssl completely from |
136 |
# the tarball, using the script in Source100 |
137 |
|
138 |
Source0: node-v%{nodejs_version}-stripped.tar.xz |
139 |
Source100: %{name}-tarball.sh |
140 |
|
141 |
# The native module Requires generator remains in the nodejs SRPM, so it knows |
142 |
# the nodejs and v8 versions. The remainder has migrated to the |
143 |
# nodejs-packaging SRPM. |
144 |
Source7: nodejs_native.attr |
145 |
|
146 |
# Disable running gyp on bundled deps we don't use |
147 |
Patch1: 0001-Disable-running-gyp-on-shared-deps.patch |
148 |
Patch3: 0002-Install-both-binaries-and-use-libdir.patch |
149 |
|
150 |
# |
151 |
# Security patches |
152 |
# Patches P100 -> ... |
153 |
# |
154 |
|
155 |
BuildRequires: python3-devel |
156 |
BuildRequires: zlib-devel |
157 |
BuildRequires: brotli-devel |
158 |
BuildRequires: gcc >= 4.9.4 |
159 |
BuildRequires: gcc-c++ >= 4.9.4 |
160 |
BuildRequires: chrpath |
161 |
BuildRequires: libatomic-devel |
162 |
|
163 |
#%if ! 0%%{?bootstrap} |
164 |
%if %{with bootstrap} |
165 |
Provides: bundled(libuv) = %{libuv_version} |
166 |
Provides: bundled(nghttp2) = %{nghttp2_version} |
167 |
%else |
168 |
BuildRequires: nodejs-packaging |
169 |
BuildRequires: systemtap |
170 |
BuildRequires: http-parser-devel >= 2.9.2 |
171 |
BuildRequires: libuv-devel >= %{libuv_version} |
172 |
BuildRequires: pkgconfig(libnghttp2) >= %{nghttp2_version} |
173 |
%endif |
174 |
|
175 |
BuildRequires: libicu-devel >= 63.1 |
176 |
BuildRequires: openssl-devel >= 1.1.1c |
177 |
|
178 |
# we need the system certificate store |
179 |
Requires: ca-certificates |
180 |
|
181 |
Requires: nodejs-libs = %mkrel %{epoch}:%{nodejs_version}-%{nodejs_release} |
182 |
|
183 |
|
184 |
#we need ABI virtual provides where SONAMEs aren't enough/not present so deps |
185 |
#break when binary compatibility is broken |
186 |
Provides: nodejs(abi) = %{nodejs_abi} |
187 |
Provides: nodejs(abi%{nodejs_major}) = %{nodejs_abi} |
188 |
Provides: nodejs(v8-abi) = %{v8_abi} |
189 |
Provides: nodejs(v8-abi%{v8_major}) = %{v8_abi} |
190 |
|
191 |
#this corresponds to the "engine" requirement in package.json |
192 |
Provides: nodejs(engine) = %{nodejs_version} |
193 |
|
194 |
# Node.js currently has a conflict with the 'node' package in Mageia |
195 |
# The ham-radio group has agreed to rename their binary for us, but |
196 |
# in the meantime, we're setting an explicit Conflicts: here |
197 |
Conflicts: node <= 0.3.2-12 |
198 |
|
199 |
# The punycode module was absorbed into the standard library in v0.6. |
200 |
# It still exists as a seperate package for the benefit of users of older |
201 |
# versions. Since we've never shipped anything older than v0.10 in Mageia, |
202 |
# we don't need the seperate nodejs-punycode package, so we Provide it here so |
203 |
# dependent packages don't need to override the dependency generator. |
204 |
# See also: RHBZ#11511811 |
205 |
# UPDATE: punycode will be deprecated and so we should unbundle it in Node v8 |
206 |
# and use upstream module instead |
207 |
# https://github.com/nodejs/node/commit/29e49fc286080215031a81effbd59eac092fff2f |
208 |
Provides: nodejs-punycode = %{punycode_version} |
209 |
Provides: npm(punycode) = %{punycode_version} |
210 |
|
211 |
|
212 |
# Node.js has forked c-ares from upstream in an incompatible way, so we need |
213 |
# to carry the bundled version internally. |
214 |
# See https://github.com/nodejs/node/commit/766d063e0578c0f7758c3a965c971763f43fec85 |
215 |
Provides: bundled(c-ares) = %{c_ares_version} |
216 |
|
217 |
# Node.js is closely tied to the version of v8 that is used with it. It makes |
218 |
# sense to use the bundled version because upstream consistently breaks ABI |
219 |
# even in point releases. Node.js upstream has now removed the ability to build |
220 |
# against a shared system version entirely. |
221 |
# See https://github.com/nodejs/node/commit/d726a177ed59c37cf5306983ed00ecd858cfbbef |
222 |
Provides: bundled(v8) = %{v8_version} |
223 |
|
224 |
# Node.js is bound to a specific version of ICU which may not match the OS |
225 |
# We cannot pin the OS to this version of ICU because every update includes |
226 |
# an ABI-break, so we'll use the bundled copy. |
227 |
Provides: bundled(icu) = %{icu_version} |
228 |
|
229 |
# Upstream added new dependencies, but so far they are not available in Fedora |
230 |
# or there's no option to built it as a shared dependency, so we bundle them |
231 |
Provides: bundled(uvwasi) = %{uvwasi_version} |
232 |
Provides: bundled(histogram) = %{histogram_version} |
233 |
|
234 |
# Make sure we keep NPM up to date when we update Node.js |
235 |
Requires: npm = %mkrel %{npm_epoch}:%{npm_version}-%{npm_release} |
236 |
|
237 |
%description |
238 |
Node.js is a platform built on Chrome's JavaScript runtime |
239 |
for easily building fast, scalable network applications. |
240 |
Node.js uses an event-driven, non-blocking I/O model that |
241 |
makes it lightweight and efficient, perfect for data-intensive |
242 |
real-time applications that run across distributed devices. |
243 |
|
244 |
%package devel |
245 |
Summary: JavaScript runtime - development headers |
246 |
Group: Development/Other |
247 |
Requires: %{name} = %mkrel %{epoch}:%{nodejs_version}-%{nodejs_release} |
248 |
Requires: openssl-devel |
249 |
Requires: zlib-devel |
250 |
Requires: nodejs-packaging |
251 |
|
252 |
#%if ! 0%%{?bootstrap} |
253 |
%if %{with bootstrap} |
254 |
# deps are bundled |
255 |
%else |
256 |
Requires: http-parser-devel |
257 |
Requires: libuv-devel |
258 |
%endif |
259 |
|
260 |
%description devel |
261 |
Development headers for the Node.js JavaScript runtime. |
262 |
|
263 |
%package libs |
264 |
Summary: Node.js and v8 libraries |
265 |
|
266 |
# Compatibility for obsolete v8 package |
267 |
%if 0%{?__isa_bits} == 64 |
268 |
Provides: libv8.so.%{v8_major}()(64bit) |
269 |
Provides: libv8_libbase.so.%{v8_major}()(64bit) |
270 |
Provides: libv8_libplatform.so.%{v8_major}()(64bit) |
271 |
%else # 32-bits |
272 |
Provides: libv8.so.%{v8_major} |
273 |
Provides: libv8_libbase.so.%{v8_major} |
274 |
Provides: libv8_libplatform.so.%{v8_major} |
275 |
%endif |
276 |
|
277 |
Provides: v8 = %mkrel %{v8_epoch}:%{v8_version}-%{nodejs_release} |
278 |
Provides: v8 = %mkrel %{v8_epoch}:%{v8_version}-%{nodejs_release} |
279 |
Obsoletes: v8 < 1:6.7.17-10 |
280 |
|
281 |
%description libs |
282 |
Libraries to support Node.js and provide stable v8 interfaces. |
283 |
|
284 |
|
285 |
%package -n corepack |
286 |
Summary: Node.js Package Manager |
287 |
Requires: nodejs = %mkrel %{epoch}:%{nodejs_version}-%{nodejs_release} |
288 |
|
289 |
%description -n corepack |
290 |
Corepack is an experimental tool to help with managing versions of |
291 |
your package managers. |
292 |
It exposes binary proxies for each supported package manager that, |
293 |
when called, will identify whatever package manager is configured |
294 |
for the current project, transparently install it if needed, and |
295 |
finally run it without requiring explicit user interactions. |
296 |
|
297 |
%package -n v8-devel |
298 |
Summary: v8 - development headers |
299 |
Epoch: %{v8_epoch} |
300 |
Version: %mkrel %{v8_version} |
301 |
Release: %mkrel %{v8_release} |
302 |
Requires: %{name}-devel = %mkrel %{nodejs_epoch}:%{nodejs_version}-%{nodejs_release} |
303 |
|
304 |
%description -n v8-devel |
305 |
Development headers for the v8 runtime. |
306 |
|
307 |
%package -n npm |
308 |
Summary: Node.js Package Manager |
309 |
Epoch: %{npm_epoch} |
310 |
Version: %{npm_version} |
311 |
Release: %mkrel %{npm_release} |
312 |
|
313 |
# We used to ship npm separately, but it is so tightly integrated with Node.js |
314 |
# (and expected to be present on all Node.js systems) that we ship it bundled |
315 |
# now. |
316 |
Obsoletes: npm < 0:3.5.4-6 |
317 |
Provides: npm = %{npm_epoch}:%{npm_version} |
318 |
Requires: nodejs = %mkrel %{epoch}:%{nodejs_version}-%{nodejs_release} |
319 |
|
320 |
# Do not add epoch to the virtual NPM provides or it will break |
321 |
# the automatic dependency-generation script. |
322 |
Provides: npm(npm) = %{npm_version} |
323 |
|
324 |
%description -n npm |
325 |
npm is a package manager for node.js. You can use it to install and publish |
326 |
your node programs. It manages dependencies and does other cool stuff. |
327 |
|
328 |
%package docs |
329 |
Summary: Node.js API documentation |
330 |
Group: Documentation |
331 |
BuildArch: noarch |
332 |
|
333 |
# We don't require that the main package be installed to |
334 |
# use the docs, but if it is installed, make sure the |
335 |
# version always matches |
336 |
Conflicts: %{name} > %mkrel %{epoch}:%{nodejs_version}-%{nodejs_release} |
337 |
Conflicts: %{name} < %mkrel %{epoch}:%{nodejs_version}-%{nodejs_release} |
338 |
|
339 |
%description docs |
340 |
The API documentation for the Node.js JavaScript runtime. |
341 |
|
342 |
|
343 |
%prep |
344 |
%autosetup -p1 -n node-v%{nodejs_version} |
345 |
|
346 |
# remove bundled dependencies that we aren't building |
347 |
rm -rf deps/zlib |
348 |
rm -rf deps/brotli |
349 |
|
350 |
%build |
351 |
|
352 |
%ifarch s390 s390x %{arm} %ix86 |
353 |
# Decrease debuginfo verbosity to reduce memory consumption during final |
354 |
# library linking |
355 |
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /') |
356 |
%endif |
357 |
|
358 |
export CC='%{__cc}' |
359 |
export CXX='%{__cxx}' |
360 |
|
361 |
# build with debugging symbols and add defines from libuv (#892601) |
362 |
# Node's v8 breaks with GCC 6 because of incorrect usage of methods on |
363 |
# NULL objects. We need to pass -fno-delete-null-pointer-checks |
364 |
export CFLAGS='%{optflags} \ |
365 |
-D_LARGEFILE_SOURCE \ |
366 |
-D_FILE_OFFSET_BITS=64 \ |
367 |
-DZLIB_CONST \ |
368 |
-fno-delete-null-pointer-checks' |
369 |
export CXXFLAGS='%{optflags} \ |
370 |
-D_LARGEFILE_SOURCE \ |
371 |
-D_FILE_OFFSET_BITS=64 \ |
372 |
-DZLIB_CONST \ |
373 |
-fno-delete-null-pointer-checks' |
374 |
|
375 |
# Explicit new lines in C(XX)FLAGS can break naive build scripts |
376 |
export CFLAGS="$(echo ${CFLAGS} | tr '\n\\' ' ')" |
377 |
export CXXFLAGS="$(echo ${CXXFLAGS} | tr '\n\\' ' ')" |
378 |
export LDFLAGS="%{build_ldflags}" |
379 |
|
380 |
#%if ! 0%%{?bootstrap} |
381 |
%if %{with bootstrap} |
382 |
%{__python3} configure.py --prefix=%{_prefix} \ |
383 |
--shared \ |
384 |
--libdir=%{_lib} \ |
385 |
--shared-openssl \ |
386 |
--shared-zlib \ |
387 |
--shared-brotli \ |
388 |
--without-dtrace \ |
389 |
--with-intl=small-icu \ |
390 |
--debug-nghttp2 \ |
391 |
--openssl-use-def-ca-store |
392 |
%else |
393 |
%{__python3} configure.py --prefix=%{_prefix} \ |
394 |
--shared \ |
395 |
--libdir=%{_lib} \ |
396 |
--shared-openssl \ |
397 |
--shared-zlib \ |
398 |
--shared-brotli \ |
399 |
--shared-libuv \ |
400 |
--shared-nghttp2 \ |
401 |
--with-dtrace \ |
402 |
--with-intl=%{icu_flag} \ |
403 |
--debug-nghttp2 \ |
404 |
--openssl-use-def-ca-store |
405 |
%endif |
406 |
|
407 |
%__make BUILDTYPE=Release %{?_smp_mflags} |
408 |
|
409 |
|
410 |
%install |
411 |
./tools/install.py install %{buildroot} %{_prefix} |
412 |
|
413 |
# Set the binary permissions properly |
414 |
chmod 0755 %{buildroot}/%{_bindir}/node |
415 |
chrpath --delete %{buildroot}%{_bindir}/node |
416 |
|
417 |
# Install library symlink |
418 |
ln -s %{_libdir}/libnode.so.%{nodejs_soversion} %{buildroot}%{_libdir}/libnode.so |
419 |
|
420 |
# Install v8 compatibility symlinks |
421 |
for header in %{buildroot}%{_includedir}/node/libplatform %{buildroot}%{_includedir}/node/v8*.h; do |
422 |
header=$(basename ${header}) |
423 |
ln -s %{_includedir}/node/${header} %{buildroot}%{_includedir}/${header} |
424 |
done |
425 |
for soname in libv8 libv8_libbase libv8_libplatform; do |
426 |
ln -s %{_libdir}/libnode.so.%{nodejs_soversion} %{buildroot}%{_libdir}/${soname}.so |
427 |
ln -s %{_libdir}/libnode.so.%{nodejs_soversion} %{buildroot}%{_libdir}/${soname}.so.%{v8_major} |
428 |
done |
429 |
|
430 |
# own the sitelib directory |
431 |
mkdir -p %{buildroot}%{_prefix}/lib/node_modules |
432 |
|
433 |
# ensure Requires are added to every native module that match the Provides from |
434 |
# the nodejs build in the buildroot |
435 |
install -Dpm0644 %{SOURCE7} %{buildroot}%{_rpmconfigdir}/fileattrs/nodejs_native.attr |
436 |
cat << EOF > %{buildroot}%{_rpmconfigdir}/nodejs_native.req |
437 |
#!/bin/sh |
438 |
echo 'nodejs(abi%{nodejs_major}) >= %nodejs_abi' |
439 |
echo 'nodejs(v8-abi%{v8_major}) >= %v8_abi' |
440 |
EOF |
441 |
chmod 0755 %{buildroot}%{_rpmconfigdir}/nodejs_native.req |
442 |
|
443 |
#install documentation |
444 |
mkdir -p %{buildroot}%{_pkgdocdir}/html |
445 |
cp -pr doc/* %{buildroot}%{_pkgdocdir}/html |
446 |
rm -f %{buildroot}%{_pkgdocdir}/html/nodejs.1 |
447 |
|
448 |
#node-gyp needs common.gypi too |
449 |
mkdir -p %{buildroot}%{_datadir}/node |
450 |
cp -p common.gypi %{buildroot}%{_datadir}/node |
451 |
|
452 |
# Install the GDB init tool into the documentation directory |
453 |
mv %{buildroot}/%{_datadir}/doc/node/gdbinit %{buildroot}/%{_pkgdocdir}/gdbinit |
454 |
|
455 |
# install NPM docs to mandir |
456 |
mkdir -p %{buildroot}%{_mandir} \ |
457 |
%{buildroot}%{_pkgdocdir}/npm |
458 |
|
459 |
cp -pr deps/npm/man/* %{buildroot}%{_mandir}/ |
460 |
rm -rf %{buildroot}%{_prefix}/lib/node_modules/npm/man |
461 |
ln -sf %{_mandir} %{buildroot}%{_prefix}/lib/node_modules/npm/man |
462 |
|
463 |
|
464 |
# Install Gatsby HTML documentation to %{_pkgdocdir} |
465 |
cp -pr deps/npm/docs %{buildroot}%{_pkgdocdir}/npm/ |
466 |
rm -rf %{buildroot}%{_prefix}/lib/node_modules/npm/docs |
467 |
|
468 |
ln -sf %{_pkgdocdir}/npm %{buildroot}%{_prefix}/lib/node_modules/npm/docs |
469 |
|
470 |
# Node tries to install some python files into a documentation directory |
471 |
# (and not the proper one). Remove them for now until we figure out what to |
472 |
# do with them. |
473 |
rm -f %{buildroot}/%{_defaultdocdir}/node/lldb_commands.py \ |
474 |
%{buildroot}/%{_defaultdocdir}/node/lldbinit |
475 |
|
476 |
# Some NPM bundled deps are executable but should not be. This causes |
477 |
# unnecessary automatic dependencies to be added. Make them not executable. |
478 |
# Skip the npm bin directory or the npm binary will not work. |
479 |
find %{buildroot}%{_prefix}/lib/node_modules/npm \ |
480 |
-not -path "%{buildroot}%{_prefix}/lib/node_modules/npm/bin/*" \ |
481 |
-executable -type f \ |
482 |
-exec chmod -x {} \; |
483 |
|
484 |
# The above command is a little overzealous. Add a few permissions back. |
485 |
chmod 0755 %{buildroot}%{_prefix}/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin/node-gyp |
486 |
chmod 0755 %{buildroot}%{_prefix}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js |
487 |
|
488 |
|
489 |
%check |
490 |
# Fail the build if the versions don't match |
491 |
LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}/%{_bindir}/node -e "require('assert').equal(process.versions.node, '%{nodejs_version}')" |
492 |
LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}/%{_bindir}/node -e "require('assert').equal(process.versions.v8.replace(/-node\.\d+$/, ''), '%{v8_version}')" |
493 |
LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}/%{_bindir}/node -e "require('assert').equal(process.versions.ares.replace(/-DEV$/, ''), '%{c_ares_version}')" |
494 |
|
495 |
# Ensure we have punycode and that the version matches |
496 |
LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}/%{_bindir}/node -e "require(\"assert\").equal(require(\"punycode\").version, '%{punycode_version}')" |
497 |
|
498 |
# Ensure we have npm and that the version matches |
499 |
NODE_PATH=%{buildroot}%{_prefix}/lib/node_modules:%{buildroot}%{_prefix}/lib/node_modules/npm/node_modules LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}/%{_bindir}/node -e "require(\"assert\").equal(require(\"npm\").version, '%{npm_version}')" |
500 |
|
501 |
|
502 |
%pretrans -n npm -p <lua> |
503 |
-- Remove all of the symlinks from the bundled npm node_modules directory |
504 |
-- This scriptlet can be removed in Mageia 31 |
505 |
base_path = "%{_prefix}/lib/node_modules/npm/node_modules/" |
506 |
d_st = posix.stat(base_path) |
507 |
if d_st then |
508 |
for f in posix.files(base_path) do |
509 |
path = base_path..f |
510 |
st = posix.stat(path) |
511 |
if st and st.type == "link" then |
512 |
os.remove(path) |
513 |
end |
514 |
end |
515 |
end |
516 |
|
517 |
%files |
518 |
%{_bindir}/node |
519 |
%dir %{_prefix}/lib/node_modules |
520 |
%dir %{_datadir}/node |
521 |
%dir %{_datadir}/systemtap |
522 |
%dir %{_datadir}/systemtap/tapset |
523 |
%{_datadir}/systemtap/tapset/node.stp |
524 |
|
525 |
#%if ! 0%%{?bootstrap} |
526 |
%if %{with bootstrap} |
527 |
# no dtrace |
528 |
%else |
529 |
%dir %{_usr}/lib/dtrace |
530 |
%{_usr}/lib/dtrace/node.d |
531 |
%endif |
532 |
|
533 |
%{_rpmconfigdir}/fileattrs/nodejs_native.attr |
534 |
%{_rpmconfigdir}/nodejs_native.req |
535 |
%license LICENSE |
536 |
%doc AUTHORS CHANGELOG.md GOVERNANCE.md README.md |
537 |
%doc %{_mandir}/man1/node.1* |
538 |
|
539 |
|
540 |
%files devel |
541 |
%{_includedir}/node |
542 |
%{_libdir}/libnode.so |
543 |
%{_datadir}/node/common.gypi |
544 |
%{_pkgdocdir}/gdbinit |
545 |
|
546 |
|
547 |
%files libs |
548 |
%{_libdir}/libnode.so.%{nodejs_soversion} |
549 |
%{_libdir}/libv8.so.%{v8_major} |
550 |
%{_libdir}/libv8_libbase.so.%{v8_major} |
551 |
%{_libdir}/libv8_libplatform.so.%{v8_major} |
552 |
|
553 |
|
554 |
%files -n v8-devel |
555 |
%{_includedir}/libplatform |
556 |
%{_includedir}/v8*.h |
557 |
%{_libdir}/libv8.so |
558 |
%{_libdir}/libv8_libbase.so |
559 |
%{_libdir}/libv8_libplatform.so |
560 |
|
561 |
%files -n corepack |
562 |
%{_bindir}/corepack |
563 |
%{_prefix}/lib/node_modules/corepack |
564 |
|
565 |
%files -n npm |
566 |
%{_bindir}/npm |
567 |
%{_bindir}/npx |
568 |
%{_prefix}/lib/node_modules/npm |
569 |
%ghost %{_sysconfdir}/npmrc |
570 |
%ghost %{_sysconfdir}/npmignore |
571 |
%doc %{_mandir}/man*/npm* |
572 |
%doc %{_mandir}/man*/npx* |
573 |
%doc %{_mandir}/man7/semver.7* |
574 |
%doc %{_mandir}/man5/*.5.xz |
575 |
%doc %{_mandir}/man7/*.7.xz |
576 |
|
577 |
%files docs |
578 |
%dir %{_pkgdocdir} |
579 |
%{_pkgdocdir}/html |
580 |
%{_pkgdocdir}/npm/docs |