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