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: 6cb31180b07475db103e694f65e8bb9b
10 Patch1: %{name}-shared.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: gcc >= 5:4.0
17 BuildRequires: libstdc++-devel
18 BuildRequires: python >= 1:2.5.2
19 BuildRequires: python-jsmin
20 BuildRequires: rpm >= 4.4.9-56
21 BuildRequires: rpmbuild(macros) >= 1.219
22 BuildRequires: v8-devel >= 3.11.10.25
24 ExclusiveArch: %{ix86} %{x8664} arm
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28 Node.js is a platform built on Chrome's JavaScript runtime for easily
29 building fast, scalable network applications. Node.js uses an
30 event-driven, non-blocking I/O model that makes it lightweight and
31 efficient, perfect for data-intensive real-time applications that run
32 across distributed devices.
35 Summary: Development headers for nodejs
36 Group: Development/Libraries
37 Requires: %{name} = %{version}-%{release}
38 Requires: %{name}-waf = %{version}-%{release}
40 Requires: libstdc++-devel
44 Development headers for nodejs.
47 Summary: Evented I/O for V8 JavaScript - documentation
51 Node.js is a server-side JavaScript environment that uses an
52 asynchronous event-driven model. Node's goal is to provide an easy way
53 to build scalable network programs.
55 This package contains the documentation for nodejs.
58 Summary: Evented I/O for V8 JavaScript - customized WAF build system
60 Requires: %{name} = %{version}-%{release}
63 Node.js is a server-side JavaScript environment that uses an
64 asynchronous event-driven model. Node's goal is to provide an easy way
65 to build scalable network programs.
67 This package contains the customized version of the WAF build system
68 used by Node.js and many of its modules.
71 %setup -q -n node-v%{version}
73 %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},'
85 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
88 # NOT autoconf so dont use macro
89 export PYTHONPATH=tools
100 CFLAGS.host="%{rpmcflags} -fPIC" \
101 CXXFLAGS.host="%{rpmcppflags} -fPIC" \
102 LDFLAGS.host="%{rpmcflags}" \
103 CFLAGS.target="%{rpmcflags} -fPIC" \
104 CXXFLAGS.target="%{rpmcppflags} -fPIC" \
105 LDFLAGS.target="%{rpmcflags}" \
106 %if "%{pld_release}" == "ac"
108 CXX.host="%{__cxx}4" \
109 CC.target="%{__cc}4" \
110 CXX.target="%{__cxx}4" \
113 CXX.host="%{__cxx}" \
114 CC.target="%{__cc}" \
115 CXX.target="%{__cxx}"
119 rm -rf $RPM_BUILD_ROOT
120 install -d $RPM_BUILD_ROOT/%{_prefix}/lib/node/wafadmin
121 %{__make} justinstall \
122 DESTDIR=$RPM_BUILD_ROOT \
125 ln -s libnode.so.8.0.0 $RPM_BUILD_ROOT%{_libdir}/libnode.so.8
126 ln -s libnode.so.8.0.0 $RPM_BUILD_ROOT%{_libdir}/libnode.so
128 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
130 # for compat of fedora derivered scripts (shebangs)
131 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
133 # globally installed node modules (noarch)
134 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
136 # default searchpaths
137 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
140 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
141 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
144 libdir=${prefix}/%{_lib}
145 includedir=${prefix}/include/node
148 Description: Evented I/O for V8 JavaScript.
150 Cflags: -I${includedir}
153 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
154 %py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
155 # TODO: check it first
156 #%%py_postclean %{_libdir}/node/wafadmin
158 # install documentation
159 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
160 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
161 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
162 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
165 rm -rf $RPM_BUILD_ROOT
167 %post -p /sbin/ldconfig
168 %postun -p /sbin/ldconfig
171 %defattr(644,root,root,755)
172 %doc README.md AUTHORS ChangeLog LICENSE
173 %attr(755,root,root) %{_bindir}/node
174 %attr(755,root,root) %{_bindir}/nodejs
175 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
176 %ghost %{_libdir}/libnode.so.8
177 %if "%{_lib}" != "lib"
180 %dir %{_prefix}/lib/node
181 %dir %{_prefix}/lib/node_modules
182 %{_mandir}/man1/node.1*
183 %{_mandir}/man1/nodejs.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]