3 # /usr/share/doc/node/gdbinit
6 %bcond_without system_uv # system uv
7 %bcond_with shared # build libnode.so shared library
10 # - https://nodejs.org/en/download/releases/
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
17 %define node_module_version 48
18 Summary: Asynchronous JavaScript Engine
19 Summary(pl.UTF-8): Asynchroniczny silnik JavaScriptu
21 # 6.x LTS - https://github.com/nodejs/LTS:
22 # Active start: 2016-10-18
23 # Maintenance start: April 2018
24 # Maintenance end: April 2019
27 License: BSD and MIT and Apache v2.0 and GPL v3
28 Group: Development/Languages
29 Source0: https://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
30 # Source0-md5: 7a3159a3245a45ff6e6f546ffdfa1160
31 Patch1: %{name}-shared.patch
32 # force node to use /usr/lib/node as the systemwide module directory
33 Patch2: %{name}-libpath.patch
34 # use /usr/lib64/node as an arch-specific module dir when appropriate
35 Patch3: %{name}-lib64path.patch
36 Patch4: %{name}-use-system-certs.patch
38 URL: https://nodejs.org/
39 BuildRequires: gcc >= 6:4.8
40 BuildRequires: http-parser-devel >= 2.7.0
41 BuildRequires: libstdc++-devel >= 6:4.8
42 %{?with_system_uv:BuildRequires: libuv-devel >= 1.6.0}
43 BuildRequires: openssl-devel >= 1.0.1
44 BuildRequires: pkgconfig
45 BuildRequires: python >= 1:2.7
46 BuildRequires: python-jsmin
47 BuildRequires: python-modules >= 1:2.7
48 BuildRequires: rpm >= 4.4.9-56
49 BuildRequires: rpmbuild(macros) >= 1.219
50 BuildRequires: sed >= 4.0
51 BuildRequires: zlib-devel
52 Requires: ca-certificates
53 Provides: nodejs(engine) = %{version}
54 Provides: nodejs(module-version) = %{node_module_version}
56 ExclusiveArch: %{ix86} %{x8664} arm
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 %define sover %(echo %{version} | cut -d. -f2)
60 # add macro, so adapter won't replace it back literal
61 %define doc_ver %{version}
64 Node.js is a platform built on Chrome's JavaScript runtime for easily
65 building fast, scalable network applications. Node.js uses an
66 event-driven, non-blocking I/O model that makes it lightweight and
67 efficient, perfect for data-intensive real-time applications that run
68 across distributed devices.
70 %description -l pl.UTF-8
71 Node.js to platforma zbudowana w opacriu o silnik JavaScriptu
72 przeglądarki Chrome, służąca do tworzenia szybkich, skalowalnych
73 aplikacji sieciowych. Node.js wykorzystuje nieblokujący model
74 wejścia/wyjścia sterowany zdarzeniami, dzięki czemu jest lekki i
75 wydajny, dobrze nadający się do aplikacji przetwarzających duże
76 ilości danych w czasie rzeczywistym, uruchamianych na rozproszonych
80 Summary: Development headers for nodejs
81 Summary(pl.UTF-8): Pliki nagłówkowe nodejs
82 Group: Development/Libraries
83 Requires: %{name} = %{version}-%{release}
85 Requires: http-parser-devel >= 2.5.0
86 Requires: libstdc++-devel
87 %{?with_system_uv:Requires: libuv-devel >= 1.6.0}
88 Requires: openssl-devel
92 Development headers for nodejs.
94 %description devel -l pl.UTF-8
95 Pliki nagłówkowe nodejs.
98 Summary: Documentation for Node.js engine
99 Summary(pl.UTF-8): Dokumentacja silnika Node.js
101 URL: https://nodejs.org/dist/v%{doc_ver}/docs/api
102 %if "%{_rpmversion}" >= "5"
107 Node.js is a server-side JavaScript environment that uses an
108 asynchronous event-driven model. Node's goal is to provide an easy way
109 to build scalable network programs.
111 This package contains the documentation for Node.js.
113 %description doc -l pl.UTF-8
114 Node.js to serwerowe środowisko JavaScriptu wykorzystujące
115 asynchroniczny model sterowany zdarzeniami. Celem Node jest
116 zapewnienie łatwego sposobu tworzenia skalowalnych programów
119 Ten pakiet zawiera dokumentację Node.js.
121 %package -n systemtap-nodejs
122 Summary: systemtap/dtrace probes for Node.js
123 Summary(pl.UTF-8): Sondy systemtap/dtrace dla Node.js
124 Group: Development/Tools
125 Requires: %{name} = %{version}-%{release}
126 Requires: systemtap-client
128 %description -n systemtap-nodejs
129 systemtap/dtrace probes for Node.js.
131 %description -n systemtap-nodejs -l pl.UTF-8
132 Sondy systemtap/dtrace dla Node.js.
135 %setup -q -n node-v%{version}
136 %{?with_shared:%patch1 -p1}
138 %if %{_lib} == "lib64"
144 #%{__rm} src/node_root_certs.h
145 #%{?with_system_uv:%patch5 -p1}
147 grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
150 %{__rm} -r deps/http_parser
151 %{__rm} -r deps/openssl
152 %{?with_system_uv:%{__rm} -r deps/uv}
156 ver=$(awk '/#define NODE_MODULE_VERSION/{print $3}' src/node_version.h)
157 test "$ver" = "%{node_module_version}"
159 # CC used only to detect if CC is clang, not used for compiling
162 GYP_DEFINES="soname_version=%{sover}" \
164 %{?0:--shared-cares} \
166 --shared-http-parser \
167 %{?with_system_uv:--shared-libuv} \
173 # add LFS defines from libuv (RHBZ#892601)
174 # CXXFLAGS must be exported, as it is needed for make, not gyp
175 CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
176 LDFLAGS="%{rpmldflags}" \
182 rm -rf $RPM_BUILD_ROOT
184 %{__python} tools/install.py install "$RPM_BUILD_ROOT" "%{_prefix}"
187 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
188 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
189 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
192 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
194 install -d $RPM_BUILD_ROOT%{_includedir}/node
195 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
197 # install for node-gyp
198 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
199 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
200 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
202 # for compat of fedora derivered scripts (shebangs)
203 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
205 # globally installed node modules (noarch)
206 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
208 # default searchpaths
209 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
212 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
213 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
216 libdir=${prefix}/%{_lib}
217 includedir=${prefix}/include/node
220 Description: Evented I/O for V8 JavaScript.
222 Cflags: -I${includedir}
225 # install documentation
226 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
227 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
228 %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.md
229 %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
232 rm -rf $RPM_BUILD_ROOT
235 %post -p /sbin/ldconfig
236 %postun -p /sbin/ldconfig
240 %defattr(644,root,root,755)
241 %doc README.md AUTHORS CHANGELOG.md LICENSE
242 %attr(755,root,root) %{_bindir}/node
243 %attr(755,root,root) %{_bindir}/nodejs
245 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
246 %attr(755,root,root) %ghost %{_libdir}/libnode.so.10
248 %if "%{_lib}" != "lib"
251 %dir %{_prefix}/lib/node
252 %dir %{_prefix}/lib/node_modules
253 %{_mandir}/man1/node.1*
254 %{_mandir}/man1/nodejs.1*
257 %defattr(644,root,root,755)
259 %attr(755,root,root) %{_libdir}/libnode.so
262 %{_pkgconfigdir}/nodejs.pc
266 %defattr(644,root,root,755)
267 %doc %{_docdir}/%{name}-doc-%{version}
269 %files -n systemtap-nodejs
270 %defattr(644,root,root,755)
271 %{_datadir}/systemtap/tapset/node.stp