]> git.pld-linux.org Git - packages/nodejs.git/blame - nodejs.spec
use patched v8 for SetAbortOnUncaughtException support
[packages/nodejs.git] / nodejs.spec
CommitLineData
29d6d704
ER
1#
2# Conditional build:
3%bcond_without system_v8 # system v8
9ea1462f 4%bcond_without shared # build libnode.so shared library
29d6d704 5
8611106e
ER
6# NOTES:
7# - https://nodejs.org/en/download/releases/
8
210abff9 9Summary: Asynchronous JavaScript Engine
10Name: nodejs
8611106e 11Version: 0.10.40
edb6f7bb 12Release: 1
d5764a43 13License: BSD and MIT and Apache v2.0 and GPL v3
e85103e0 14Group: Development/Languages
8611106e
ER
15Source0: https://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
16# Source0-md5: f6ef20f327ecd6cb1586c41c7184290c
4174c079 17Patch1: %{name}-shared.patch
a6070ceb
ER
18# force node to use /usr/lib/node as the systemwide module directory
19Patch2: %{name}-libpath.patch
20# use /usr/lib64/node as an arch-specific module dir when appropriate
21Patch3: %{name}-lib64path.patch
58e86022 22Patch4: %{name}-use-system-certs.patch
1385a038 23Patch5: uv-fpic.patch
be62a70f
ER
24# The invalid UTF8 fix has been reverted since this breaks v8 API, which cannot
25# be done in a stable distribution release. This build of nodejs will behave as
26# if NODE_INVALID_UTF8 was set. For more information on the implications, see:
27# http://blog.nodejs.org/2014/06/16/openssl-and-breaking-utf-8-change/
28Patch6: %{name}-revert-utf8-v8.patch
29Patch7: %{name}-revert-utf8-node.patch
8611106e 30URL: https://nodejs.org/
c1c359b8 31BuildRequires: c-ares-devel
12a49d35 32BuildRequires: gcc >= 5:4.0
e427e9b0 33BuildRequires: http-parser-devel >= 2.0
210abff9 34BuildRequires: libstdc++-devel
d8825fb6 35BuildRequires: libuv-devel >= 0.10
cd4c73aa
ER
36BuildRequires: openssl-devel
37BuildRequires: pkgconfig
a6070ceb
ER
38BuildRequires: python >= 1:2.5.2
39BuildRequires: python-jsmin
12a49d35 40BuildRequires: rpm >= 4.4.9-56
d44c8857 41BuildRequires: rpmbuild(macros) >= 1.219
536f9f5a 42BuildRequires: sed >= 4.0
edb6f7bb 43%{?with_system_v8:BuildRequires: v8-devel >= 3.15.11.18-2}
cd4c73aa 44BuildRequires: zlib-devel
58e86022 45Requires: ca-certificates
5ef76b51 46Obsoletes: nodejs-waf
210abff9 47ExclusiveArch: %{ix86} %{x8664} arm
48BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49
dc60a63b
ER
50%define sover %(echo %{version} | cut -d. -f2)
51
210abff9 52%description
c3b531ba
ER
53Node.js is a platform built on Chrome's JavaScript runtime for easily
54building fast, scalable network applications. Node.js uses an
55event-driven, non-blocking I/O model that makes it lightweight and
56efficient, perfect for data-intensive real-time applications that run
57across distributed devices.
210abff9 58
210abff9 59%package devel
12a49d35 60Summary: Development headers for nodejs
210abff9 61Group: Development/Libraries
a8f57a3f 62Requires: %{name} = %{version}-%{release}
96f19ba5 63Requires: c-ares-devel
d44c8857 64Requires: gcc
96f19ba5 65Requires: http-parser-devel
d44c8857 66Requires: libstdc++-devel
96f19ba5
ER
67Requires: libuv-devel
68Requires: openssl-devel
29d6d704 69%{?with_system_v8:Requires: v8-devel}
96f19ba5 70Requires: zlib-devel
210abff9 71
72%description devel
12a49d35 73Development headers for nodejs.
210abff9 74
a6070ceb
ER
75%package doc
76Summary: Evented I/O for V8 JavaScript - documentation
77Group: Documentation
b6b2dd9b
ER
78%if "%{_rpmversion}" >= "5"
79BuildArch: noarch
80%endif
a6070ceb
ER
81
82%description doc
83Node.js is a server-side JavaScript environment that uses an
84asynchronous event-driven model. Node's goal is to provide an easy way
85to build scalable network programs.
86
87This package contains the documentation for nodejs.
88
210abff9 89%prep
90%setup -q -n node-v%{version}
9ea1462f 91%{?with_shared:%patch1 -p1}
a6070ceb
ER
92%if %{_lib} == "lib64"
93%patch3 -p1
94%else
95%patch2 -p1
96%endif
58e86022 97%patch4 -p1
1385a038 98%patch5 -p1
be62a70f
ER
99%patch6 -p1
100%patch7 -p1
c4aa3bb0 101
536f9f5a
ER
102grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
103
29d6d704
ER
104rm -r deps/npm
105rm -r deps/cares
106rm -r deps/http_parser
107rm -r deps/openssl
108rm -r deps/uv
109%{?with_system_v8:rm -r deps/v8}
110rm -r deps/zlib
e3e8568d 111
210abff9 112%build
a11025a6
ER
113# CC used only to detect if CC is clang, not used for compiling
114CC="%{__cc}" \
115CXX="%{__cxx}" \
dc60a63b 116GYP_DEFINES="soname_version=%{sover}" \
a6070ceb 117./configure \
29d6d704 118 %{?with_system_v8:--shared-v8} \
a6070ceb 119 --shared-zlib \
be06d6d0 120 --shared-openssl \
c1c359b8 121 --shared-cares \
8939ac26 122 --shared-libuv \
e427e9b0 123 --shared-http-parser \
7223b5ac 124 --without-npm \
c1c359b8 125 --without-dtrace \
210abff9 126 --prefix=%{_prefix}
127
a11025a6
ER
128# add LFS defines from libuv (RHBZ#892601)
129# CXXFLAGS must be exported, as it is needed for make, not gyp
130CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
131LDFLAGS="%{rpmldflags}" \
132%{__make} -C out V=1 BUILDTYPE=Release
210abff9 133
134%install
135rm -rf $RPM_BUILD_ROOT
39356b33 136%{__python} tools/install.py install "$RPM_BUILD_ROOT" "%{_lib}"
4174c079 137
9ea1462f 138%if %{with shared}
f9cee3b6 139lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
4174c079
ER
140ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
141ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
9ea1462f 142%endif
a6070ceb 143
c7898157
ER
144echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
145
1ed21df5 146install -d $RPM_BUILD_ROOT%{_includedir}/node
4174c079 147cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
d5764a43
ER
148
149# install for node-gyp
150install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
151cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
152ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
1ed21df5 153
e85103e0 154# for compat of fedora derivered scripts (shebangs)
c3b531ba
ER
155ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
156
e85103e0
ER
157# globally installed node modules (noarch)
158install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
159
160# default searchpaths
161install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
162
a6070ceb
ER
163# create pkgconfig
164install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
165cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
166version=%{version}
c3b531ba 167prefix=%{_prefix}
87c4fdf2 168libdir=${prefix}/%{_lib}
a6070ceb
ER
169includedir=${prefix}/include/node
170
171Name: nodejs
172Description: Evented I/O for V8 JavaScript.
173Version: ${version}
174Cflags: -I${includedir}
175EOF
a752c1c0 176
a6070ceb 177# install documentation
6f7eebb5
ER
178install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
179cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
180rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
181rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
a6070ceb 182
210abff9 183%clean
184rm -rf $RPM_BUILD_ROOT
185
9ea1462f 186%if %{with shared}
4174c079 187%post -p /sbin/ldconfig
7372d27d 188%postun -p /sbin/ldconfig
9ea1462f 189%endif
7372d27d 190
210abff9 191%files
192%defattr(644,root,root,755)
a6070ceb 193%doc README.md AUTHORS ChangeLog LICENSE
210abff9 194%attr(755,root,root) %{_bindir}/node
c3b531ba 195%attr(755,root,root) %{_bindir}/nodejs
9ea1462f 196%if %{with shared}
a600c300 197%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
2492de83 198%ghost %{_libdir}/libnode.so.10
9ea1462f 199%endif
a600c300 200%if "%{_lib}" != "lib"
8791ea86 201%dir %{_libdir}/node
a600c300
ŁC
202%endif
203%dir %{_prefix}/lib/node
e85103e0 204%dir %{_prefix}/lib/node_modules
210abff9 205%{_mandir}/man1/node.1*
c7898157 206%{_mandir}/man1/nodejs.1
210abff9 207
210abff9 208%files devel
209%defattr(644,root,root,755)
9ea1462f 210%if %{with shared}
a600c300 211%{_libdir}/libnode.so
9ea1462f 212%endif
58494f0c 213%{_includedir}/node
a6070ceb 214%{_pkgconfigdir}/nodejs.pc
d5764a43 215%{_usrsrc}/%{name}
a6070ceb
ER
216
217%files doc
218%defattr(644,root,root,755)
219%doc %{_docdir}/%{name}-doc-%{version}
This page took 0.09173 seconds and 4 git commands to generate.