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: fcf8e0f2981f9dd66606a2162a2df55d
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 BuildRequires: c-ares-devel >= 1.7.4
17 BuildRequires: gcc >= 5:4.0
18 BuildRequires: libeio-devel
19 BuildRequires: libev-devel >= 4.0.0
20 BuildRequires: libstdc++-devel
21 BuildRequires: python >= 1:2.5.2
22 BuildRequires: python-jsmin
23 BuildRequires: rpm >= 4.4.9-56
24 BuildRequires: rpmbuild(macros) >= 1.219
25 BuildRequires: v8-devel >= 3.6
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}
40 Requires: %{name}-waf = %{version}-%{release}
42 Requires: libstdc++-devel
46 Development headers for nodejs.
49 Summary: Evented I/O for V8 JavaScript - documentation
53 Node.js is a server-side JavaScript environment that uses an
54 asynchronous event-driven model. Node's goal is to provide an easy way
55 to build scalable network programs.
57 This package contains the documentation for nodejs.
60 Summary: Evented I/O for V8 JavaScript - customized WAF build system
62 Requires: %{name} = %{version}-%{release}
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 customized version of the WAF build system
70 used by Node.js and many of its modules.
73 %setup -q -n node-v%{version}
75 %if %{_lib} == "lib64"
82 # fix #!/usr/bin/env python -> #!/usr/bin/python:
83 grep -rl 'bin/env python' tools | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},'
86 CFLAGS="%{rpmcflags} -fPIC"
87 CPPFLAGS="%{rpmcppflags} -fPIC"
88 CXXFLAGS="%{rpmcxxflags} -fPIC"
89 LDFLAGS="%{rpmcflags}"
90 %if "%{pld_release}" == "ac"
97 export CFLAGS LDFLAGS CXXFLAGS CC CXX LINKFLAGS_UV
99 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
102 # NOT autoconf so dont use macro
103 export PYTHONPATH=tools
109 --libdir=%{_libdir} \
116 # relink with shared lib
117 $CC -o out/Release/node src/node_main.cc -Isrc -Ideps/uv/include -lnode -Lout/Release
120 rm -rf $RPM_BUILD_ROOT
122 DESTDIR=$RPM_BUILD_ROOT
124 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
126 # for compat of fedora derivered scripts (shebangs)
127 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
129 # globally installed node modules (noarch)
130 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
132 # default searchpaths
133 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
136 export PYTHONPATH=tools
137 %{__python} tools/waf-light install \
138 --product-type=cshlib \
139 --destdir=$RPM_BUILD_ROOT
141 chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so*
144 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
145 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
148 libdir=${prefix}/%{_lib}
149 includedir=${prefix}/include/node
152 Description: Evented I/O for V8 JavaScript.
154 Cflags: -I${includedir}
157 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
158 %py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
159 # TODO: check it first
160 #%%py_postclean %{_libdir}/node/wafadmin
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.6
182 %dir %{_prefix}/lib/node
183 %dir %{_prefix}/lib/node_modules
184 %{_mandir}/man1/node.1*
185 %{_mandir}/man1/nodejs.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]