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: 4daca92618515708a4631e98a8e8c779
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 URL: http://www.nodejs.org/
16 BuildRequires: c-ares-devel
17 BuildRequires: gcc >= 5:4.0
18 BuildRequires: http-parser-devel >= 2.0
19 BuildRequires: libstdc++-devel
20 BuildRequires: libuv-devel >= %{version}
21 BuildRequires: openssl-devel
22 BuildRequires: pkgconfig
23 BuildRequires: python >= 1:2.5.2
24 BuildRequires: python-jsmin
25 BuildRequires: rpm >= 4.4.9-56
26 BuildRequires: rpmbuild(macros) >= 1.219
27 BuildRequires: v8-devel >= 3.15.11.10
28 BuildRequires: zlib-devel
31 ExclusiveArch: %{ix86} %{x8664} arm
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 Node.js is a platform built on Chrome's JavaScript runtime for easily
36 building fast, scalable network applications. Node.js uses an
37 event-driven, non-blocking I/O model that makes it lightweight and
38 efficient, perfect for data-intensive real-time applications that run
39 across distributed devices.
42 Summary: Development headers for nodejs
43 Group: Development/Libraries
44 Requires: %{name} = %{version}-%{release}
46 Requires: libstdc++-devel
50 Development headers for nodejs.
53 Summary: Evented I/O for V8 JavaScript - documentation
57 Node.js is a server-side JavaScript environment that uses an
58 asynchronous event-driven model. Node's goal is to provide an easy way
59 to build scalable network programs.
61 This package contains the documentation for nodejs.
64 %setup -q -n node-v%{version}
66 %if %{_lib} == "lib64"
74 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
77 # add defines from libuv (RHBZ#892601)
78 export CFLAGS="%{rpmcflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
79 export CXXFLAGS="%{rpmcppflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
81 # NOT autoconf so don't use macro
82 export PYTHONPATH=tools
89 --shared-http-parser \
97 CFLAGS.host="%{rpmcflags} -fPIC" \
98 CXXFLAGS.host="%{rpmcppflags} -fPIC" \
99 LDFLAGS.host="%{rpmcflags}" \
100 CFLAGS.target="%{rpmcflags} -fPIC" \
101 CXXFLAGS.target="%{rpmcppflags} -fPIC" \
102 LDFLAGS.target="%{rpmcflags}" \
104 CXX.host="%{__cxx}" \
105 CC.target="%{__cc}" \
106 CXX.target="%{__cxx}"
109 rm -rf $RPM_BUILD_ROOT
110 %{__make} justinstall \
111 DESTDIR=$RPM_BUILD_ROOT \
115 %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/lib/dtrace/node.d
117 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*)
118 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
119 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
121 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
123 install -d $RPM_BUILD_ROOT%{_includedir}/node
124 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
125 cp -p deps/uv/include/uv.h $RPM_BUILD_ROOT%{_includedir}/node
126 cp -a deps/uv/include/uv-private $RPM_BUILD_ROOT%{_includedir}/node
128 # install for node-gyp
129 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
130 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
131 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
133 # for compat of fedora derivered scripts (shebangs)
134 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
136 # globally installed node modules (noarch)
137 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
139 # default searchpaths
140 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
143 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
144 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
147 libdir=${prefix}/%{_lib}
148 includedir=${prefix}/include/node
151 Description: Evented I/O for V8 JavaScript.
153 Cflags: -I${includedir}
156 # install documentation
157 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
158 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
159 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
160 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
163 rm -rf $RPM_BUILD_ROOT
165 %post -p /sbin/ldconfig
166 %postun -p /sbin/ldconfig
169 %defattr(644,root,root,755)
170 %doc README.md AUTHORS ChangeLog LICENSE
171 %attr(755,root,root) %{_bindir}/node
172 %attr(755,root,root) %{_bindir}/nodejs
173 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
174 %ghost %{_libdir}/libnode.so.10
175 %if "%{_lib}" != "lib"
178 %dir %{_prefix}/lib/node
179 %dir %{_prefix}/lib/node_modules
180 %{_mandir}/man1/node.1*
181 %{_mandir}/man1/nodejs.1
184 %defattr(644,root,root,755)
185 %{_libdir}/libnode.so
187 %{_pkgconfigdir}/nodejs.pc
191 %defattr(644,root,root,755)
192 %doc %{_docdir}/%{name}-doc-%{version}