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