nodejs-vl.spec 10 KB

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