source: projects/specs/trunk/n/nodejs/nodejs-vl.spec @ 7570

Revision 7570, 10.1 KB checked in by daisuke, 11 years ago (diff)

nodejs: build with internal openssl on Vine Linux 6

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