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)
35 %define sover %(echo %{version} | cut -d. -f2)
38 Node.js is a platform built on Chrome's JavaScript runtime for easily
39 building fast, scalable network applications. Node.js uses an
40 event-driven, non-blocking I/O model that makes it lightweight and
41 efficient, perfect for data-intensive real-time applications that run
42 across distributed devices.
45 Summary: Development headers for nodejs
46 Group: Development/Libraries
47 Requires: %{name} = %{version}-%{release}
48 Requires: c-ares-devel
50 Requires: http-parser-devel
51 Requires: libstdc++-devel
53 Requires: openssl-devel
58 Development headers for nodejs.
61 Summary: Evented I/O for V8 JavaScript - documentation
65 Node.js is a server-side JavaScript environment that uses an
66 asynchronous event-driven model. Node's goal is to provide an easy way
67 to build scalable network programs.
69 This package contains the documentation for nodejs.
72 %setup -q -n node-v%{version}
74 %if %{_lib} == "lib64"
81 grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
84 # add defines from libuv (RHBZ#892601)
85 export CFLAGS="%{rpmcflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
86 export CXXFLAGS="%{rpmcppflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
88 # NOT autoconf so don't use macro
90 GYP_DEFINES="soname_version=%{sover}" \
97 --shared-http-parser \
105 CFLAGS.host="%{rpmcflags} -fPIC" \
106 CXXFLAGS.host="%{rpmcppflags} -fPIC" \
107 LDFLAGS.host="%{rpmcflags}" \
108 CFLAGS.target="%{rpmcflags} -fPIC" \
109 CXXFLAGS.target="%{rpmcppflags} -fPIC" \
110 LDFLAGS.target="%{rpmcflags}" \
112 CXX.host="%{__cxx}" \
113 CC.target="%{__cc}" \
114 CXX.target="%{__cxx}"
117 rm -rf $RPM_BUILD_ROOT
118 %{__make} justinstall \
119 DESTDIR=$RPM_BUILD_ROOT \
123 %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/lib/dtrace/node.d
125 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
126 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
127 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
129 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
131 install -d $RPM_BUILD_ROOT%{_includedir}/node
132 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
134 # install for node-gyp
135 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
136 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
137 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
139 # for compat of fedora derivered scripts (shebangs)
140 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
142 # globally installed node modules (noarch)
143 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
145 # default searchpaths
146 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
149 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
150 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
153 libdir=${prefix}/%{_lib}
154 includedir=${prefix}/include/node
157 Description: Evented I/O for V8 JavaScript.
159 Cflags: -I${includedir}
162 # install documentation
163 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
164 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
165 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
166 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
169 rm -rf $RPM_BUILD_ROOT
171 %post -p /sbin/ldconfig
172 %postun -p /sbin/ldconfig
175 %defattr(644,root,root,755)
176 %doc README.md AUTHORS ChangeLog LICENSE
177 %attr(755,root,root) %{_bindir}/node
178 %attr(755,root,root) %{_bindir}/nodejs
179 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
180 %ghost %{_libdir}/libnode.so.10
181 %if "%{_lib}" != "lib"
184 %dir %{_prefix}/lib/node
185 %dir %{_prefix}/lib/node_modules
186 %{_mandir}/man1/node.1*
187 %{_mandir}/man1/nodejs.1
190 %defattr(644,root,root,755)
191 %{_libdir}/libnode.so
193 %{_pkgconfigdir}/nodejs.pc
197 %defattr(644,root,root,755)
198 %doc %{_docdir}/%{name}-doc-%{version}