]> git.pld-linux.org Git - packages/nodejs.git/blame - nodejs.spec
8.x LTS info
[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
8c0b403f 7%bcond_with shared # build libnode.so shared library
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.
3720ca3d 17%define node_module_version 57
210abff9 18Summary: Asynchronous JavaScript Engine
9a1229ff 19Summary(pl.UTF-8): Asynchroniczny silnik JavaScriptu
210abff9 20Name: nodejs
a7fce114 21# 8.x LTS - https://github.com/nodejs/LTS:
22# Active start: 2017-10-31
23# Maintenance start: April 2019
24# Maintenance end: December 2019
3720ca3d 25Version: 8.9.3
e2a62df7 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
3720ca3d 30# Source0-md5: 88c12ccd5806a101b00139140d958c2b
4174c079 31Patch1: %{name}-shared.patch
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
1385a038 36Patch5: uv-fpic.patch
8611106e 37URL: https://nodejs.org/
8c0b403f 38BuildRequires: gcc >= 6:4.8
318ea6db 39BuildRequires: http-parser-devel >= 2.7.0
8c0b403f 40BuildRequires: libstdc++-devel >= 6:4.8
3720ca3d 41%{?with_system_uv:BuildRequires: libuv-devel >= 1.18.0}
94f7bd52 42BuildRequires: openssl-devel >= 1.0.1
cd4c73aa 43BuildRequires: pkgconfig
91adacca 44BuildRequires: python >= 1:2.7
a6070ceb 45BuildRequires: python-jsmin
8c0b403f 46BuildRequires: python-modules >= 1:2.7
12a49d35 47BuildRequires: rpm >= 4.4.9-56
d44c8857 48BuildRequires: rpmbuild(macros) >= 1.219
536f9f5a 49BuildRequires: sed >= 4.0
cd4c73aa 50BuildRequires: zlib-devel
58e86022 51Requires: ca-certificates
8d8e2928 52Provides: nodejs(engine) = %{version}
56d9fb33 53Provides: nodejs(module-version) = %{node_module_version}
5ef76b51 54Obsoletes: nodejs-waf
210abff9 55ExclusiveArch: %{ix86} %{x8664} arm
56BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
dc60a63b 58%define sover %(echo %{version} | cut -d. -f2)
05e85ef1
ER
59# add macro, so adapter won't replace it back literal
60%define doc_ver %{version}
dc60a63b 61
210abff9 62%description
c3b531ba
ER
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.
210abff9 68
9a1229ff
JB
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
210abff9 78%package devel
12a49d35 79Summary: Development headers for nodejs
9a1229ff 80Summary(pl.UTF-8): Pliki nagłówkowe nodejs
210abff9 81Group: Development/Libraries
a8f57a3f 82Requires: %{name} = %{version}-%{release}
d44c8857 83Requires: gcc
94f7bd52 84Requires: http-parser-devel >= 2.5.0
d44c8857 85Requires: libstdc++-devel
94f7bd52 86%{?with_system_uv:Requires: libuv-devel >= 1.6.0}
96f19ba5 87Requires: openssl-devel
96f19ba5 88Requires: zlib-devel
210abff9 89
90%description devel
12a49d35 91Development headers for nodejs.
210abff9 92
9a1229ff
JB
93%description devel -l pl.UTF-8
94Pliki nagłówkowe nodejs.
95
a6070ceb 96%package doc
9a1229ff
JB
97Summary: Documentation for Node.js engine
98Summary(pl.UTF-8): Dokumentacja silnika Node.js
a6070ceb 99Group: Documentation
05e85ef1 100URL: https://nodejs.org/dist/v%{doc_ver}/docs/api
b6b2dd9b
ER
101%if "%{_rpmversion}" >= "5"
102BuildArch: noarch
103%endif
a6070ceb
ER
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
9a1229ff
JB
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.
a6070ceb 119
8c0b403f
JB
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
210abff9 133%prep
134%setup -q -n node-v%{version}
9ea1462f 135%{?with_shared:%patch1 -p1}
3de234b3 136#%patch1 -p1
a6070ceb
ER
137%if %{_lib} == "lib64"
138%patch3 -p1
139%else
140%patch2 -p1
141%endif
3de234b3 142#%{?with_system_uv:%patch5 -p1}
c4aa3bb0 143
536f9f5a
ER
144grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
145
9a1229ff
JB
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
e3e8568d 151
210abff9 152%build
c8ef6556 153ver=$(awk '/#define NODE_MODULE_VERSION/{print $3}' src/node_version.h)
145d5ed0 154test "$ver" = "%{node_module_version}"
56d9fb33 155
a11025a6
ER
156# CC used only to detect if CC is clang, not used for compiling
157CC="%{__cc}" \
158CXX="%{__cxx}" \
dc60a63b 159GYP_DEFINES="soname_version=%{sover}" \
a6070ceb 160./configure \
e2a62df7 161 --openssl-use-def-ca-store \
3de234b3 162 %{?0:--shared-cares} \
8c0b403f 163 --shared-openssl \
e427e9b0 164 --shared-http-parser \
8c0b403f
JB
165 %{?with_system_uv:--shared-libuv} \
166 --shared-zlib \
7223b5ac 167 --without-npm \
c1c359b8 168 --without-dtrace \
210abff9 169 --prefix=%{_prefix}
170
a11025a6
ER
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}" \
9a1229ff
JB
175%{__make} -C out \
176 BUILDTYPE=Release \
177 V=1
210abff9 178
179%install
180rm -rf $RPM_BUILD_ROOT
9a1229ff 181
9618d15b 182%{__python} tools/install.py install "$RPM_BUILD_ROOT" "%{_prefix}"
4174c079 183
9ea1462f 184%if %{with shared}
f9cee3b6 185lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
4174c079
ER
186ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
187ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
9ea1462f 188%endif
a6070ceb 189
c7898157
ER
190echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
191
1ed21df5 192install -d $RPM_BUILD_ROOT%{_includedir}/node
4174c079 193cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
d5764a43
ER
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
1ed21df5 199
e85103e0 200# for compat of fedora derivered scripts (shebangs)
c3b531ba
ER
201ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
202
e85103e0
ER
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
a6070ceb
ER
209# create pkgconfig
210install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
211cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
212version=%{version}
c3b531ba 213prefix=%{_prefix}
87c4fdf2 214libdir=${prefix}/%{_lib}
a6070ceb
ER
215includedir=${prefix}/include/node
216
217Name: nodejs
218Description: Evented I/O for V8 JavaScript.
219Version: ${version}
220Cflags: -I${includedir}
221EOF
a752c1c0 222
a6070ceb 223# install documentation
6f7eebb5
ER
224install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
225cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
9a1229ff
JB
226%{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.md
227%{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
a6070ceb 228
210abff9 229%clean
230rm -rf $RPM_BUILD_ROOT
231
9ea1462f 232%if %{with shared}
4174c079 233%post -p /sbin/ldconfig
7372d27d 234%postun -p /sbin/ldconfig
9ea1462f 235%endif
7372d27d 236
210abff9 237%files
238%defattr(644,root,root,755)
a5a3e195 239%doc README.md AUTHORS CHANGELOG.md LICENSE
210abff9 240%attr(755,root,root) %{_bindir}/node
c3b531ba 241%attr(755,root,root) %{_bindir}/nodejs
9ea1462f 242%if %{with shared}
a600c300 243%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
9a1229ff 244%attr(755,root,root) %ghost %{_libdir}/libnode.so.10
9ea1462f 245%endif
a600c300 246%if "%{_lib}" != "lib"
8791ea86 247%dir %{_libdir}/node
a600c300
ŁC
248%endif
249%dir %{_prefix}/lib/node
e85103e0 250%dir %{_prefix}/lib/node_modules
210abff9 251%{_mandir}/man1/node.1*
9a1229ff 252%{_mandir}/man1/nodejs.1*
210abff9 253
210abff9 254%files devel
255%defattr(644,root,root,755)
9ea1462f 256%if %{with shared}
9a1229ff 257%attr(755,root,root) %{_libdir}/libnode.so
9ea1462f 258%endif
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.138193 seconds and 4 git commands to generate.