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: libstdc++-devel
19 BuildRequires: libuv-devel >= %{version}
20 BuildRequires: openssl-devel
21 BuildRequires: pkgconfig
22 BuildRequires: python >= 1:2.5.2
23 BuildRequires: python-jsmin
24 BuildRequires: rpm >= 4.4.9-56
25 BuildRequires: rpmbuild(macros) >= 1.219
26 BuildRequires: v8-devel >= 3.15.11.10
27 BuildRequires: zlib-devel
30 ExclusiveArch: %{ix86} %{x8664} arm
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 Node.js is a platform built on Chrome's JavaScript runtime for easily
35 building fast, scalable network applications. Node.js uses an
36 event-driven, non-blocking I/O model that makes it lightweight and
37 efficient, perfect for data-intensive real-time applications that run
38 across distributed devices.
41 Summary: Development headers for nodejs
42 Group: Development/Libraries
43 Requires: %{name} = %{version}-%{release}
45 Requires: libstdc++-devel
49 Development headers for nodejs.
52 Summary: Evented I/O for V8 JavaScript - documentation
56 Node.js is a server-side JavaScript environment that uses an
57 asynchronous event-driven model. Node's goal is to provide an easy way
58 to build scalable network programs.
60 This package contains the documentation for nodejs.
63 %setup -q -n node-v%{version}
65 %if %{_lib} == "lib64"
73 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
76 # add defines from libuv (RHBZ#892601)
77 export CFLAGS="%{rpmcflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
78 export CXXFLAGS="%{rpmcppflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
80 # NOT autoconf so don't use macro
81 export PYTHONPATH=tools
95 CFLAGS.host="%{rpmcflags} -fPIC" \
96 CXXFLAGS.host="%{rpmcppflags} -fPIC" \
97 LDFLAGS.host="%{rpmcflags}" \
98 CFLAGS.target="%{rpmcflags} -fPIC" \
99 CXXFLAGS.target="%{rpmcppflags} -fPIC" \
100 LDFLAGS.target="%{rpmcflags}" \
102 CXX.host="%{__cxx}" \
103 CC.target="%{__cc}" \
104 CXX.target="%{__cxx}"
107 rm -rf $RPM_BUILD_ROOT
108 %{__make} justinstall \
109 DESTDIR=$RPM_BUILD_ROOT \
113 %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/lib/dtrace/node.d
115 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*)
116 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
117 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
119 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
121 install -d $RPM_BUILD_ROOT%{_includedir}/node
122 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
123 cp -p deps/uv/include/uv.h $RPM_BUILD_ROOT%{_includedir}/node
124 cp -a deps/uv/include/uv-private $RPM_BUILD_ROOT%{_includedir}/node
126 # install for node-gyp
127 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
128 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
129 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
131 # for compat of fedora derivered scripts (shebangs)
132 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
134 # globally installed node modules (noarch)
135 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
137 # default searchpaths
138 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
141 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
142 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
145 libdir=${prefix}/%{_lib}
146 includedir=${prefix}/include/node
149 Description: Evented I/O for V8 JavaScript.
151 Cflags: -I${includedir}
154 # install documentation
155 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
156 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
157 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
158 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
161 rm -rf $RPM_BUILD_ROOT
163 %post -p /sbin/ldconfig
164 %postun -p /sbin/ldconfig
167 %defattr(644,root,root,755)
168 %doc README.md AUTHORS ChangeLog LICENSE
169 %attr(755,root,root) %{_bindir}/node
170 %attr(755,root,root) %{_bindir}/nodejs
171 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
172 %ghost %{_libdir}/libnode.so.10
173 %if "%{_lib}" != "lib"
176 %dir %{_prefix}/lib/node
177 %dir %{_prefix}/lib/node_modules
178 %{_mandir}/man1/node.1*
179 %{_mandir}/man1/nodejs.1
182 %defattr(644,root,root,755)
183 %{_libdir}/libnode.so
185 %{_pkgconfigdir}/nodejs.pc
189 %defattr(644,root,root,755)
190 %doc %{_docdir}/%{name}-doc-%{version}