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