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