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: 87078586e226fd7a4db60d38bea9aad6
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
15 BuildRequires: c-ares-devel >= 1.7.4
16 BuildRequires: gcc >= 5:4.0
17 BuildRequires: libeio-devel
18 BuildRequires: libev-devel >= 4.0.0
19 BuildRequires: libstdc++-devel
20 BuildRequires: python >= 1:2.5.2
21 BuildRequires: python-jsmin
22 BuildRequires: rpm >= 4.4.9-56
23 BuildRequires: rpmbuild(macros) >= 1.219
24 BuildRequires: v8-devel >= 3.6
25 ExclusiveArch: %{ix86} %{x8664} arm
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 Node.js is a platform built on Chrome's JavaScript runtime for easily
30 building fast, scalable network applications. Node.js uses an
31 event-driven, non-blocking I/O model that makes it lightweight and
32 efficient, perfect for data-intensive real-time applications that run
33 across distributed devices.
36 Summary: Development headers for nodejs
37 Group: Development/Libraries
38 Requires: %{name} = %{version}-%{release}
39 Requires: %{name}-waf = %{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 Summary: Evented I/O for V8 JavaScript - customized WAF build system
61 Requires: %{name} = %{version}-%{release}
64 Node.js is a server-side JavaScript environment that uses an
65 asynchronous event-driven model. Node's goal is to provide an easy way
66 to build scalable network programs.
68 This package contains the customized version of the WAF build system
69 used by Node.js and many of its modules.
72 %setup -q -n node-v%{version}
74 %if %{_lib} == "lib64"
80 # fix #!/usr/bin/env python -> #!/usr/bin/python:
81 grep -rl 'bin/env python' tools | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},'
84 CFLAGS="%{rpmcflags} -fPIC"
85 CXXFLAGS="%{rpmcxxflags} -fPIC"
86 LDFLAGS="%{rpmcflags}"
87 %if "%{pld_release}" == "ac"
94 export CFLAGS LDFLAGS CXXFLAGS CC CXX
96 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
99 # NOT autoconf so dont use macro
100 export PYTHONPATH=tools
106 --libdir=%{_libdir} \
113 # relink with shared lib
114 $CC -o out/Release/node src/node_main.cc -Isrc -Ideps/uv/include -lnode -Lout/Release
117 rm -rf $RPM_BUILD_ROOT
119 DESTDIR=$RPM_BUILD_ROOT
121 # for compat of fedora derivered scripts (shebangs)
122 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
124 # globally installed node modules (noarch)
125 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
127 # default searchpaths
128 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
131 export PYTHONPATH=tools
132 %{__python} tools/waf-light install \
133 --product-type=cshlib \
134 --destdir=$RPM_BUILD_ROOT
136 chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so*
139 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
140 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
143 libdir=${prefix}/%{_lib}
144 includedir=${prefix}/include/node
147 Description: Evented I/O for V8 JavaScript.
149 Cflags: -I${includedir}
152 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
153 %py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
154 # TODO: check it first
155 #%%py_postclean %{_libdir}/node/wafadmin
157 # install documentation
158 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
159 cp -a doc/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
160 cd $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
162 mv html/api/*.markdown api
163 mv html/api/api/* html/api
168 rm -rf $RPM_BUILD_ROOT
170 %post -p /sbin/ldconfig
171 %postun -p /sbin/ldconfig
174 %defattr(644,root,root,755)
175 %doc README.md AUTHORS ChangeLog LICENSE
176 %attr(755,root,root) %{_bindir}/node
177 %attr(755,root,root) %{_bindir}/nodejs
178 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
179 %ghost %{_libdir}/libnode.so.6
181 %dir %{_prefix}/lib/node
182 %dir %{_prefix}/lib/node_modules
183 %{_mandir}/man1/node.1*
186 %defattr(644,root,root,755)
187 %{_libdir}/libnode.so
189 %{_pkgconfigdir}/nodejs.pc
192 %defattr(644,root,root,755)
193 %doc %{_docdir}/%{name}-doc-%{version}
196 %defattr(644,root,root,755)
197 %attr(755,root,root) %{_bindir}/node-waf
198 %dir %{_libdir}/node/wafadmin
199 %dir %{_libdir}/node/wafadmin/Tools
200 %{_libdir}/node/wafadmin/*.py[co]
201 %{_libdir}/node/wafadmin/*.py
202 %{_libdir}/node/wafadmin/Tools/*.py
203 %{_libdir}/node/wafadmin/Tools/*.py[co]