nodejs-vl.spec 11 KB

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