]> git.pld-linux.org Git - packages/nodejs.git/blame_incremental - nodejs.spec
up to 16.20.2 (fixes CVE-2023-32002 CVE-2023-32006 CVE-2023-32559)
[packages/nodejs.git] / nodejs.spec
... / ...
CommitLineData
1# BUILD NOTE:
2# until we get binutils with https://sourceware.org/bugzilla/show_bug.cgi?id=28138 fixed
3# build requires >1024 available file descriptors (4096 seems sufficient)
4#
5# TODO
6# - unpackaged files
7# /usr/share/doc/node/gdbinit
8
9# Conditional build:
10%bcond_without system_brotli # system brotli
11%bcond_without system_uv # system uv
12%bcond_with http_parser # system http-parser and llhttp
13
14%define _enable_debug_packages 0
15
16# NOTES:
17# - https://nodejs.org/en/download/releases/
18
19# NODE_MODULE_VERSION refers to the ABI (application binary interface) version
20# number of Node.js, used to determine which versions of Node.js compiled C++
21# add-on binaries can be loaded in to without needing to be re-compiled. It
22# used to be stored as hex value in earlier versions, but is now represented as
23# an integer.
24%define node_module_version 93
25Summary: Asynchronous JavaScript Engine
26Summary(pl.UTF-8): Asynchroniczny silnik JavaScriptu
27Name: nodejs
28# 16.x LTS - https://github.com/nodejs/Release
29# Active start: 2021-10-26
30# Maintenance start: October 2022
31# Maintenance end: September 2023
32Version: 16.20.2
33Release: 1
34License: BSD and MIT and Apache v2.0 and GPL v3
35Group: Development/Languages
36Source0: https://nodejs.org/download/release/latest-v16.x/node-v%{version}.tar.xz
37# Source0-md5: c3bdaf2ababf0c753d42c0acef1a154a
38Patch0: system_cares.patch
39# force node to use /usr/lib/node as the systemwide module directory
40Patch2: %{name}-libpath.patch
41# use /usr/lib64/node as an arch-specific module dir when appropriate
42Patch3: %{name}-lib64path.patch
43Patch4: 0001-Disable-running-gyp-on-shared-deps.patch
44URL: https://nodejs.org/
45BuildRequires: c-ares-devel >= 1.17.2
46BuildRequires: gcc >= 6:6.3
47%if %{with http_parser}
48BuildRequires: http-parser-devel >= 2.9.3
49BuildRequires: llhttp-devel >= 2.1.3
50%endif
51%ifarch mips mipsel mips64 mips64el ppc %{arm}
52BuildRequires: libatomic-devel
53%endif
54%{?with_system_brotli:BuildRequires: libbrotli-devel >= 1.0.9}
55BuildRequires: libicu-devel >= 69.1
56BuildRequires: libstdc++-devel >= 6:4.8
57%{?with_system_uv:BuildRequires: libuv-devel >= 1.42.0}
58BuildRequires: nghttp2-devel >= 1.42.0
59BuildRequires: openssl-devel >= 1.0.1
60BuildRequires: pkgconfig
61BuildRequires: python3 >= 1:3.6
62BuildRequires: python3-modules >= 1:3.6
63BuildRequires: rpm >= 4.4.9-56
64BuildRequires: rpm-build >= 4.6
65BuildRequires: rpmbuild(macros) >= 1.752
66BuildRequires: tar >= 1:1.22
67BuildRequires: sed >= 4.0
68BuildRequires: xz
69BuildRequires: zlib-devel >= 1.2.11
70Requires: c-ares >= 1.17.1
71Requires: ca-certificates
72%{?with_http_parser:Requires: http-parser >= 2.9.3}
73%{?with_system_brotli:Requires: libbrotli >= 1.0.9}
74%{?with_system_uv:Requires: libuv >= 1.42.0}
75Requires: nghttp2-libs >= 1.42.0
76Requires: zlib >= 1.2.11
77Provides: nodejs(engine) = %{version}
78Provides: nodejs(module-version) = %{node_module_version}
79Obsoletes: nodejs-waf < 0.9
80ExclusiveArch: %{ix86} %{x8664} %{arm} aarch64
81BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
82
83%define sover %(echo %{version} | cut -d. -f2)
84# add macro, so adapter won't replace it back literal
85%define doc_ver %{version}
86
87%description
88Node.js is a platform built on Chrome's JavaScript runtime for easily
89building fast, scalable network applications. Node.js uses an
90event-driven, non-blocking I/O model that makes it lightweight and
91efficient, perfect for data-intensive real-time applications that run
92across distributed devices.
93
94%description -l pl.UTF-8
95Node.js to platforma zbudowana w opacriu o silnik JavaScriptu
96przeglądarki Chrome, służąca do tworzenia szybkich, skalowalnych
97aplikacji sieciowych. Node.js wykorzystuje nieblokujący model
98wejścia/wyjścia sterowany zdarzeniami, dzięki czemu jest lekki i
99wydajny, dobrze nadający się do aplikacji przetwarzających duże
100ilości danych w czasie rzeczywistym, uruchamianych na rozproszonych
101urządzeniach.
102
103%package devel
104Summary: Development headers for nodejs
105Summary(pl.UTF-8): Pliki nagłówkowe nodejs
106Group: Development/Libraries
107Requires: %{name} = %{version}-%{release}
108Requires: gcc
109%{?with_http_parser:Requires: http-parser-devel >= 2.9.3}
110Requires: libstdc++-devel
111%{?with_system_uv:Requires: libuv-devel >= 1.42.0}
112Requires: openssl-devel
113Requires: zlib-devel >= 1.2.11
114
115%description devel
116Development headers for nodejs.
117
118%description devel -l pl.UTF-8
119Pliki nagłówkowe nodejs.
120
121%package doc
122Summary: Documentation for Node.js engine
123Summary(pl.UTF-8): Dokumentacja silnika Node.js
124Group: Documentation
125URL: https://nodejs.org/dist/v%{doc_ver}/docs/api
126BuildArch: noarch
127
128%description doc
129Node.js is a server-side JavaScript environment that uses an
130asynchronous event-driven model. Node's goal is to provide an easy way
131to build scalable network programs.
132
133This package contains the documentation for Node.js.
134
135%description doc -l pl.UTF-8
136Node.js to serwerowe środowisko JavaScriptu wykorzystujące
137asynchroniczny model sterowany zdarzeniami. Celem Node jest
138zapewnienie łatwego sposobu tworzenia skalowalnych programów
139sieciowych.
140
141Ten pakiet zawiera dokumentację Node.js.
142
143%package -n systemtap-nodejs
144Summary: systemtap/dtrace probes for Node.js
145Summary(pl.UTF-8): Sondy systemtap/dtrace dla Node.js
146Group: Development/Tools
147Requires: %{name} = %{version}-%{release}
148Requires: systemtap-client
149
150%description -n systemtap-nodejs
151systemtap/dtrace probes for Node.js.
152
153%description -n systemtap-nodejs -l pl.UTF-8
154Sondy systemtap/dtrace dla Node.js.
155
156%prep
157%setup -q -n node-v%{version}
158%patch0 -p1
159%if "%{_lib}" == "lib64"
160%patch3 -p1
161%else
162%patch2 -p1
163%endif
164%patch4 -p1
165
166grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python$,#!%{__python3},'
167
168%{?with_system_brotli:%{__rm} -r deps/brotli}
169%{__rm} -r deps/cares
170%if %{with http_parser}
171%{__rm} -r deps/http_parser
172%{__rm} -r deps/llhttp
173%endif
174%{__rm} -r deps/icu-small
175%{__rm} -r deps/nghttp2
176%{__rm} -r deps/npm
177%{__rm} -r deps/openssl
178%{?with_system_uv:%{__rm} -r deps/uv}
179%{__rm} -r deps/zlib
180
181%build
182ver=$(awk '/#define NODE_MODULE_VERSION/{print $3}' src/node_version.h)
183test "$ver" = "%{node_module_version}"
184
185# CC used only to detect if CC is clang, not used for compiling
186CC="%{__cc}" \
187CXX="%{__cxx}" \
188GYP_DEFINES="soname_version=%{sover}" \
189./configure \
190 --prefix=%{_prefix} \
191 --libdir=%{_lib} \
192 --openssl-use-def-ca-store \
193 --shared \
194 %{?with_system_brotli:--shared-brotli} \
195 --shared-cares \
196 %{?with_http_parser:--shared-http-parser} \
197 %{?with_system_uv:--shared-libuv} \
198 --shared-nghttp2 \
199 --shared-openssl \
200 --shared-zlib \
201 --with-intl=system-icu \
202 --without-corepack \
203 --without-dtrace \
204 --without-npm
205
206# add LFS defines from libuv (RHBZ#892601)
207# CXXFLAGS must be exported, as it is needed for make, not gyp
208CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
209LDFLAGS="%{rpmldflags}" \
210PATH="$(pwd)/out/tools/bin:$PATH" \
211%{__make} -C out \
212 BUILDTYPE=Release \
213 V=1
214
215%install
216rm -rf $RPM_BUILD_ROOT
217
218%{__python3} tools/install.py install "$RPM_BUILD_ROOT" "%{_prefix}"
219
220ln -s libnode.so.%{node_module_version} $RPM_BUILD_ROOT%{_libdir}/libnode.so
221
222echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
223
224install -d $RPM_BUILD_ROOT%{_includedir}/node
225cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
226
227# install for node-gyp
228install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
229cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
230ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
231
232# for compat of fedora derivered scripts (shebangs)
233ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
234
235# globally installed node modules (noarch)
236install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
237
238# default searchpaths
239install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
240
241# create pkgconfig
242install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
243cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
244version=%{version}
245prefix=%{_prefix}
246libdir=${prefix}/%{_lib}
247includedir=${prefix}/include/node
248
249Name: nodejs
250Description: Evented I/O for V8 JavaScript.
251Version: ${version}
252Cflags: -I${includedir}
253EOF
254
255# install documentation
256install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
257cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
258%{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.md
259%{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
260
261%clean
262rm -rf $RPM_BUILD_ROOT
263
264%post -p /sbin/ldconfig
265%postun -p /sbin/ldconfig
266
267%files
268%defattr(644,root,root,755)
269%doc AUTHORS CHANGELOG.md LICENSE README.md SECURITY.md
270%attr(755,root,root) %{_bindir}/node
271%attr(755,root,root) %{_bindir}/nodejs
272%attr(755,root,root) %{_libdir}/libnode.so.%{node_module_version}
273%if "%{_lib}" != "lib"
274%dir %{_libdir}/node
275%endif
276%dir %{_prefix}/lib/node
277%dir %{_prefix}/lib/node_modules
278%{_mandir}/man1/node.1*
279%{_mandir}/man1/nodejs.1*
280
281%files devel
282%defattr(644,root,root,755)
283%attr(755,root,root) %{_libdir}/libnode.so
284%{_includedir}/node
285%{_pkgconfigdir}/nodejs.pc
286%{_usrsrc}/%{name}
287
288%files doc
289%defattr(644,root,root,755)
290%doc %{_docdir}/%{name}-doc-%{version}
291
292%files -n systemtap-nodejs
293%defattr(644,root,root,755)
294%{_datadir}/systemtap/tapset/node.stp
This page took 0.069277 seconds and 4 git commands to generate.