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