2 # - https://nodejs.org/en/download/releases/
4 Summary: Asynchronous JavaScript Engine
8 License: BSD and MIT and Apache v2.0 and GPL v3
9 Group: Development/Languages
10 Source0: https://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
11 # Source0-md5: f6ef20f327ecd6cb1586c41c7184290c
12 Patch1: %{name}-shared.patch
13 # force node to use /usr/lib/node as the systemwide module directory
14 Patch2: %{name}-libpath.patch
15 # use /usr/lib64/node as an arch-specific module dir when appropriate
16 Patch3: %{name}-lib64path.patch
17 Patch4: %{name}-use-system-certs.patch
19 # The invalid UTF8 fix has been reverted since this breaks v8 API, which cannot
20 # be done in a stable distribution release. This build of nodejs will behave as
21 # if NODE_INVALID_UTF8 was set. For more information on the implications, see:
22 # http://blog.nodejs.org/2014/06/16/openssl-and-breaking-utf-8-change/
23 Patch6: %{name}-revert-utf8-v8.patch
24 Patch7: %{name}-revert-utf8-node.patch
25 URL: https://nodejs.org/
26 BuildRequires: c-ares-devel
27 BuildRequires: gcc >= 5:4.0
28 BuildRequires: http-parser-devel >= 2.0
29 BuildRequires: libstdc++-devel
30 BuildRequires: libuv-devel >= 0.10
31 BuildRequires: openssl-devel
32 BuildRequires: pkgconfig
33 BuildRequires: python >= 1:2.5.2
34 BuildRequires: python-jsmin
35 BuildRequires: rpm >= 4.4.9-56
36 BuildRequires: rpmbuild(macros) >= 1.219
37 BuildRequires: sed >= 4.0
38 BuildRequires: v8-devel >= 3.15.11.10
39 BuildRequires: zlib-devel
40 Requires: ca-certificates
42 ExclusiveArch: %{ix86} %{x8664} arm
43 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 %define sover %(echo %{version} | cut -d. -f2)
48 Node.js is a platform built on Chrome's JavaScript runtime for easily
49 building fast, scalable network applications. Node.js uses an
50 event-driven, non-blocking I/O model that makes it lightweight and
51 efficient, perfect for data-intensive real-time applications that run
52 across distributed devices.
55 Summary: Development headers for nodejs
56 Group: Development/Libraries
57 Requires: %{name} = %{version}-%{release}
58 Requires: c-ares-devel
60 Requires: http-parser-devel
61 Requires: libstdc++-devel
63 Requires: openssl-devel
68 Development headers for nodejs.
71 Summary: Evented I/O for V8 JavaScript - documentation
75 Node.js is a server-side JavaScript environment that uses an
76 asynchronous event-driven model. Node's goal is to provide an easy way
77 to build scalable network programs.
79 This package contains the documentation for nodejs.
82 %setup -q -n node-v%{version}
84 %if %{_lib} == "lib64"
94 grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
99 # CC used only to detect if CC is clang, not used for compiling
102 GYP_DEFINES="soname_version=%{sover}" \
109 --shared-http-parser \
114 # add LFS defines from libuv (RHBZ#892601)
115 # CXXFLAGS must be exported, as it is needed for make, not gyp
116 CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
117 LDFLAGS="%{rpmldflags}" \
118 %{__make} -C out V=1 BUILDTYPE=Release
121 rm -rf $RPM_BUILD_ROOT
122 %{__make} justinstall \
123 DESTDIR=$RPM_BUILD_ROOT \
126 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
127 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
128 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
130 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
132 install -d $RPM_BUILD_ROOT%{_includedir}/node
133 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
135 # install for node-gyp
136 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
137 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
138 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
140 # for compat of fedora derivered scripts (shebangs)
141 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
143 # globally installed node modules (noarch)
144 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
146 # default searchpaths
147 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
150 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
151 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
154 libdir=${prefix}/%{_lib}
155 includedir=${prefix}/include/node
158 Description: Evented I/O for V8 JavaScript.
160 Cflags: -I${includedir}
163 # install documentation
164 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
165 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
166 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
167 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
170 rm -rf $RPM_BUILD_ROOT
172 %post -p /sbin/ldconfig
173 %postun -p /sbin/ldconfig
176 %defattr(644,root,root,755)
177 %doc README.md AUTHORS ChangeLog LICENSE
178 %attr(755,root,root) %{_bindir}/node
179 %attr(755,root,root) %{_bindir}/nodejs
180 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
181 %ghost %{_libdir}/libnode.so.10
182 %if "%{_lib}" != "lib"
185 %dir %{_prefix}/lib/node
186 %dir %{_prefix}/lib/node_modules
187 %{_mandir}/man1/node.1*
188 %{_mandir}/man1/nodejs.1
191 %defattr(644,root,root,755)
192 %{_libdir}/libnode.so
194 %{_pkgconfigdir}/nodejs.pc
198 %defattr(644,root,root,755)
199 %doc %{_docdir}/%{name}-doc-%{version}