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: gcc >= 5:4.0
30 BuildRequires: http-parser-devel >= 2.5.0
31 BuildRequires: libstdc++-devel
32 %{?with_system_uv:BuildRequires: libuv-devel >= 1.6.0}
33 BuildRequires: openssl-devel >= 1.0.1
34 BuildRequires: pkgconfig
35 BuildRequires: python >= 1:2.5.2
36 BuildRequires: python-jsmin
37 BuildRequires: python-modules
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}
61 Requires: http-parser-devel >= 2.5.0
62 Requires: libstdc++-devel
63 %{?with_system_uv:Requires: libuv-devel >= 1.6.0}
64 Requires: openssl-devel
68 Development headers for nodejs.
71 Summary: Evented I/O for V8 JavaScript - documentation
73 %if "%{_rpmversion}" >= "5"
78 Node.js is a server-side JavaScript environment that uses an
79 asynchronous event-driven model. Node's goal is to provide an easy way
80 to build scalable network programs.
82 This package contains the documentation for nodejs.
85 %setup -q -n node-v%{version}
86 %{?with_shared:%patch1 -p1}
88 %if %{_lib} == "lib64"
94 rm src/node_root_certs.h
95 #%{?with_system_uv:%patch5 -p1}
97 grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
100 rm -r deps/http_parser
102 %{?with_system_uv:rm -r deps/uv}
106 # CC used only to detect if CC is clang, not used for compiling
109 GYP_DEFINES="soname_version=%{sover}" \
113 %{?0:--shared-cares} \
114 %{?with_system_uv:--shared-libuv} \
115 --shared-http-parser \
120 # add LFS defines from libuv (RHBZ#892601)
121 # CXXFLAGS must be exported, as it is needed for make, not gyp
122 CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
123 LDFLAGS="%{rpmldflags}" \
124 %{__make} -C out V=1 BUILDTYPE=Release
127 rm -rf $RPM_BUILD_ROOT
128 %{__python} tools/install.py install "$RPM_BUILD_ROOT" "%{_prefix}"
131 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
132 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
133 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
136 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
138 install -d $RPM_BUILD_ROOT%{_includedir}/node
139 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
141 # install for node-gyp
142 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
143 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
144 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
146 # for compat of fedora derivered scripts (shebangs)
147 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
149 # globally installed node modules (noarch)
150 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
152 # default searchpaths
153 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
156 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
157 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
160 libdir=${prefix}/%{_lib}
161 includedir=${prefix}/include/node
164 Description: Evented I/O for V8 JavaScript.
166 Cflags: -I${includedir}
169 # install documentation
170 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
171 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
172 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
173 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
176 rm -rf $RPM_BUILD_ROOT
179 %post -p /sbin/ldconfig
180 %postun -p /sbin/ldconfig
184 %defattr(644,root,root,755)
185 %doc README.md AUTHORS CHANGELOG.md ROADMAP.md LICENSE
186 %attr(755,root,root) %{_bindir}/node
187 %attr(755,root,root) %{_bindir}/nodejs
189 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
190 %ghost %{_libdir}/libnode.so.10
192 %if "%{_lib}" != "lib"
195 %dir %{_prefix}/lib/node
196 %dir %{_prefix}/lib/node_modules
197 %{_mandir}/man1/node.1*
198 %{_mandir}/man1/nodejs.1
201 %defattr(644,root,root,755)
203 %{_libdir}/libnode.so
206 %{_pkgconfigdir}/nodejs.pc
210 %defattr(644,root,root,755)
211 %doc %{_docdir}/%{name}-doc-%{version}