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: sed >= 4.0
28 BuildRequires: v8-devel >= 3.15.11.10
29 BuildRequires: zlib-devel
32 ExclusiveArch: %{ix86} %{x8664} arm
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 Node.js is a platform built on Chrome's JavaScript runtime for easily
37 building fast, scalable network applications. Node.js uses an
38 event-driven, non-blocking I/O model that makes it lightweight and
39 efficient, perfect for data-intensive real-time applications that run
40 across distributed devices.
43 Summary: Development headers for nodejs
44 Group: Development/Libraries
45 Requires: %{name} = %{version}-%{release}
46 Requires: c-ares-devel
48 Requires: http-parser-devel
49 Requires: libstdc++-devel
51 Requires: openssl-devel
56 Development headers for nodejs.
59 Summary: Evented I/O for V8 JavaScript - documentation
63 Node.js is a server-side JavaScript environment that uses an
64 asynchronous event-driven model. Node's goal is to provide an easy way
65 to build scalable network programs.
67 This package contains the documentation for nodejs.
70 %setup -q -n node-v%{version}
72 %if %{_lib} == "lib64"
79 grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
82 # add defines from libuv (RHBZ#892601)
83 export CFLAGS="%{rpmcflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
84 export CXXFLAGS="%{rpmcppflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
86 # NOT autoconf so don't use macro
94 --shared-http-parser \
102 CFLAGS.host="%{rpmcflags} -fPIC" \
103 CXXFLAGS.host="%{rpmcppflags} -fPIC" \
104 LDFLAGS.host="%{rpmcflags}" \
105 CFLAGS.target="%{rpmcflags} -fPIC" \
106 CXXFLAGS.target="%{rpmcppflags} -fPIC" \
107 LDFLAGS.target="%{rpmcflags}" \
109 CXX.host="%{__cxx}" \
110 CC.target="%{__cc}" \
111 CXX.target="%{__cxx}"
114 rm -rf $RPM_BUILD_ROOT
115 %{__make} justinstall \
116 DESTDIR=$RPM_BUILD_ROOT \
120 %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/lib/dtrace/node.d
122 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
123 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
124 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
126 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
128 install -d $RPM_BUILD_ROOT%{_includedir}/node
129 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
131 # install for node-gyp
132 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
133 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
134 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
136 # for compat of fedora derivered scripts (shebangs)
137 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
139 # globally installed node modules (noarch)
140 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
142 # default searchpaths
143 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
146 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
147 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
150 libdir=${prefix}/%{_lib}
151 includedir=${prefix}/include/node
154 Description: Evented I/O for V8 JavaScript.
156 Cflags: -I${includedir}
159 # install documentation
160 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
161 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
162 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
163 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
166 rm -rf $RPM_BUILD_ROOT
168 %post -p /sbin/ldconfig
169 %postun -p /sbin/ldconfig
172 %defattr(644,root,root,755)
173 %doc README.md AUTHORS ChangeLog LICENSE
174 %attr(755,root,root) %{_bindir}/node
175 %attr(755,root,root) %{_bindir}/nodejs
176 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
177 %ghost %{_libdir}/libnode.so.10
178 %if "%{_lib}" != "lib"
181 %dir %{_prefix}/lib/node
182 %dir %{_prefix}/lib/node_modules
183 %{_mandir}/man1/node.1*
184 %{_mandir}/man1/nodejs.1
187 %defattr(644,root,root,755)
188 %{_libdir}/libnode.so
190 %{_pkgconfigdir}/nodejs.pc
194 %defattr(644,root,root,755)
195 %doc %{_docdir}/%{name}-doc-%{version}