3 # /usr/share/doc/node/gdbinit
4 # /usr/share/systemtap/tapset/node.stp
7 %bcond_with system_v8 # system v8
8 %bcond_without system_uv # system uv
9 %bcond_with shared # build libnode.so shared library
12 # - https://nodejs.org/en/download/releases/
14 Summary: Asynchronous JavaScript Engine
18 License: BSD and MIT and Apache v2.0 and GPL v3
19 Group: Development/Languages
20 Source0: https://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
21 # Source0-md5: 529a8abd4ca5a2225636767d3f14c382
22 Patch1: %{name}-shared.patch
23 # force node to use /usr/lib/node as the systemwide module directory
24 Patch2: %{name}-libpath.patch
25 # use /usr/lib64/node as an arch-specific module dir when appropriate
26 Patch3: %{name}-lib64path.patch
27 Patch4: %{name}-use-system-certs.patch
29 # The invalid UTF8 fix has been reverted since this breaks v8 API, which cannot
30 # be done in a stable distribution release. This build of nodejs will behave as
31 # if NODE_INVALID_UTF8 was set. For more information on the implications, see:
32 # http://blog.nodejs.org/2014/06/16/openssl-and-breaking-utf-8-change/
33 Patch6: %{name}-revert-utf8-v8.patch
34 Patch7: %{name}-revert-utf8-node.patch
35 URL: https://nodejs.org/
36 BuildRequires: c-ares-devel
37 BuildRequires: gcc >= 5:4.0
38 BuildRequires: http-parser-devel >= 2.5.0
39 BuildRequires: libstdc++-devel
40 %{?with_system_uv:BuildRequires: libuv-devel >= 1.6.0}
41 BuildRequires: openssl-devel
42 BuildRequires: pkgconfig
43 BuildRequires: python >= 1:2.5.2
44 BuildRequires: python-jsmin
45 BuildRequires: rpm >= 4.4.9-56
46 BuildRequires: rpmbuild(macros) >= 1.219
47 BuildRequires: sed >= 4.0
48 %{?with_system_v8:BuildRequires: v8-devel >= 3.15.11.18-2}
49 BuildRequires: zlib-devel
50 Requires: ca-certificates
52 ExclusiveArch: %{ix86} %{x8664} arm
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55 %define sover %(echo %{version} | cut -d. -f2)
58 Node.js is a platform built on Chrome's JavaScript runtime for easily
59 building fast, scalable network applications. Node.js uses an
60 event-driven, non-blocking I/O model that makes it lightweight and
61 efficient, perfect for data-intensive real-time applications that run
62 across distributed devices.
65 Summary: Development headers for nodejs
66 Group: Development/Libraries
67 Requires: %{name} = %{version}-%{release}
68 Requires: c-ares-devel
70 Requires: http-parser-devel
71 Requires: libstdc++-devel
72 %{?with_system_uv:Requires: libuv-devel}
73 Requires: openssl-devel
74 %{?with_system_v8:Requires: v8-devel}
78 Development headers for nodejs.
81 Summary: Evented I/O for V8 JavaScript - documentation
83 %if "%{_rpmversion}" >= "5"
88 Node.js is a server-side JavaScript environment that uses an
89 asynchronous event-driven model. Node's goal is to provide an easy way
90 to build scalable network programs.
92 This package contains the documentation for nodejs.
95 %setup -q -n node-v%{version}
96 %{?with_shared:%patch1 -p1}
98 %if %{_lib} == "lib64"
104 #%{?with_system_uv:%patch5 -p1}
108 grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
112 rm -r deps/http_parser
114 %{?with_system_uv:rm -r deps/uv}
115 %{?with_system_v8:rm -r deps/v8}
119 # CC used only to detect if CC is clang, not used for compiling
122 GYP_DEFINES="soname_version=%{sover}" \
124 %{?with_system_v8:--shared-v8} \
127 %{?0:--shared-cares} \
128 %{?with_system_uv:--shared-libuv} \
129 --shared-http-parser \
134 # add LFS defines from libuv (RHBZ#892601)
135 # CXXFLAGS must be exported, as it is needed for make, not gyp
136 CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
137 LDFLAGS="%{rpmldflags}" \
138 %{__make} -C out V=1 BUILDTYPE=Release
141 rm -rf $RPM_BUILD_ROOT
142 %{__python} tools/install.py install "$RPM_BUILD_ROOT" "%{_prefix}"
145 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
146 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
147 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
150 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
152 install -d $RPM_BUILD_ROOT%{_includedir}/node
153 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
155 # install for node-gyp
156 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
157 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
158 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
160 # for compat of fedora derivered scripts (shebangs)
161 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
163 # globally installed node modules (noarch)
164 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
166 # default searchpaths
167 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
170 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
171 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
174 libdir=${prefix}/%{_lib}
175 includedir=${prefix}/include/node
178 Description: Evented I/O for V8 JavaScript.
180 Cflags: -I${includedir}
183 # install documentation
184 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
185 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
186 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
187 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
190 rm -rf $RPM_BUILD_ROOT
193 %post -p /sbin/ldconfig
194 %postun -p /sbin/ldconfig
198 %defattr(644,root,root,755)
199 %doc README.md AUTHORS CHANGELOG.md ROADMAP.md LICENSE
200 %attr(755,root,root) %{_bindir}/node
201 %attr(755,root,root) %{_bindir}/nodejs
203 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
204 %ghost %{_libdir}/libnode.so.10
206 %if "%{_lib}" != "lib"
209 %dir %{_prefix}/lib/node
210 %dir %{_prefix}/lib/node_modules
211 %{_mandir}/man1/node.1*
212 %{_mandir}/man1/nodejs.1
215 %defattr(644,root,root,755)
217 %{_libdir}/libnode.so
220 %{_pkgconfigdir}/nodejs.pc
224 %defattr(644,root,root,755)
225 %doc %{_docdir}/%{name}-doc-%{version}