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