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