3 # /usr/share/doc/node/gdbinit
6 %bcond_without system_brotli # system brotli
7 %bcond_without system_uv # system uv
8 %bcond_with http_parser # system http-parser and llhttp
11 # - https://nodejs.org/en/download/releases/
13 # NODE_MODULE_VERSION refers to the ABI (application binary interface) version
14 # number of Node.js, used to determine which versions of Node.js compiled C++
15 # add-on binaries can be loaded in to without needing to be re-compiled. It
16 # used to be stored as hex value in earlier versions, but is now represented as
18 %define node_module_version 83
19 Summary: Asynchronous JavaScript Engine
20 Summary(pl.UTF-8): Asynchroniczny silnik JavaScriptu
22 # 14.x LTS - https://github.com/nodejs/Release
23 # Active start: 2020-10-27
24 # Maintenance start: October 2020
25 # Maintenance end: April 2023
28 License: BSD and MIT and Apache v2.0 and GPL v3
29 Group: Development/Languages
30 Source0: https://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
31 # Source0-md5: a5cf57a18833bd122eca200a7d5e22d9
33 # force node to use /usr/lib/node as the systemwide module directory
34 Patch2: %{name}-libpath.patch
35 # use /usr/lib64/node as an arch-specific module dir when appropriate
36 Patch3: %{name}-lib64path.patch
37 Patch4: 0001-Disable-running-gyp-on-shared-deps.patch
38 Patch5: 0002-Install-both-binaries-and-use-libdir.patch
39 URL: https://nodejs.org/
40 BuildRequires: c-ares-devel >= 1.16.1
41 BuildRequires: gcc >= 6:6.3
42 %if %{with http_parser}
43 BuildRequires: http-parser-devel >= 2.9.3
44 BuildRequires: llhttp-devel >= 2.1.3
46 %{?with_system_brotli:BuildRequires: libbrotli-devel >= 1.0.9}
47 BuildRequires: libicu-devel >= 67
48 BuildRequires: libstdc++-devel >= 6:4.8
49 %{?with_system_uv:BuildRequires: libuv-devel >= 1.38.1}
50 BuildRequires: nghttp2-devel >= 1.41.0
51 BuildRequires: openssl-devel >= 1.0.1
52 BuildRequires: pkgconfig
53 BuildRequires: python3
54 BuildRequires: python3-modules
55 BuildRequires: rpm >= 4.4.9-56
56 BuildRequires: rpmbuild(macros) >= 1.219
57 BuildRequires: sed >= 4.0
58 BuildRequires: zlib-devel >= 1.2.11
59 Requires: c-ares >= 1.16.1
60 Requires: ca-certificates
61 %{?with_http_parser:Requires: http-parser >= 2.9.3}
62 %{?with_system_brotli:Requires: libbrotli >= 1.0.9}
63 %{?with_system_uv:Requires: libuv >= 1.38.1}
64 Requires: nghttp2-libs >= 1.41.0
65 Requires: zlib >= 1.2.11
66 Provides: nodejs(engine) = %{version}
67 Provides: nodejs(module-version) = %{node_module_version}
69 ExclusiveArch: %{ix86} %{x8664} %{arm} aarch64
70 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
72 %define sover %(echo %{version} | cut -d. -f2)
73 # add macro, so adapter won't replace it back literal
74 %define doc_ver %{version}
77 Node.js is a platform built on Chrome's JavaScript runtime for easily
78 building fast, scalable network applications. Node.js uses an
79 event-driven, non-blocking I/O model that makes it lightweight and
80 efficient, perfect for data-intensive real-time applications that run
81 across distributed devices.
83 %description -l pl.UTF-8
84 Node.js to platforma zbudowana w opacriu o silnik JavaScriptu
85 przeglądarki Chrome, służąca do tworzenia szybkich, skalowalnych
86 aplikacji sieciowych. Node.js wykorzystuje nieblokujący model
87 wejścia/wyjścia sterowany zdarzeniami, dzięki czemu jest lekki i
88 wydajny, dobrze nadający się do aplikacji przetwarzających duże
89 ilości danych w czasie rzeczywistym, uruchamianych na rozproszonych
93 Summary: Development headers for nodejs
94 Summary(pl.UTF-8): Pliki nagłówkowe nodejs
95 Group: Development/Libraries
96 Requires: %{name} = %{version}-%{release}
98 %{?with_http_parser:Requires: http-parser-devel >= 2.9.3}
99 Requires: libstdc++-devel
100 %{?with_system_uv:Requires: libuv-devel >= 1.38.1}
101 Requires: openssl-devel
102 Requires: zlib-devel >= 1.2.11
105 Development headers for nodejs.
107 %description devel -l pl.UTF-8
108 Pliki nagłówkowe nodejs.
111 Summary: Documentation for Node.js engine
112 Summary(pl.UTF-8): Dokumentacja silnika Node.js
114 URL: https://nodejs.org/dist/v%{doc_ver}/docs/api
115 %if "%{_rpmversion}" >= "4.6"
120 Node.js is a server-side JavaScript environment that uses an
121 asynchronous event-driven model. Node's goal is to provide an easy way
122 to build scalable network programs.
124 This package contains the documentation for Node.js.
126 %description doc -l pl.UTF-8
127 Node.js to serwerowe środowisko JavaScriptu wykorzystujące
128 asynchroniczny model sterowany zdarzeniami. Celem Node jest
129 zapewnienie łatwego sposobu tworzenia skalowalnych programów
132 Ten pakiet zawiera dokumentację Node.js.
134 %package -n systemtap-nodejs
135 Summary: systemtap/dtrace probes for Node.js
136 Summary(pl.UTF-8): Sondy systemtap/dtrace dla Node.js
137 Group: Development/Tools
138 Requires: %{name} = %{version}-%{release}
139 Requires: systemtap-client
141 %description -n systemtap-nodejs
142 systemtap/dtrace probes for Node.js.
144 %description -n systemtap-nodejs -l pl.UTF-8
145 Sondy systemtap/dtrace dla Node.js.
148 %setup -q -n node-v%{version}
149 %if %{_lib} == "lib64"
157 grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python3},'
159 %{?with_system_brotli:%{__rm} -r deps/brotli}
160 %{__rm} -r deps/cares
161 %if %{with http_parser}
162 %{__rm} -r deps/http_parser
163 %{__rm} -r deps/llhttp
165 %{__rm} -r deps/icu-small
166 %{__rm} -r deps/nghttp2
168 %{__rm} -r deps/openssl
169 %{?with_system_uv:%{__rm} -r deps/uv}
173 ver=$(awk '/#define NODE_MODULE_VERSION/{print $3}' src/node_version.h)
174 test "$ver" = "%{node_module_version}"
176 # CC used only to detect if CC is clang, not used for compiling
179 GYP_DEFINES="soname_version=%{sover}" \
181 --prefix=%{_prefix} \
183 --openssl-use-def-ca-store \
185 %{?with_system_brotli:--shared-brotli} \
187 %{?with_http_parser:--shared-http-parser} \
188 %{?with_system_uv:--shared-libuv} \
192 --with-intl=system-icu \
196 # add LFS defines from libuv (RHBZ#892601)
197 # CXXFLAGS must be exported, as it is needed for make, not gyp
198 CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
199 LDFLAGS="%{rpmldflags}" \
205 rm -rf $RPM_BUILD_ROOT
207 %{__python3} tools/install.py install "$RPM_BUILD_ROOT" "%{_prefix}"
209 ln -s libnode.so.%{node_module_version} $RPM_BUILD_ROOT%{_libdir}/libnode.so
211 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
213 install -d $RPM_BUILD_ROOT%{_includedir}/node
214 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
216 # install for node-gyp
217 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
218 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
219 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
221 # for compat of fedora derivered scripts (shebangs)
222 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
224 # globally installed node modules (noarch)
225 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
227 # default searchpaths
228 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
231 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
232 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
235 libdir=${prefix}/%{_lib}
236 includedir=${prefix}/include/node
239 Description: Evented I/O for V8 JavaScript.
241 Cflags: -I${includedir}
244 # install documentation
245 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
246 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
247 %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.md
248 %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
251 rm -rf $RPM_BUILD_ROOT
253 %post -p /sbin/ldconfig
254 %postun -p /sbin/ldconfig
257 %defattr(644,root,root,755)
258 %doc AUTHORS CHANGELOG.md LICENSE README.md SECURITY.md
259 %attr(755,root,root) %{_bindir}/node
260 %attr(755,root,root) %{_bindir}/nodejs
261 %attr(755,root,root) %{_libdir}/libnode.so.%{node_module_version}
262 %if "%{_lib}" != "lib"
265 %dir %{_prefix}/lib/node
266 %dir %{_prefix}/lib/node_modules
267 %{_mandir}/man1/node.1*
268 %{_mandir}/man1/nodejs.1*
271 %defattr(644,root,root,755)
272 %attr(755,root,root) %{_libdir}/libnode.so
274 %{_pkgconfigdir}/nodejs.pc
278 %defattr(644,root,root,755)
279 %doc %{_docdir}/%{name}-doc-%{version}
281 %files -n systemtap-nodejs
282 %defattr(644,root,root,755)
283 %{_datadir}/systemtap/tapset/node.stp