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: 852cfb1ed8125a4cdba456446d869d19
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
17 BuildRequires: c-ares-devel >= 1.7.4
18 BuildRequires: gcc >= 5:4.0
19 BuildRequires: libeio-devel
20 BuildRequires: libev-devel >= 4.0.0
21 BuildRequires: libstdc++-devel
22 BuildRequires: python >= 1:2.5.2
23 BuildRequires: python-jsmin
24 BuildRequires: rpm >= 4.4.9-56
25 BuildRequires: rpmbuild(macros) >= 1.219
26 BuildRequires: v8-devel >= 3.6
27 ExclusiveArch: %{ix86} %{x8664} arm
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 Node.js is a platform built on Chrome's JavaScript runtime for easily
32 building fast, scalable network applications. Node.js uses an
33 event-driven, non-blocking I/O model that makes it lightweight and
34 efficient, perfect for data-intensive real-time applications that run
35 across distributed devices.
38 Summary: Development headers for nodejs
39 Group: Development/Libraries
40 Requires: %{name} = %{version}-%{release}
41 Requires: %{name}-waf = %{version}-%{release}
43 Requires: libstdc++-devel
47 Development headers for nodejs.
50 Summary: Evented I/O for V8 JavaScript - documentation
54 Node.js is a server-side JavaScript environment that uses an
55 asynchronous event-driven model. Node's goal is to provide an easy way
56 to build scalable network programs.
58 This package contains the documentation for nodejs.
61 Summary: Evented I/O for V8 JavaScript - customized WAF build system
63 Requires: %{name} = %{version}-%{release}
66 Node.js is a server-side JavaScript environment that uses an
67 asynchronous event-driven model. Node's goal is to provide an easy way
68 to build scalable network programs.
70 This package contains the customized version of the WAF build system
71 used by Node.js and many of its modules.
74 %setup -q -n node-v%{version}
76 %if %{_lib} == "lib64"
84 # fix #!/usr/bin/env python -> #!/usr/bin/python:
85 grep -rl 'bin/env python' tools | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},'
88 CFLAGS="%{rpmcflags} -fPIC"
89 CXXFLAGS="%{rpmcxxflags} -fPIC"
90 LDFLAGS="%{rpmcflags}"
91 %if "%{pld_release}" == "ac"
98 export CFLAGS LDFLAGS CXXFLAGS CC CXX
100 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
103 # NOT autoconf so dont use macro
104 export PYTHONPATH=tools
110 --libdir=%{_libdir} \
117 # relink with shared lib
118 $CC -o out/Release/node src/node_main.cc -Isrc -Ideps/uv/include -lnode -Lout/Release
121 rm -rf $RPM_BUILD_ROOT
123 DESTDIR=$RPM_BUILD_ROOT
125 # for compat of fedora derivered scripts (shebangs)
126 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
128 # globally installed node modules (noarch)
129 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
131 # default searchpaths
132 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
135 export PYTHONPATH=tools
136 %{__python} tools/waf-light install \
137 --product-type=cshlib \
138 --destdir=$RPM_BUILD_ROOT
140 chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so*
143 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
144 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
147 libdir=${prefix}/%{_lib}
148 includedir=${prefix}/include/node
151 Description: Evented I/O for V8 JavaScript.
153 Cflags: -I${includedir}
156 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
157 %py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
158 # TODO: check it first
159 #%%py_postclean %{_libdir}/node/wafadmin
161 # install documentation
162 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
163 cp -a doc/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
164 cd $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
166 mv html/api/*.markdown api
167 mv html/api/api/* html/api
172 rm -rf $RPM_BUILD_ROOT
174 %post -p /sbin/ldconfig
175 %postun -p /sbin/ldconfig
178 %defattr(644,root,root,755)
179 %doc README.md AUTHORS ChangeLog LICENSE
180 %attr(755,root,root) %{_bindir}/node
181 %attr(755,root,root) %{_bindir}/nodejs
182 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
183 %ghost %{_libdir}/libnode.so.6
185 %dir %{_prefix}/lib/node
186 %dir %{_prefix}/lib/node_modules
187 %{_mandir}/man1/node.1*
190 %defattr(644,root,root,755)
191 %{_libdir}/libnode.so
193 %{_pkgconfigdir}/nodejs.pc
196 %defattr(644,root,root,755)
197 %doc %{_docdir}/%{name}-doc-%{version}
200 %defattr(644,root,root,755)
201 %attr(755,root,root) %{_bindir}/node-waf
202 %dir %{_libdir}/node/wafadmin
203 %dir %{_libdir}/node/wafadmin/Tools
204 %{_libdir}/node/wafadmin/*.py[co]
205 %{_libdir}/node/wafadmin/*.py
206 %{_libdir}/node/wafadmin/Tools/*.py
207 %{_libdir}/node/wafadmin/Tools/*.py[co]