1 |
%define build_doc 0 |
2 |
|
3 |
Name: nodejs |
4 |
Version: 0.10.30 |
5 |
Release: %mkrel 3 |
6 |
Summary: Evented Server-Side Javascript |
7 |
Group: System/Servers |
8 |
License: BSD |
9 |
URL: http://nodejs.org |
10 |
Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz |
11 |
BuildRequires: c-ares-devel |
12 |
BuildRequires: zlib-devel |
13 |
BuildRequires: openssl-devel >= 1.0.1 |
14 |
Provides: npm = %{version}-%{release} |
15 |
|
16 |
|
17 |
#we need ABI virtual provides where SONAMEs aren't enough/not present so deps |
18 |
#break when binary compatibility is broken |
19 |
%global nodejs_abi 0.10 |
20 |
Provides: nodejs(abi) = %{nodejs_abi} |
21 |
|
22 |
#this corresponds to the "engine" requirement in package.json |
23 |
Provides: nodejs(engine) = %{version} |
24 |
|
25 |
%description |
26 |
Node.js is a platform built on Chrome's JavaScript runtime |
27 |
for easily building fast, scalable network applications. |
28 |
Node.js uses an event-driven, non-blocking I/O model that |
29 |
makes it lightweight and efficient, perfect for data-intensive |
30 |
real-time applications that run across distributed devices. |
31 |
|
32 |
%if %build_doc |
33 |
%package doc |
34 |
Summary: Node.js API documentation |
35 |
Group: Documentation |
36 |
|
37 |
%description docs |
38 |
The API documentation for the Node.js JavaScript runtime. |
39 |
%endif |
40 |
|
41 |
%prep |
42 |
%setup -q -n node-v%{version} |
43 |
sed -e 's!"~2"!"2 || 3"!' -i ./deps/npm/node_modules/read-installed/test/fixtures/package.json |
44 |
sed -e 's!"2"!"2 || 3"!' -i ./deps/npm/node_modules/cmd-shim/package.json |
45 |
|
46 |
# Make sure nothing gets included from bundled deps (except v8): |
47 |
# We only delete the source and header files, because |
48 |
# the remaining build scripts are still used. |
49 |
find deps/cares -name "*.c" -exec rm -f {} \; |
50 |
find deps/cares -name "*.h" -exec rm -f {} \; |
51 |
|
52 |
find deps/npm -name "*.c" -exec rm -f {} \; |
53 |
find deps/npm -name "*.h" -exec rm -f {} \; |
54 |
|
55 |
find deps/zlib -name "*.c" -exec rm -f {} \; |
56 |
find deps/zlib -name "*.h" -exec rm -f {} \; |
57 |
|
58 |
find deps/openssl -name "*.c" -exec rm -f {} \; |
59 |
find deps/openssl -name "*.h" -exec rm -f {} \; |
60 |
|
61 |
%build |
62 |
#FIXME: some CFLAGS do not seem to be recognized :/ |
63 |
#FIXME: does not build with --shared-libuv (no package in Mageia) |
64 |
./configure --prefix=%{_prefix} \ |
65 |
--shared-openssl \ |
66 |
--shared-zlib \ |
67 |
--shared-cares \ |
68 |
--openssl-use-sys \ |
69 |
--without-dtrace |
70 |
%make |
71 |
|
72 |
%install |
73 |
%makeinstall_std |
74 |
# Remove dtrace file again |
75 |
rm -rf %{buildroot}/%{_prefix}/lib/dtrace |
76 |
|
77 |
%if %build_doc |
78 |
# Install documentation |
79 |
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}/html |
80 |
cp -pr doc/* %{buildroot}%{_defaultdocdir}/%{name}/html |
81 |
rm -f %{buildroot}%{_defaultdocdir}/%{name}/html/nodejs.1 |
82 |
cp -p LICENSE %{buildroot}%{_defaultdocdir}/%{name}/ |
83 |
%endif |
84 |
|
85 |
%files |
86 |
%doc ChangeLog LICENSE README.md AUTHORS |
87 |
%{_bindir}/node |
88 |
%{_bindir}/npm |
89 |
%{_prefix}/lib/node_modules |
90 |
%{_mandir}/man1/node.* |
91 |
%{_includedir}/node |
92 |
|
93 |
%if %build_doc |
94 |
%files doc |
95 |
%{_defaultdocdir}/%{name} |
96 |
%endif |