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
15 # The invalid UTF8 fix has been reverted since this breaks v8 API, which cannot
16 # be done in a stable distribution release. This build of nodejs will behave as
17 # if NODE_INVALID_UTF8 was set. For more information on the implications, see:
18 # http://blog.nodejs.org/2014/06/16/openssl-and-breaking-utf-8-change/
19 Patch6: %{name}-revert-utf8-v8.patch
20 Patch7: %{name}-revert-utf8-node.patch
21 URL: http://www.nodejs.org/
22 BuildRequires: c-ares-devel
23 BuildRequires: gcc >= 5:4.0
24 BuildRequires: http-parser-devel >= 2.0
25 BuildRequires: libstdc++-devel
26 BuildRequires: libuv-devel >= 0.10
27 BuildRequires: openssl-devel
28 BuildRequires: pkgconfig
29 BuildRequires: python >= 1:2.5.2
30 BuildRequires: python-jsmin
31 BuildRequires: rpm >= 4.4.9-56
32 BuildRequires: rpmbuild(macros) >= 1.219
33 BuildRequires: sed >= 4.0
34 BuildRequires: v8-devel >= 3.15.11.10
35 BuildRequires: zlib-devel
37 ExclusiveArch: %{ix86} %{x8664} arm
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 %define sover %(echo %{version} | cut -d. -f2)
43 Node.js is a platform built on Chrome's JavaScript runtime for easily
44 building fast, scalable network applications. Node.js uses an
45 event-driven, non-blocking I/O model that makes it lightweight and
46 efficient, perfect for data-intensive real-time applications that run
47 across distributed devices.
50 Summary: Development headers for nodejs
51 Group: Development/Libraries
52 Requires: %{name} = %{version}-%{release}
53 Requires: c-ares-devel
55 Requires: http-parser-devel
56 Requires: libstdc++-devel
58 Requires: openssl-devel
63 Development headers for nodejs.
66 Summary: Evented I/O for V8 JavaScript - documentation
70 Node.js is a server-side JavaScript environment that uses an
71 asynchronous event-driven model. Node's goal is to provide an easy way
72 to build scalable network programs.
74 This package contains the documentation for nodejs.
77 %setup -q -n node-v%{version}
79 %if %{_lib} == "lib64"
88 grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
93 # CC used only to detect if CC is clang, not used for compiling
96 GYP_DEFINES="soname_version=%{sover}" \
103 --shared-http-parser \
108 # add LFS defines from libuv (RHBZ#892601)
109 # CXXFLAGS must be exported, as it is needed for make, not gyp
110 CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
111 LDFLAGS="%{rpmldflags}" \
112 %{__make} -C out V=1 BUILDTYPE=Release
115 rm -rf $RPM_BUILD_ROOT
116 %{__make} justinstall \
117 DESTDIR=$RPM_BUILD_ROOT \
120 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
121 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
122 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
124 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
126 install -d $RPM_BUILD_ROOT%{_includedir}/node
127 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
129 # install for node-gyp
130 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
131 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
132 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
134 # for compat of fedora derivered scripts (shebangs)
135 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
137 # globally installed node modules (noarch)
138 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
140 # default searchpaths
141 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
144 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
145 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
148 libdir=${prefix}/%{_lib}
149 includedir=${prefix}/include/node
152 Description: Evented I/O for V8 JavaScript.
154 Cflags: -I${includedir}
157 # install documentation
158 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
159 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
160 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
161 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
164 rm -rf $RPM_BUILD_ROOT
166 %post -p /sbin/ldconfig
167 %postun -p /sbin/ldconfig
170 %defattr(644,root,root,755)
171 %doc README.md AUTHORS ChangeLog LICENSE
172 %attr(755,root,root) %{_bindir}/node
173 %attr(755,root,root) %{_bindir}/nodejs
174 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
175 %ghost %{_libdir}/libnode.so.10
176 %if "%{_lib}" != "lib"
179 %dir %{_prefix}/lib/node
180 %dir %{_prefix}/lib/node_modules
181 %{_mandir}/man1/node.1*
182 %{_mandir}/man1/nodejs.1
185 %defattr(644,root,root,755)
186 %{_libdir}/libnode.so
188 %{_pkgconfigdir}/nodejs.pc
192 %defattr(644,root,root,755)
193 %doc %{_docdir}/%{name}-doc-%{version}