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: python >= 1:2.5.2
20 BuildRequires: python-jsmin
21 BuildRequires: rpm >= 4.4.9-56
22 BuildRequires: rpmbuild(macros) >= 1.219
23 BuildRequires: v8-devel >= 3.15.11.10
26 ExclusiveArch: %{ix86} %{x8664} arm
27 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 Node.js is a platform built on Chrome's JavaScript runtime for easily
31 building fast, scalable network applications. Node.js uses an
32 event-driven, non-blocking I/O model that makes it lightweight and
33 efficient, perfect for data-intensive real-time applications that run
34 across distributed devices.
37 Summary: Development headers for nodejs
38 Group: Development/Libraries
39 Requires: %{name} = %{version}-%{release}
41 Requires: libstdc++-devel
45 Development headers for nodejs.
48 Summary: Evented I/O for V8 JavaScript - documentation
52 Node.js is a server-side JavaScript environment that uses an
53 asynchronous event-driven model. Node's goal is to provide an easy way
54 to build scalable network programs.
56 This package contains the documentation for nodejs.
59 %setup -q -n node-v%{version}
61 %if %{_lib} == "lib64"
69 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
72 # NOT autoconf so dont use macro
73 export PYTHONPATH=tools
86 CFLAGS.host="%{rpmcflags} -fPIC" \
87 CXXFLAGS.host="%{rpmcppflags} -fPIC" \
88 LDFLAGS.host="%{rpmcflags}" \
89 CFLAGS.target="%{rpmcflags} -fPIC" \
90 CXXFLAGS.target="%{rpmcppflags} -fPIC" \
91 LDFLAGS.target="%{rpmcflags}" \
98 rm -rf $RPM_BUILD_ROOT
99 %{__make} justinstall \
100 DESTDIR=$RPM_BUILD_ROOT \
104 %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/lib/dtrace/node.d
106 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*)
107 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
108 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
110 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
112 install -d $RPM_BUILD_ROOT%{_includedir}/node
113 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
114 cp -p deps/uv/include/uv.h $RPM_BUILD_ROOT%{_includedir}/node
115 cp -a deps/uv/include/uv-private $RPM_BUILD_ROOT%{_includedir}/node
117 # install for node-gyp
118 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
119 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
120 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
122 # for compat of fedora derivered scripts (shebangs)
123 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
125 # globally installed node modules (noarch)
126 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
128 # default searchpaths
129 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
132 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
133 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
136 libdir=${prefix}/%{_lib}
137 includedir=${prefix}/include/node
140 Description: Evented I/O for V8 JavaScript.
142 Cflags: -I${includedir}
145 # install documentation
146 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
147 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
148 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
149 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
152 rm -rf $RPM_BUILD_ROOT
154 %post -p /sbin/ldconfig
155 %postun -p /sbin/ldconfig
158 %defattr(644,root,root,755)
159 %doc README.md AUTHORS ChangeLog LICENSE
160 %attr(755,root,root) %{_bindir}/node
161 %attr(755,root,root) %{_bindir}/nodejs
162 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
163 %ghost %{_libdir}/libnode.so.10
164 %if "%{_lib}" != "lib"
167 %dir %{_prefix}/lib/node
168 %dir %{_prefix}/lib/node_modules
169 %{_mandir}/man1/node.1*
170 %{_mandir}/man1/nodejs.1
173 %defattr(644,root,root,755)
174 %{_libdir}/libnode.so
176 %{_pkgconfigdir}/nodejs.pc
180 %defattr(644,root,root,755)
181 %doc %{_docdir}/%{name}-doc-%{version}