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 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
129 # for compat of fedora derivered scripts (shebangs)
130 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
132 # globally installed node modules (noarch)
133 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
135 # default searchpaths
136 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
139 export PYTHONPATH=tools
140 %{__python} tools/waf-light install \
141 --product-type=cshlib \
142 --destdir=$RPM_BUILD_ROOT
144 chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so*
147 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
148 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
151 libdir=${prefix}/%{_lib}
152 includedir=${prefix}/include/node
155 Description: Evented I/O for V8 JavaScript.
157 Cflags: -I${includedir}
160 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
161 %py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
162 # TODO: check it first
163 #%%py_postclean %{_libdir}/node/wafadmin
165 # install documentation
166 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
167 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
168 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
169 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
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*
188 %{_mandir}/man1/nodejs.1
191 %defattr(644,root,root,755)
192 %{_libdir}/libnode.so
194 %{_pkgconfigdir}/nodejs.pc
197 %defattr(644,root,root,755)
198 %doc %{_docdir}/%{name}-doc-%{version}
201 %defattr(644,root,root,755)
202 %attr(755,root,root) %{_bindir}/node-waf
203 %dir %{_libdir}/node/wafadmin
204 %dir %{_libdir}/node/wafadmin/Tools
205 %{_libdir}/node/wafadmin/*.py[co]
206 %{_libdir}/node/wafadmin/*.py
207 %{_libdir}/node/wafadmin/Tools/*.py
208 %{_libdir}/node/wafadmin/Tools/*.py[co]