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: openssl-devel
20 BuildRequires: pkgconfig
21 BuildRequires: python >= 1:2.5.2
22 BuildRequires: python-jsmin
23 BuildRequires: rpm >= 4.4.9-56
24 BuildRequires: rpmbuild(macros) >= 1.219
25 BuildRequires: v8-devel >= 3.15.11.10
26 BuildRequires: zlib-devel
29 ExclusiveArch: %{ix86} %{x8664} arm
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 Node.js is a platform built on Chrome's JavaScript runtime for easily
34 building fast, scalable network applications. Node.js uses an
35 event-driven, non-blocking I/O model that makes it lightweight and
36 efficient, perfect for data-intensive real-time applications that run
37 across distributed devices.
40 Summary: Development headers for nodejs
41 Group: Development/Libraries
42 Requires: %{name} = %{version}-%{release}
44 Requires: libstdc++-devel
48 Development headers for nodejs.
51 Summary: Evented I/O for V8 JavaScript - documentation
55 Node.js is a server-side JavaScript environment that uses an
56 asynchronous event-driven model. Node's goal is to provide an easy way
57 to build scalable network programs.
59 This package contains the documentation for nodejs.
62 %setup -q -n node-v%{version}
64 %if %{_lib} == "lib64"
72 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
75 # NOT autoconf so dont use macro
76 export PYTHONPATH=tools
89 CFLAGS.host="%{rpmcflags} -fPIC" \
90 CXXFLAGS.host="%{rpmcppflags} -fPIC" \
91 LDFLAGS.host="%{rpmcflags}" \
92 CFLAGS.target="%{rpmcflags} -fPIC" \
93 CXXFLAGS.target="%{rpmcppflags} -fPIC" \
94 LDFLAGS.target="%{rpmcflags}" \
101 rm -rf $RPM_BUILD_ROOT
102 %{__make} justinstall \
103 DESTDIR=$RPM_BUILD_ROOT \
107 %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/lib/dtrace/node.d
109 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*)
110 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
111 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
113 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
115 install -d $RPM_BUILD_ROOT%{_includedir}/node
116 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
117 cp -p deps/uv/include/uv.h $RPM_BUILD_ROOT%{_includedir}/node
118 cp -a deps/uv/include/uv-private $RPM_BUILD_ROOT%{_includedir}/node
120 # install for node-gyp
121 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
122 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
123 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
125 # for compat of fedora derivered scripts (shebangs)
126 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
128 # globally installed node modules (noarch)
129 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
131 # default searchpaths
132 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
135 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
136 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
139 libdir=${prefix}/%{_lib}
140 includedir=${prefix}/include/node
143 Description: Evented I/O for V8 JavaScript.
145 Cflags: -I${includedir}
148 # install documentation
149 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
150 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
151 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
152 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
155 rm -rf $RPM_BUILD_ROOT
157 %post -p /sbin/ldconfig
158 %postun -p /sbin/ldconfig
161 %defattr(644,root,root,755)
162 %doc README.md AUTHORS ChangeLog LICENSE
163 %attr(755,root,root) %{_bindir}/node
164 %attr(755,root,root) %{_bindir}/nodejs
165 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
166 %ghost %{_libdir}/libnode.so.10
167 %if "%{_lib}" != "lib"
170 %dir %{_prefix}/lib/node
171 %dir %{_prefix}/lib/node_modules
172 %{_mandir}/man1/node.1*
173 %{_mandir}/man1/nodejs.1
176 %defattr(644,root,root,755)
177 %{_libdir}/libnode.so
179 %{_pkgconfigdir}/nodejs.pc
183 %defattr(644,root,root,755)
184 %doc %{_docdir}/%{name}-doc-%{version}