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