nodejs-vl.spec 11 KB

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