1 Summary: Asynchronous JavaScript Engine
5 License: BSD and MIT and ASL 2.0 and GPLv3
6 Group: Development/Languages
7 Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
8 # Source0-md5: 4daca92618515708a4631e98a8e8c779
9 Patch1: %{name}-shared.patch
10 # force node to use /usr/lib/node as the systemwide module directory
11 Patch2: %{name}-libpath.patch
12 # use /usr/lib64/node as an arch-specific module dir when appropriate
13 Patch3: %{name}-lib64path.patch
15 URL: http://www.nodejs.org/
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.15.11.10
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}
39 Requires: libstdc++-devel
43 Development headers for nodejs.
46 Summary: Evented I/O for V8 JavaScript - documentation
50 Node.js is a server-side JavaScript environment that uses an
51 asynchronous event-driven model. Node's goal is to provide an easy way
52 to build scalable network programs.
54 This package contains the documentation for nodejs.
57 %setup -q -n node-v%{version}
59 %if %{_lib} == "lib64"
67 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
70 # NOT autoconf so dont use macro
71 export PYTHONPATH=tools
82 CFLAGS.host="%{rpmcflags} -fPIC" \
83 CXXFLAGS.host="%{rpmcppflags} -fPIC" \
84 LDFLAGS.host="%{rpmcflags}" \
85 CFLAGS.target="%{rpmcflags} -fPIC" \
86 CXXFLAGS.target="%{rpmcppflags} -fPIC" \
87 LDFLAGS.target="%{rpmcflags}" \
88 %if "%{pld_release}" == "ac"
90 CXX.host="%{__cxx}4" \
91 CC.target="%{__cc}4" \
92 CXX.target="%{__cxx}4" \
101 rm -rf $RPM_BUILD_ROOT
102 %{__make} justinstall \
103 DESTDIR=$RPM_BUILD_ROOT \
107 %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/lib/dtrace/node.d
109 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*)
110 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
111 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
113 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
115 install -d $RPM_BUILD_ROOT%{_includedir}/node
116 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
118 # for compat of fedora derivered scripts (shebangs)
119 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
121 # globally installed node modules (noarch)
122 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
124 # default searchpaths
125 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
128 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
129 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
132 libdir=${prefix}/%{_lib}
133 includedir=${prefix}/include/node
136 Description: Evented I/O for V8 JavaScript.
138 Cflags: -I${includedir}
141 # install documentation
142 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
143 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
144 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
145 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
148 rm -rf $RPM_BUILD_ROOT
150 %post -p /sbin/ldconfig
151 %postun -p /sbin/ldconfig
154 %defattr(644,root,root,755)
155 %doc README.md AUTHORS ChangeLog LICENSE
156 %attr(755,root,root) %{_bindir}/node
157 %attr(755,root,root) %{_bindir}/nodejs
158 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
159 %ghost %{_libdir}/libnode.so.10
160 %if "%{_lib}" != "lib"
163 %dir %{_prefix}/lib/node
164 %dir %{_prefix}/lib/node_modules
165 %{_mandir}/man1/node.1*
166 %{_mandir}/man1/nodejs.1
169 %defattr(644,root,root,755)
170 %{_libdir}/libnode.so
172 %{_pkgconfigdir}/nodejs.pc
175 %defattr(644,root,root,755)
176 %doc %{_docdir}/%{name}-doc-%{version}