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