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