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

Revision 11301, 11.1 KB checked in by tomop, 6 years ago (diff)

nodejs-8.9.3-1

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