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