3 # /usr/share/doc/node/gdbinit
4 # /usr/share/systemtap/tapset/node.stp
7 %bcond_without system_uv # system uv
8 %bcond_with shared # build libnode.so shared library
11 # - https://nodejs.org/en/download/releases/
13 Summary: Asynchronous JavaScript Engine
17 License: BSD and MIT and Apache v2.0 and GPL v3
18 Group: Development/Languages
19 Source0: https://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
20 # Source0-md5: 529a8abd4ca5a2225636767d3f14c382
21 Patch1: %{name}-shared.patch
22 # force node to use /usr/lib/node as the systemwide module directory
23 Patch2: %{name}-libpath.patch
24 # use /usr/lib64/node as an arch-specific module dir when appropriate
25 Patch3: %{name}-lib64path.patch
26 Patch4: %{name}-use-system-certs.patch
28 URL: https://nodejs.org/
29 BuildRequires: c-ares-devel
30 BuildRequires: gcc >= 5:4.0
31 BuildRequires: http-parser-devel >= 2.5.0
32 BuildRequires: libstdc++-devel
33 %{?with_system_uv:BuildRequires: libuv-devel >= 1.6.0}
34 BuildRequires: openssl-devel
35 BuildRequires: pkgconfig
36 BuildRequires: python >= 1:2.5.2
37 BuildRequires: python-jsmin
38 BuildRequires: rpm >= 4.4.9-56
39 BuildRequires: rpmbuild(macros) >= 1.219
40 BuildRequires: sed >= 4.0
41 BuildRequires: zlib-devel
42 Requires: ca-certificates
44 ExclusiveArch: %{ix86} %{x8664} arm
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 %define sover %(echo %{version} | cut -d. -f2)
50 Node.js is a platform built on Chrome's JavaScript runtime for easily
51 building fast, scalable network applications. Node.js uses an
52 event-driven, non-blocking I/O model that makes it lightweight and
53 efficient, perfect for data-intensive real-time applications that run
54 across distributed devices.
57 Summary: Development headers for nodejs
58 Group: Development/Libraries
59 Requires: %{name} = %{version}-%{release}
60 Requires: c-ares-devel
62 Requires: http-parser-devel
63 Requires: libstdc++-devel
64 %{?with_system_uv:Requires: libuv-devel}
65 Requires: openssl-devel
69 Development headers for nodejs.
72 Summary: Evented I/O for V8 JavaScript - documentation
74 %if "%{_rpmversion}" >= "5"
79 Node.js is a server-side JavaScript environment that uses an
80 asynchronous event-driven model. Node's goal is to provide an easy way
81 to build scalable network programs.
83 This package contains the documentation for nodejs.
86 %setup -q -n node-v%{version}
87 %{?with_shared:%patch1 -p1}
89 %if %{_lib} == "lib64"
95 #%{?with_system_uv:%patch5 -p1}
97 grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
101 rm -r deps/http_parser
103 %{?with_system_uv:rm -r deps/uv}
107 # CC used only to detect if CC is clang, not used for compiling
110 GYP_DEFINES="soname_version=%{sover}" \
114 %{?0:--shared-cares} \
115 %{?with_system_uv:--shared-libuv} \
116 --shared-http-parser \
121 # add LFS defines from libuv (RHBZ#892601)
122 # CXXFLAGS must be exported, as it is needed for make, not gyp
123 CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
124 LDFLAGS="%{rpmldflags}" \
125 %{__make} -C out V=1 BUILDTYPE=Release
128 rm -rf $RPM_BUILD_ROOT
129 %{__python} tools/install.py install "$RPM_BUILD_ROOT" "%{_prefix}"
132 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
133 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
134 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
137 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
139 install -d $RPM_BUILD_ROOT%{_includedir}/node
140 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
142 # install for node-gyp
143 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
144 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
145 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
147 # for compat of fedora derivered scripts (shebangs)
148 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
150 # globally installed node modules (noarch)
151 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
153 # default searchpaths
154 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
157 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
158 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
161 libdir=${prefix}/%{_lib}
162 includedir=${prefix}/include/node
165 Description: Evented I/O for V8 JavaScript.
167 Cflags: -I${includedir}
170 # install documentation
171 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
172 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
173 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
174 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
177 rm -rf $RPM_BUILD_ROOT
180 %post -p /sbin/ldconfig
181 %postun -p /sbin/ldconfig
185 %defattr(644,root,root,755)
186 %doc README.md AUTHORS CHANGELOG.md ROADMAP.md LICENSE
187 %attr(755,root,root) %{_bindir}/node
188 %attr(755,root,root) %{_bindir}/nodejs
190 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
191 %ghost %{_libdir}/libnode.so.10
193 %if "%{_lib}" != "lib"
196 %dir %{_prefix}/lib/node
197 %dir %{_prefix}/lib/node_modules
198 %{_mandir}/man1/node.1*
199 %{_mandir}/man1/nodejs.1
202 %defattr(644,root,root,755)
204 %{_libdir}/libnode.so
207 %{_pkgconfigdir}/nodejs.pc
211 %defattr(644,root,root,755)
212 %doc %{_docdir}/%{name}-doc-%{version}