source: projects/specs/trunk/n/nodejs/nodejs-vl.spec @ 12228

Revision 12228, 11.4 KB checked in by tomop, 5 years ago (diff)

Merge branch 'tomop'

Line 
1%bcond_without clang
2
3%global system_zlib 1
4%global system_v8 0
5%global system_openssl 1
6%global system_http_parser 0
7%global system_cares 1
8%global system_libuv 0
9
10%if "%{_dist_release}" < "vl7"
11%global system_openssl 0
12%endif
13
14%define _unpackaged_files_terminate_build 1
15
16Name: nodejs
17Version: 10.16.3
18Release: 1%{?_dist_release}
19Summary: JavaScript runtime
20Summary(ja): JavaScript runtime
21License: MIT and ASL 2.0 and ISC and BSD
22Group: Development/Languages
23URL: http://nodejs.org/
24
25# Exclusive archs must match v8
26ExclusiveArch: %{ix86} x86_64 %{arm}
27
28Source0: https://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
29Source1: macros.nodejs
30Source2: nodejs.attr
31Source3: nodejs.prov
32Source4: nodejs.req
33Source5: nodejs-symlink-deps
34Source6: nodejs-fixdep
35
36# V8 presently breaks ABI at least every x.y release while never bumping SONAME,
37# so we need to be more explicit until spot fixes that
38%global v8_ge 6.1.534.48
39%global v8_lt 6.2
40
41%if %{with clang}
42BuildRequires: clang
43BuildRequires: lld
44%endif
45
46%if %{system_v8}
47BuildRequires: v8-devel >= %{v8_ge}
48%endif
49%if %{system_http_parser}
50BuildRequires: http-parser-devel >= 2.0
51%endif
52%if %{system_libuv}
53BuildRequires: libuv-devel
54%endif
55%if %{system_cares}
56BuildRequires: c-ares-devel
57%endif
58%if %{system_zlib}
59BuildRequires: zlib-devel
60%endif
61
62%if %{system_openssl}
63# Node.js requires some features from openssl 1.0.1 for SPDY support
64BuildRequires: openssl-devel >= 1.0.1
65%endif
66
67%if %{system_v8}
68Requires: v8%{?isa} >= %{v8_ge}
69Requires: v8%{?isa} < %{v8_lt}
70%endif
71
72#virtual provides for automatic depedency generation
73Provides: nodejs(engine) = %{version}
74
75#npm
76Provides: npm = %{version}-%{release}
77
78# Node.js currently has a conflict with the 'node' package in Fedora
79# The ham-radio group has agreed to rename their binary for us, but
80# in the meantime, we're setting an explicit Conflicts: here
81Conflicts: node <= 0.3.2-11
82
83%description
84Node.js is a platform built on Chrome's JavaScript runtime
85for easily building fast, scalable network applications.
86Node.js uses an event-driven, non-blocking I/O model that
87makes it lightweight and efficient, perfect for data-intensive
88real-time applications that run across distributed devices.
89#'
90
91%package devel
92Summary: JavaScript runtime - development headers
93Summary(ja): JavaScript runtime - development headers
94Group: Development/Languages
95Requires: %{name} == %{version}-%{release}
96%if %{system_libuv}
97Requires: libuv-devel
98%endif
99%if %{system_http_parser}
100Requires: http-parser-devel
101%endif
102%if %{system_cares}
103Requires: c-ares-devel
104%endif
105%if %{system_zlib}
106Requires: zlib-devel
107%endif
108%if %{system_openssl}
109Requires: openssl-devel
110%endif
111
112%description devel
113Development headers for the Node.js JavaScript runtime.
114
115%package docs
116Summary: Node.js API documentation
117Summary(ja): Node.js API documentation
118Group: Documentation
119
120%description docs
121The API documentation for the Node.js JavaScript runtime.
122
123%prep
124%setup -q -n node-v%{version}
125
126# Make sure nothing gets included from bundled deps:
127# We only delete the source and header files, because
128# the remaining build scripts are still used.
129
130%if %{system_cares}
131find deps/cares -name "*.c" -exec rm -f {} \;
132find deps/cares -name "*.h" -exec rm -f {} \;
133%endif
134
135%if %{system_zlib}
136find deps/zlib -name "*.c" -exec rm -f {} \;
137find deps/zlib -name "*.h" -exec rm -f {} \;
138%endif
139
140%if %{system_v8}
141find deps/v8 -name "*.c" -exec rm -f {} \;
142find deps/v8 -name "*.h" -exec rm -f {} \;
143%endif
144
145%if %{system_http_parser}
146find deps/http_parser -name "*.c" -exec rm -f {} \;
147find deps/http_parser -name "*.h" -exec rm -f {} \;
148%endif
149
150%if %{system_openssl}
151find deps/openssl -name "*.c" -exec rm -f {} \;
152find deps/openssl -name "*.h" -exec rm -f {} \;
153%endif
154
155%if %{system_libuv}
156find deps/uv -name "*.c" -exec rm -f {} \;
157find deps/uv -name "*.h" -exec rm -f {} \;
158%endif
159
160%build
161
162# build with debugging symbols and add defines from libuv (#892601)
163export CFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
164export CXXFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
165export LDFLAGS="-Wl,-z,relro,-z,now"
166
167%if %{with clang}
168export CC=clang
169export CXX=clang++
170export LD=clang
171export CFLAGS="$CFLAGS -Wno-ignored-optimization-argument"
172export CXXFLAGS="$CXXFLAGS -Wno-ignored-optimization-argument"
173export LDFLAGS="$LDFLAGS -fuse-ld=lld"
174%endif
175
176./configure --prefix=%{_prefix} \
177          %if %{system_v8}
178            --shared-v8 \
179          %endif
180          %if %{system_openssl}
181            --shared-openssl \
182          %endif
183          %if %{system_zlib}
184            --shared-zlib \
185          %endif
186          %if %{system_cares}
187            --shared-cares \
188          %endif
189          %if %{system_libuv}
190            --shared-libuv \
191          %endif
192          %if %{system_http_parser}
193            --shared-http-parser \
194          %endif
195            --without-dtrace \
196            --openssl-use-def-ca-store
197
198# Setting BUILDTYPE=Debug builds both release and debug binaries
199make BUILDTYPE=Debug %{?_smp_mflags}
200
201%install
202rm -rf %{buildroot}
203
204./tools/install.py install %{buildroot} %{_prefix}
205
206# and remove dtrace file again
207rm -rf %{buildroot}/%{_prefix}/lib/dtrace
208
209# remove systemtap files
210rm -rf %{buildroot}/%{_datadir}/systemtap
211
212# Set the binary permissions properly
213chmod 0755 %{buildroot}/%{_bindir}/node
214
215# Install the debug binary and set its permissions
216install -Dpm0755 out/Debug/node %{buildroot}/%{_bindir}/node_g
217
218# own the sitelib directory
219mkdir -p %{buildroot}%{_prefix}/lib/node_modules
220
221# install rpm magic
222install -Dpm0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.nodejs
223install -Dpm0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/nodejs.attr
224install -pm0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/nodejs.prov
225install -pm0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/nodejs.req
226install -pm0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/nodejs-symlink-deps
227install -pm0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}/nodejs-fixdep
228
229#install documentation
230mkdir -p %{buildroot}%{_defaultdocdir}/%{name}-docs-%{version}/html
231cp -pr doc/* %{buildroot}%{_defaultdocdir}/%{name}-docs-%{version}/html
232rm -f %{_defaultdocdir}/%{name}-docs-%{version}/html/nodejs.1
233
234# move files for debug
235mkdir -p debug
236cp -pr %{buildroot}%{_docdir}/node/* debug/
237rm -rf %{buildroot}%{_docdir}/node
238
239#install development headers
240#FIXME: we probably don't really need *.h but node-gyp downloads the whole
241#freaking source tree so I can't be sure ATM
242mkdir -p %{buildroot}%{_includedir}/node
243cp -p src/*.h %{buildroot}%{_includedir}/node
244
245#node-gyp needs common.gypi too
246mkdir -p %{buildroot}%{_datadir}/node
247cp -p common.gypi %{buildroot}%{_datadir}/node
248
249%files
250%license LICENSE
251%doc CHANGELOG.md README.md AUTHORS
252%{_bindir}/node
253%{_bindir}/npm
254%{_bindir}/npx
255%{_mandir}/man1/node.*
256%dir %{_prefix}/lib/node_modules
257%{_prefix}/lib/node_modules/npm
258
259%files devel
260%doc debug
261%{_bindir}/node_g
262%{_includedir}/node
263%{_datadir}/node
264%{_sysconfdir}/rpm/macros.nodejs
265%{_rpmconfigdir}/fileattrs/nodejs.attr
266%{_rpmconfigdir}/nodejs*
267
268%files docs
269%doc %{_docdir}/%{name}-docs-%{version}
270%license LICENSE
271
272%changelog
273* Sat Sep 28 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 10.16.3-1
274- updated to 10.16.3.
275- dropped Patch0 and 1: fixed in upstream.
276- built with clang / lld.
277
278* Tue Dec 26 2017 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 8.9.3-1
279- updated to 8.9.3.
280- built with bundled v8.
281- built with system c-ares.
282- added Patch0 and 1.
283
284* Fri Sep 02 2016 Toshiaki Ara <ara_t@384.jp> 0.10.26-2
285- rebuild with gcc-5.4.0
286
287* Mon Mar 24 2014 Daisuke SUZUKI <daisuke@linux.or.jp> 0.10.26-1
288- update to 0.10.26
289
290* Thu May 02 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.10.5-1
291- update to 0.10.5
292- fix deps
293
294* Fri Mar 15 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.10.0-2
295- build with internal openssl on Vine Linux 6
296
297* Wed Mar 13 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.10.0-1
298- update to 0.10.0
299
300* Mon Mar 11 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.9.5-1
301- initial build for Vine Linux
302- include npm
303
304* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.5-11
305- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
306
307* Tue Jan 22 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-10
308- minor bugfixes to RPM magic
309  - nodejs-symlink-deps: don't create an empty node_modules dir when a module
310    has no dependencies
311  - nodes-fixdep: support adding deps when none exist
312- Add the full set of headers usually bundled with node as deps to nodejs-devel.
313  This way `npm install` for native modules that assume the stuff bundled with
314  node exists will usually "just work".
315-move RPM magic to nodejs-devel as requested by FPC
316
317* Sat Jan 12 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-9
318- fix brown paper bag bug in requires generation script
319
320* Thu Jan 10 2013 Stephen Gallagher <sgallagh@redhat.com> - 0.9.5-8
321- Build debug binary and install it in the nodejs-devel subpackage
322
323* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-7
324- don't use make install since it rebuilds everything
325
326* Thu Jan 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-6
327- add %%{?isa}, epoch to v8 deps
328
329* Wed Jan 09 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-5
330- add defines to match libuv (#892601)
331- make v8 dependency explicit (and thus more accurate)
332- add -g to $C(XX)FLAGS instead of patching configure to add it
333- don't write pointless 'npm(foo) > 0' deps
334
335* Sat Jan 05 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-4
336- install development headers
337- add nodejs_sitearch macro
338
339* Wed Jan 02 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-3
340- make nodejs-symlink-deps actually work
341
342* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-2
343- provide nodejs-devel so modules can BuildRequire it (and be consistent
344  with other interpreted languages in the distro)
345
346* Tue Jan 01 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.5-1
347- new upstream release 0.9.5
348- provide nodejs-devel for the moment
349- fix minor bugs in RPM magic
350- add nodejs_fixdep macro so packagers can easily adjust dependencies in
351  package.json files
352
353* Wed Dec 26 2012 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.9.4-1
354- new upstream release 0.9.4
355- system library patches are now upstream
356- respect optflags
357- include documentation in subpackage
358- add RPM dependency generation and related magic
359- guard libuv depedency so it always gets bumped when nodejs does
360- add -devel subpackage with enough to make node-gyp happy
361
362* Wed Dec 19 2012 Dan Horák <dan[at]danny.cz> - 0.9.3-8
363- set exclusive arch list to match v8
364
365* Tue Dec 18 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-7
366- Add remaining changes from code review
367- Remove unnecessary BuildRequires on findutils
368- Remove %%clean section
369
370* Fri Dec 14 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-6
371- Fixes from code review
372- Fix executable permissions
373- Correct the License field
374- Build debuginfo properly
375
376* Thu Dec 13 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-5
377- Return back to using the standard binary name
378- Temporarily adding a conflict against the ham radio node package until they
379  complete an agreed rename of their binary.
380
381* Wed Nov 28 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-4
382- Rename binary and manpage to nodejs
383
384* Mon Nov 19 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-3
385- Update to latest upstream development release 0.9.3
386- Include upstreamed patches to unbundle dependent libraries
387
388* Tue Oct 23 2012 Adrian Alves <alvesadrian@fedoraproject.org>  0.8.12-1
389- Fixes and Patches suggested by Matthias Runge
390
391* Mon Apr 09 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.6.5
392- First build.
393
Note: See TracBrowser for help on using the repository browser.