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