3 # /usr/share/doc/node/gdbinit
4 # /usr/share/systemtap/tapset/node.stp
7 %bcond_without system_uv # system uv
8 %bcond_with shared # build libnode.so shared library
11 # - https://nodejs.org/en/download/releases/
13 # NODE_MODULE_VERSION refers to the ABI (application binary interface) version
14 # number of Node.js, used to determine which versions of Node.js compiled C++
15 # add-on binaries can be loaded in to without needing to be re-compiled. It
16 # used to be stored as hex value in earlier versions, but is now represented as
18 %define node_module_version 48
19 Summary: Asynchronous JavaScript Engine
20 Summary(pl.UTF-8): Asynchroniczny silnik JavaScriptu
22 # 6.9 is LTS, Active LTS: 2018-04-18, EOL: 2019-04-18
23 # https://github.com/nodejs/LTS
26 License: BSD and MIT and Apache v2.0 and GPL v3
27 Group: Development/Languages
28 Source0: https://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
29 # Source0-md5: 3795199b5950b25179248847b1a5fc86
30 Patch1: %{name}-shared.patch
31 # force node to use /usr/lib/node as the systemwide module directory
32 Patch2: %{name}-libpath.patch
33 # use /usr/lib64/node as an arch-specific module dir when appropriate
34 Patch3: %{name}-lib64path.patch
35 Patch4: %{name}-use-system-certs.patch
37 URL: https://nodejs.org/
38 BuildRequires: gcc >= 5:4.0
39 BuildRequires: http-parser-devel >= 2.7.0
40 BuildRequires: libstdc++-devel
41 %{?with_system_uv:BuildRequires: libuv-devel >= 1.6.0}
42 BuildRequires: openssl-devel >= 1.0.1
43 BuildRequires: pkgconfig
44 BuildRequires: python >= 1:2.7
45 BuildRequires: python-jsmin
46 BuildRequires: python-modules
47 BuildRequires: rpm >= 4.4.9-56
48 BuildRequires: rpmbuild(macros) >= 1.219
49 BuildRequires: sed >= 4.0
50 BuildRequires: zlib-devel
51 Requires: ca-certificates
52 Provides: nodejs(engine) = %{version}
53 Provides: nodejs(module-version) = %{node_module_version}
55 ExclusiveArch: %{ix86} %{x8664} arm
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58 %define sover %(echo %{version} | cut -d. -f2)
59 # add macro, so adapter won't replace it back literal
60 %define doc_ver %{version}
63 Node.js is a platform built on Chrome's JavaScript runtime for easily
64 building fast, scalable network applications. Node.js uses an
65 event-driven, non-blocking I/O model that makes it lightweight and
66 efficient, perfect for data-intensive real-time applications that run
67 across distributed devices.
69 %description -l pl.UTF-8
70 Node.js to platforma zbudowana w opacriu o silnik JavaScriptu
71 przeglądarki Chrome, służąca do tworzenia szybkich, skalowalnych
72 aplikacji sieciowych. Node.js wykorzystuje nieblokujący model
73 wejścia/wyjścia sterowany zdarzeniami, dzięki czemu jest lekki i
74 wydajny, dobrze nadający się do aplikacji przetwarzających duże
75 ilości danych w czasie rzeczywistym, uruchamianych na rozproszonych
79 Summary: Development headers for nodejs
80 Summary(pl.UTF-8): Pliki nagłówkowe nodejs
81 Group: Development/Libraries
82 Requires: %{name} = %{version}-%{release}
84 Requires: http-parser-devel >= 2.5.0
85 Requires: libstdc++-devel
86 %{?with_system_uv:Requires: libuv-devel >= 1.6.0}
87 Requires: openssl-devel
91 Development headers for nodejs.
93 %description devel -l pl.UTF-8
94 Pliki nagłówkowe nodejs.
97 Summary: Documentation for Node.js engine
98 Summary(pl.UTF-8): Dokumentacja silnika Node.js
100 URL: https://nodejs.org/dist/v%{doc_ver}/docs/api
101 %if "%{_rpmversion}" >= "5"
106 Node.js is a server-side JavaScript environment that uses an
107 asynchronous event-driven model. Node's goal is to provide an easy way
108 to build scalable network programs.
110 This package contains the documentation for Node.js.
112 %description doc -l pl.UTF-8
113 Node.js to serwerowe środowisko JavaScriptu wykorzystujące
114 asynchroniczny model sterowany zdarzeniami. Celem Node jest
115 zapewnienie łatwego sposobu tworzenia skalowalnych programów
118 Ten pakiet zawiera dokumentację Node.js.
121 %setup -q -n node-v%{version}
122 %{?with_shared:%patch1 -p1}
124 %if %{_lib} == "lib64"
130 %{__rm} src/node_root_certs.h
131 #%{?with_system_uv:%patch5 -p1}
133 grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
136 %{__rm} -r deps/http_parser
137 %{__rm} -r deps/openssl
138 %{?with_system_uv:%{__rm} -r deps/uv}
142 ver=$(awk '/#define NODE_MODULE_VERSION/{print $3}' src/node_version.h)
143 test "$ver" = "%{node_module_version}"
145 # CC used only to detect if CC is clang, not used for compiling
148 GYP_DEFINES="soname_version=%{sover}" \
152 %{?0:--shared-cares} \
153 %{?with_system_uv:--shared-libuv} \
154 --shared-http-parser \
159 # add LFS defines from libuv (RHBZ#892601)
160 # CXXFLAGS must be exported, as it is needed for make, not gyp
161 CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
162 LDFLAGS="%{rpmldflags}" \
168 rm -rf $RPM_BUILD_ROOT
170 %{__python} tools/install.py install "$RPM_BUILD_ROOT" "%{_prefix}"
173 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
174 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
175 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
178 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
180 install -d $RPM_BUILD_ROOT%{_includedir}/node
181 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
183 # install for node-gyp
184 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
185 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
186 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
188 # for compat of fedora derivered scripts (shebangs)
189 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
191 # globally installed node modules (noarch)
192 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
194 # default searchpaths
195 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
198 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
199 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
202 libdir=${prefix}/%{_lib}
203 includedir=${prefix}/include/node
206 Description: Evented I/O for V8 JavaScript.
208 Cflags: -I${includedir}
211 # install documentation
212 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
213 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
214 %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.md
215 %{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
218 rm -rf $RPM_BUILD_ROOT
221 %post -p /sbin/ldconfig
222 %postun -p /sbin/ldconfig
226 %defattr(644,root,root,755)
227 %doc README.md AUTHORS CHANGELOG.md ROADMAP.md LICENSE
228 %attr(755,root,root) %{_bindir}/node
229 %attr(755,root,root) %{_bindir}/nodejs
231 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
232 %attr(755,root,root) %ghost %{_libdir}/libnode.so.10
234 %if "%{_lib}" != "lib"
237 %dir %{_prefix}/lib/node
238 %dir %{_prefix}/lib/node_modules
239 %{_mandir}/man1/node.1*
240 %{_mandir}/man1/nodejs.1*
243 %defattr(644,root,root,755)
245 %attr(755,root,root) %{_libdir}/libnode.so
248 %{_pkgconfigdir}/nodejs.pc
252 %defattr(644,root,root,755)
253 %doc %{_docdir}/%{name}-doc-%{version}