nodejs-vl.spec 14 KB

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