1 Summary: Asynchronous JavaScript Engine
5 License: BSD and MIT and ASL 2.0 and GPLv3
6 Group: Development/Languages
7 URL: http://www.nodejs.org/
8 Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
9 # Source0-md5: f5669a9717422b811c6bad1cc961b1e5
10 Patch1: %{name}-soname.patch
11 # force node to use /usr/lib/node as the systemwide module directory
12 Patch2: %{name}-libpath.patch
13 # use /usr/lib64/node as an arch-specific module dir when appropriate
14 Patch3: %{name}-lib64path.patch
16 Patch4: %{name}-shared-zlib.patch
18 BuildRequires: c-ares-devel >= 1.7.4
19 BuildRequires: gcc >= 5:4.0
20 BuildRequires: libeio-devel
21 BuildRequires: libev-devel >= 4.0.0
22 BuildRequires: libstdc++-devel
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: v8-devel >= 3.6
28 ExclusiveArch: %{ix86} %{x8664} arm
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 Node.js is a platform built on Chrome's JavaScript runtime for easily
33 building fast, scalable network applications. Node.js uses an
34 event-driven, non-blocking I/O model that makes it lightweight and
35 efficient, perfect for data-intensive real-time applications that run
36 across distributed devices.
39 Summary: Development headers for nodejs
40 Group: Development/Libraries
41 Requires: %{name} = %{version}-%{release}
42 Requires: %{name}-waf = %{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 Summary: Evented I/O for V8 JavaScript - customized WAF build system
64 Requires: %{name} = %{version}-%{release}
67 Node.js is a server-side JavaScript environment that uses an
68 asynchronous event-driven model. Node's goal is to provide an easy way
69 to build scalable network programs.
71 This package contains the customized version of the WAF build system
72 used by Node.js and many of its modules.
75 %setup -q -n node-v%{version}
77 %if %{_lib} == "lib64"
85 # fix #!/usr/bin/env python -> #!/usr/bin/python:
86 grep -rl 'bin/env python' tools | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},'
89 CFLAGS="%{rpmcflags} -fPIC"
90 CPPFLAGS="%{rpmcppflags} -fPIC"
91 CXXFLAGS="%{rpmcxxflags} -fPIC"
92 LDFLAGS="%{rpmcflags}"
93 %if "%{pld_release}" == "ac"
100 export CFLAGS LDFLAGS CXXFLAGS CC CXX LINKFLAGS_UV
102 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
105 # NOT autoconf so dont use macro
106 export PYTHONPATH=tools
112 --libdir=%{_libdir} \
119 # relink with shared lib
120 $CC -o out/Release/node src/node_main.cc -Isrc -Ideps/uv/include -lnode -Lout/Release
123 rm -rf $RPM_BUILD_ROOT
125 DESTDIR=$RPM_BUILD_ROOT
127 # for compat of fedora derivered scripts (shebangs)
128 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
130 # globally installed node modules (noarch)
131 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
133 # default searchpaths
134 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
137 export PYTHONPATH=tools
138 %{__python} tools/waf-light install \
139 --product-type=cshlib \
140 --destdir=$RPM_BUILD_ROOT
142 chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so*
145 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
146 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
149 libdir=${prefix}/%{_lib}
150 includedir=${prefix}/include/node
153 Description: Evented I/O for V8 JavaScript.
155 Cflags: -I${includedir}
158 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
159 %py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
160 # TODO: check it first
161 #%%py_postclean %{_libdir}/node/wafadmin
163 # install documentation
164 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
165 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
166 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
167 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
170 rm -rf $RPM_BUILD_ROOT
172 %post -p /sbin/ldconfig
173 %postun -p /sbin/ldconfig
176 %defattr(644,root,root,755)
177 %doc README.md AUTHORS ChangeLog LICENSE
178 %attr(755,root,root) %{_bindir}/node
179 %attr(755,root,root) %{_bindir}/nodejs
180 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
181 %ghost %{_libdir}/libnode.so.6
183 %dir %{_prefix}/lib/node
184 %dir %{_prefix}/lib/node_modules
185 %{_mandir}/man1/node.1*
188 %defattr(644,root,root,755)
189 %{_libdir}/libnode.so
191 %{_pkgconfigdir}/nodejs.pc
194 %defattr(644,root,root,755)
195 %doc %{_docdir}/%{name}-doc-%{version}
198 %defattr(644,root,root,755)
199 %attr(755,root,root) %{_bindir}/node-waf
200 %dir %{_libdir}/node/wafadmin
201 %dir %{_libdir}/node/wafadmin/Tools
202 %{_libdir}/node/wafadmin/*.py[co]
203 %{_libdir}/node/wafadmin/*.py
204 %{_libdir}/node/wafadmin/Tools/*.py
205 %{_libdir}/node/wafadmin/Tools/*.py[co]