[12228] | 1 | %bcond_without clang |
---|
| 2 | |
---|
[7570] | 3 | %global system_zlib 1 |
---|
[11301] | 4 | %global system_v8 0 |
---|
[7570] | 5 | %global system_openssl 1 |
---|
| 6 | %global system_http_parser 0 |
---|
[12228] | 7 | %global system_cares 1 |
---|
[7570] | 8 | %global system_libuv 0 |
---|
| 9 | |
---|
| 10 | %if "%{_dist_release}" < "vl7" |
---|
| 11 | %global system_openssl 0 |
---|
| 12 | %endif |
---|
| 13 | |
---|
[11301] | 14 | %define _unpackaged_files_terminate_build 1 |
---|
| 15 | |
---|
[7541] | 16 | Name: nodejs |
---|
[12228] | 17 | Version: 10.16.3 |
---|
[11301] | 18 | Release: 1%{?_dist_release} |
---|
[7541] | 19 | Summary: JavaScript runtime |
---|
| 20 | Summary(ja): JavaScript runtime |
---|
| 21 | License: MIT and ASL 2.0 and ISC and BSD |
---|
| 22 | Group: Development/Languages |
---|
| 23 | URL: http://nodejs.org/ |
---|
| 24 | |
---|
| 25 | # Exclusive archs must match v8 |
---|
| 26 | ExclusiveArch: %{ix86} x86_64 %{arm} |
---|
| 27 | |
---|
[12228] | 28 | Source0: https://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz |
---|
[7541] | 29 | Source1: macros.nodejs |
---|
| 30 | Source2: nodejs.attr |
---|
| 31 | Source3: nodejs.prov |
---|
| 32 | Source4: nodejs.req |
---|
| 33 | Source5: nodejs-symlink-deps |
---|
| 34 | Source6: 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 |
---|
[11301] | 38 | %global v8_ge 6.1.534.48 |
---|
| 39 | %global v8_lt 6.2 |
---|
[7541] | 40 | |
---|
[12228] | 41 | %if %{with clang} |
---|
| 42 | BuildRequires: clang |
---|
| 43 | BuildRequires: lld |
---|
| 44 | %endif |
---|
| 45 | |
---|
[7570] | 46 | %if %{system_v8} |
---|
[7541] | 47 | BuildRequires: v8-devel >= %{v8_ge} |
---|
[7570] | 48 | %endif |
---|
| 49 | %if %{system_http_parser} |
---|
| 50 | BuildRequires: http-parser-devel >= 2.0 |
---|
| 51 | %endif |
---|
| 52 | %if %{system_libuv} |
---|
| 53 | BuildRequires: libuv-devel |
---|
| 54 | %endif |
---|
| 55 | %if %{system_cares} |
---|
| 56 | BuildRequires: c-ares-devel |
---|
| 57 | %endif |
---|
| 58 | %if %{system_zlib} |
---|
[7541] | 59 | BuildRequires: zlib-devel |
---|
[7570] | 60 | %endif |
---|
| 61 | |
---|
| 62 | %if %{system_openssl} |
---|
[7541] | 63 | # Node.js requires some features from openssl 1.0.1 for SPDY support |
---|
| 64 | BuildRequires: openssl-devel >= 1.0.1 |
---|
[7570] | 65 | %endif |
---|
[7541] | 66 | |
---|
[7570] | 67 | %if %{system_v8} |
---|
[7654] | 68 | Requires: v8%{?isa} >= %{v8_ge} |
---|
[7541] | 69 | Requires: v8%{?isa} < %{v8_lt} |
---|
[7570] | 70 | %endif |
---|
[7541] | 71 | |
---|
| 72 | #virtual provides for automatic depedency generation |
---|
| 73 | Provides: nodejs(engine) = %{version} |
---|
| 74 | |
---|
| 75 | #npm |
---|
| 76 | Provides: 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 |
---|
| 81 | Conflicts: node <= 0.3.2-11 |
---|
| 82 | |
---|
| 83 | %description |
---|
| 84 | Node.js is a platform built on Chrome's JavaScript runtime |
---|
| 85 | for easily building fast, scalable network applications. |
---|
| 86 | Node.js uses an event-driven, non-blocking I/O model that |
---|
| 87 | makes it lightweight and efficient, perfect for data-intensive |
---|
| 88 | real-time applications that run across distributed devices. |
---|
[10767] | 89 | #' |
---|
[7541] | 90 | |
---|
| 91 | %package devel |
---|
| 92 | Summary: JavaScript runtime - development headers |
---|
| 93 | Summary(ja): JavaScript runtime - development headers |
---|
| 94 | Group: Development/Languages |
---|
| 95 | Requires: %{name} == %{version}-%{release} |
---|
[7570] | 96 | %if %{system_libuv} |
---|
| 97 | Requires: libuv-devel |
---|
| 98 | %endif |
---|
| 99 | %if %{system_http_parser} |
---|
| 100 | Requires: http-parser-devel |
---|
| 101 | %endif |
---|
| 102 | %if %{system_cares} |
---|
| 103 | Requires: c-ares-devel |
---|
| 104 | %endif |
---|
| 105 | %if %{system_zlib} |
---|
| 106 | Requires: zlib-devel |
---|
| 107 | %endif |
---|
| 108 | %if %{system_openssl} |
---|
| 109 | Requires: openssl-devel |
---|
| 110 | %endif |
---|
[7541] | 111 | |
---|
| 112 | %description devel |
---|
| 113 | Development headers for the Node.js JavaScript runtime. |
---|
| 114 | |
---|
| 115 | %package docs |
---|
| 116 | Summary: Node.js API documentation |
---|
| 117 | Summary(ja): Node.js API documentation |
---|
| 118 | Group: Documentation |
---|
| 119 | |
---|
| 120 | %description docs |
---|
| 121 | The 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 | |
---|
[7570] | 130 | %if %{system_cares} |
---|
| 131 | find deps/cares -name "*.c" -exec rm -f {} \; |
---|
| 132 | find deps/cares -name "*.h" -exec rm -f {} \; |
---|
| 133 | %endif |
---|
[7541] | 134 | |
---|
[7570] | 135 | %if %{system_zlib} |
---|
[7541] | 136 | find deps/zlib -name "*.c" -exec rm -f {} \; |
---|
| 137 | find deps/zlib -name "*.h" -exec rm -f {} \; |
---|
[7570] | 138 | %endif |
---|
[7541] | 139 | |
---|
[7570] | 140 | %if %{system_v8} |
---|
[7541] | 141 | find deps/v8 -name "*.c" -exec rm -f {} \; |
---|
| 142 | find deps/v8 -name "*.h" -exec rm -f {} \; |
---|
[7570] | 143 | %endif |
---|
[7541] | 144 | |
---|
[7570] | 145 | %if %{system_http_parser} |
---|
| 146 | find deps/http_parser -name "*.c" -exec rm -f {} \; |
---|
| 147 | find deps/http_parser -name "*.h" -exec rm -f {} \; |
---|
| 148 | %endif |
---|
[7541] | 149 | |
---|
[7570] | 150 | %if %{system_openssl} |
---|
[7541] | 151 | find deps/openssl -name "*.c" -exec rm -f {} \; |
---|
| 152 | find deps/openssl -name "*.h" -exec rm -f {} \; |
---|
[7570] | 153 | %endif |
---|
[7541] | 154 | |
---|
[7570] | 155 | %if %{system_libuv} |
---|
| 156 | find deps/uv -name "*.c" -exec rm -f {} \; |
---|
| 157 | find deps/uv -name "*.h" -exec rm -f {} \; |
---|
| 158 | %endif |
---|
[7541] | 159 | |
---|
| 160 | %build |
---|
[12228] | 161 | |
---|
[7541] | 162 | # build with debugging symbols and add defines from libuv (#892601) |
---|
| 163 | export CFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' |
---|
| 164 | export CXXFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' |
---|
[12228] | 165 | export LDFLAGS="-Wl,-z,relro,-z,now" |
---|
[7541] | 166 | |
---|
[12228] | 167 | %if %{with clang} |
---|
| 168 | export CC=clang |
---|
| 169 | export CXX=clang++ |
---|
| 170 | export LD=clang |
---|
| 171 | export CFLAGS="$CFLAGS -Wno-ignored-optimization-argument" |
---|
| 172 | export CXXFLAGS="$CXXFLAGS -Wno-ignored-optimization-argument" |
---|
| 173 | export LDFLAGS="$LDFLAGS -fuse-ld=lld" |
---|
| 174 | %endif |
---|
| 175 | |
---|
[7541] | 176 | ./configure --prefix=%{_prefix} \ |
---|
[7570] | 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 |
---|
[11301] | 195 | --without-dtrace \ |
---|
| 196 | --openssl-use-def-ca-store |
---|
[7541] | 197 | |
---|
| 198 | # Setting BUILDTYPE=Debug builds both release and debug binaries |
---|
| 199 | make BUILDTYPE=Debug %{?_smp_mflags} |
---|
| 200 | |
---|
| 201 | %install |
---|
| 202 | rm -rf %{buildroot} |
---|
| 203 | |
---|
[11301] | 204 | ./tools/install.py install %{buildroot} %{_prefix} |
---|
[7541] | 205 | |
---|
| 206 | # and remove dtrace file again |
---|
| 207 | rm -rf %{buildroot}/%{_prefix}/lib/dtrace |
---|
| 208 | |
---|
[11301] | 209 | # remove systemtap files |
---|
| 210 | rm -rf %{buildroot}/%{_datadir}/systemtap |
---|
| 211 | |
---|
[7541] | 212 | # Set the binary permissions properly |
---|
| 213 | chmod 0755 %{buildroot}/%{_bindir}/node |
---|
| 214 | |
---|
| 215 | # Install the debug binary and set its permissions |
---|
| 216 | install -Dpm0755 out/Debug/node %{buildroot}/%{_bindir}/node_g |
---|
| 217 | |
---|
| 218 | # own the sitelib directory |
---|
| 219 | mkdir -p %{buildroot}%{_prefix}/lib/node_modules |
---|
| 220 | |
---|
| 221 | # install rpm magic |
---|
| 222 | install -Dpm0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.nodejs |
---|
| 223 | install -Dpm0644 %{SOURCE2} %{buildroot}%{_rpmconfigdir}/fileattrs/nodejs.attr |
---|
| 224 | install -pm0755 %{SOURCE3} %{buildroot}%{_rpmconfigdir}/nodejs.prov |
---|
| 225 | install -pm0755 %{SOURCE4} %{buildroot}%{_rpmconfigdir}/nodejs.req |
---|
| 226 | install -pm0755 %{SOURCE5} %{buildroot}%{_rpmconfigdir}/nodejs-symlink-deps |
---|
| 227 | install -pm0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}/nodejs-fixdep |
---|
| 228 | |
---|
| 229 | #install documentation |
---|
| 230 | mkdir -p %{buildroot}%{_defaultdocdir}/%{name}-docs-%{version}/html |
---|
| 231 | cp -pr doc/* %{buildroot}%{_defaultdocdir}/%{name}-docs-%{version}/html |
---|
| 232 | rm -f %{_defaultdocdir}/%{name}-docs-%{version}/html/nodejs.1 |
---|
| 233 | |
---|
[11301] | 234 | # move files for debug |
---|
| 235 | mkdir -p debug |
---|
| 236 | cp -pr %{buildroot}%{_docdir}/node/* debug/ |
---|
| 237 | rm -rf %{buildroot}%{_docdir}/node |
---|
| 238 | |
---|
[7541] | 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 |
---|
| 242 | mkdir -p %{buildroot}%{_includedir}/node |
---|
| 243 | cp -p src/*.h %{buildroot}%{_includedir}/node |
---|
| 244 | |
---|
| 245 | #node-gyp needs common.gypi too |
---|
| 246 | mkdir -p %{buildroot}%{_datadir}/node |
---|
| 247 | cp -p common.gypi %{buildroot}%{_datadir}/node |
---|
| 248 | |
---|
| 249 | %files |
---|
[12228] | 250 | %license LICENSE |
---|
| 251 | %doc CHANGELOG.md README.md AUTHORS |
---|
[7541] | 252 | %{_bindir}/node |
---|
| 253 | %{_bindir}/npm |
---|
[11301] | 254 | %{_bindir}/npx |
---|
[7541] | 255 | %{_mandir}/man1/node.* |
---|
| 256 | %dir %{_prefix}/lib/node_modules |
---|
| 257 | %{_prefix}/lib/node_modules/npm |
---|
| 258 | |
---|
| 259 | %files devel |
---|
[11301] | 260 | %doc debug |
---|
[7541] | 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 |
---|
[12228] | 269 | %doc %{_docdir}/%{name}-docs-%{version} |
---|
| 270 | %license LICENSE |
---|
[7541] | 271 | |
---|
| 272 | %changelog |
---|
[12228] | 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 | |
---|
[11301] | 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. |
---|
[12228] | 282 | - added Patch0 and 1. |
---|
[11301] | 283 | |
---|
[10767] | 284 | * Fri Sep 02 2016 Toshiaki Ara <ara_t@384.jp> 0.10.26-2 |
---|
| 285 | - rebuild with gcc-5.4.0 |
---|
| 286 | |
---|
[8318] | 287 | * Mon Mar 24 2014 Daisuke SUZUKI <daisuke@linux.or.jp> 0.10.26-1 |
---|
| 288 | - update to 0.10.26 |
---|
| 289 | |
---|
[7654] | 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 | |
---|
[7570] | 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 | |
---|
[7548] | 297 | * Wed Mar 13 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.10.0-1 |
---|
| 298 | - update to 0.10.0 |
---|
| 299 | |
---|
[7541] | 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 | |
---|