nodejs-vl.spec 14 KB

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