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 Summary: Asynchronous JavaScript Engine
17 License: BSD and MIT and Apache v2.0 and GPL v3
18 Group: Development/Languages
19 Source0: https://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
20 # Source0-md5: 529a8abd4ca5a2225636767d3f14c382
21 Patch1: %{name}-shared.patch
22 # force node to use /usr/lib/node as the systemwide module directory
23 Patch2: %{name}-libpath.patch
24 # use /usr/lib64/node as an arch-specific module dir when appropriate
25 Patch3: %{name}-lib64path.patch
26 Patch4: %{name}-use-system-certs.patch
28 URL: https://nodejs.org/
29 BuildRequires: gcc >= 5:4.0
30 BuildRequires: http-parser-devel >= 2.5.0
31 BuildRequires: libstdc++-devel
32 %{?with_system_uv:BuildRequires: libuv-devel >= 1.6.0}
33 BuildRequires: openssl-devel >= 1.0.1
34 BuildRequires: pkgconfig
35 BuildRequires: python >= 1:2.5.2
36 BuildRequires: python-jsmin
37 BuildRequires: rpm >= 4.4.9-56
38 BuildRequires: rpmbuild(macros) >= 1.219
39 BuildRequires: sed >= 4.0
40 BuildRequires: zlib-devel
41 Requires: ca-certificates
43 ExclusiveArch: %{ix86} %{x8664} arm
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 %define sover %(echo %{version} | cut -d. -f2)
49 Node.js is a platform built on Chrome's JavaScript runtime for easily
50 building fast, scalable network applications. Node.js uses an
51 event-driven, non-blocking I/O model that makes it lightweight and
52 efficient, perfect for data-intensive real-time applications that run
53 across distributed devices.
56 Summary: Development headers for nodejs
57 Group: Development/Libraries
58 Requires: %{name} = %{version}-%{release}
60 Requires: http-parser-devel >= 2.5.0
61 Requires: libstdc++-devel
62 %{?with_system_uv:Requires: libuv-devel >= 1.6.0}
63 Requires: openssl-devel
67 Development headers for nodejs.
70 Summary: Evented I/O for V8 JavaScript - documentation
72 %if "%{_rpmversion}" >= "5"
77 Node.js is a server-side JavaScript environment that uses an
78 asynchronous event-driven model. Node's goal is to provide an easy way
79 to build scalable network programs.
81 This package contains the documentation for nodejs.
84 %setup -q -n node-v%{version}
85 %{?with_shared:%patch1 -p1}
87 %if %{_lib} == "lib64"
93 #%{?with_system_uv:%patch5 -p1}
95 grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
98 rm -r deps/http_parser
100 %{?with_system_uv:rm -r deps/uv}
104 # CC used only to detect if CC is clang, not used for compiling
107 GYP_DEFINES="soname_version=%{sover}" \
111 %{?0:--shared-cares} \
112 %{?with_system_uv:--shared-libuv} \
113 --shared-http-parser \
118 # add LFS defines from libuv (RHBZ#892601)
119 # CXXFLAGS must be exported, as it is needed for make, not gyp
120 CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
121 LDFLAGS="%{rpmldflags}" \
122 %{__make} -C out V=1 BUILDTYPE=Release
125 rm -rf $RPM_BUILD_ROOT
126 %{__python} tools/install.py install "$RPM_BUILD_ROOT" "%{_prefix}"
129 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
130 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
131 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
134 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
136 install -d $RPM_BUILD_ROOT%{_includedir}/node
137 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
139 # install for node-gyp
140 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
141 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
142 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
144 # for compat of fedora derivered scripts (shebangs)
145 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
147 # globally installed node modules (noarch)
148 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
150 # default searchpaths
151 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
154 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
155 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
158 libdir=${prefix}/%{_lib}
159 includedir=${prefix}/include/node
162 Description: Evented I/O for V8 JavaScript.
164 Cflags: -I${includedir}
167 # install documentation
168 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
169 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
170 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
171 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
174 rm -rf $RPM_BUILD_ROOT
177 %post -p /sbin/ldconfig
178 %postun -p /sbin/ldconfig
182 %defattr(644,root,root,755)
183 %doc README.md AUTHORS CHANGELOG.md ROADMAP.md LICENSE
184 %attr(755,root,root) %{_bindir}/node
185 %attr(755,root,root) %{_bindir}/nodejs
187 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
188 %ghost %{_libdir}/libnode.so.10
190 %if "%{_lib}" != "lib"
193 %dir %{_prefix}/lib/node
194 %dir %{_prefix}/lib/node_modules
195 %{_mandir}/man1/node.1*
196 %{_mandir}/man1/nodejs.1
199 %defattr(644,root,root,755)
201 %{_libdir}/libnode.so
204 %{_pkgconfigdir}/nodejs.pc
208 %defattr(644,root,root,755)
209 %doc %{_docdir}/%{name}-doc-%{version}