Initial import (#815018).

This commit is contained in:
Stephen Gallagher 2012-12-18 08:51:29 -05:00
parent 91fc113fe8
commit cdb693ef29
7 changed files with 507 additions and 0 deletions

1
.gitignore vendored
View file

@ -0,0 +1 @@
/node-v0.9.3.tar.gz

View file

@ -0,0 +1,117 @@
From 0fc5e8b88b7ac7e47deb689e866836434792224e Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Tue, 23 Oct 2012 09:01:26 -0400
Subject: [PATCH 1/3] build: allow linking against system http_parser
---
configure | 35 +++++++++++++++++++++++++++++++++++
doc/api/process.markdown | 1 +
node.gyp | 6 +++++-
3 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 1f1343441a5f5fb00bfab2b3b1ec6475820efa13..1fa522755de68a0eb182dde110b8c4a1a8f4aa7c 100755
--- a/configure
+++ b/configure
@@ -124,6 +124,26 @@ parser.add_option("--shared-zlib-libname",
dest="shared_zlib_libname",
help="Alternative lib name to link to (default: 'z')")
+parser.add_option("--shared-http-parser",
+ action="store_true",
+ dest="shared_http_parser",
+ help="Link to a shared http_parser DLL instead of static linking")
+
+parser.add_option("--shared-http-parser-includes",
+ action="store",
+ dest="shared_http_parser_includes",
+ help="Directory containing http_parser header files")
+
+parser.add_option("--shared-http-parser-libpath",
+ action="store",
+ dest="shared_http_parser_libpath",
+ help="A directory to search for the shared http_parser DLL")
+
+parser.add_option("--shared-http-parser-libname",
+ action="store",
+ dest="shared_http_parser_libname",
+ help="Alternative lib name to link to (default: 'http_parser')")
+
parser.add_option("--with-dtrace",
action="store_true",
dest="with_dtrace",
@@ -400,6 +420,20 @@ def configure_libz(o):
o['include_dirs'] += [options.shared_zlib_includes]
+def configure_http_parser(o):
+ o['variables']['node_shared_http_parser'] = b(options.shared_http_parser)
+
+ # assume shared http_parser if one of these is set?
+ if options.shared_http_parser_libpath:
+ o['libraries'] += ['-L%s' % options.shared_http_parser_libpath]
+ if options.shared_http_parser_libname:
+ o['libraries'] += ['-l%s' % options.shared_http_parser_libname]
+ elif options.shared_http_parser:
+ o['libraries'] += ['-lhttp_parser']
+ if options.shared_http_parser_includes:
+ o['include_dirs'] += [options.shared_http_parser_includes]
+
+
def configure_v8(o):
o['variables']['v8_use_snapshot'] = b(not options.without_snapshot)
o['variables']['node_shared_v8'] = b(options.shared_v8)
@@ -453,6 +487,7 @@ output = {
configure_node(output)
configure_libz(output)
+configure_http_parser(output)
configure_v8(output)
configure_openssl(output)
diff --git a/doc/api/process.markdown b/doc/api/process.markdown
index d8612600c6530b3febe9316b3230412d450a2ca5..41b163a15532f829a7d6c2b88ae9a9f31de0a9c8 100644
--- a/doc/api/process.markdown
+++ b/doc/api/process.markdown
@@ -299,6 +299,7 @@ An example of the possible output looks like:
{ host_arch: 'x64',
node_install_npm: 'true',
node_prefix: '',
+ node_shared_http_parser: 'false',
node_shared_v8: 'false',
node_shared_zlib: 'false',
node_use_dtrace: 'false',
diff --git a/node.gyp b/node.gyp
index 939870a56157ab4410cd668be36689d092894ca1..a9903cd1c42cab4295d79d452ef1187c7fa7dbe3 100644
--- a/node.gyp
+++ b/node.gyp
@@ -8,6 +8,7 @@
'node_use_etw%': 'false',
'node_shared_v8%': 'false',
'node_shared_zlib%': 'false',
+ 'node_shared_http_parser%': 'false',
'node_use_openssl%': 'true',
'node_shared_openssl%': 'false',
'library_files': [
@@ -58,7 +59,6 @@
'dependencies': [
'deps/cares/cares.gyp:cares',
- 'deps/http_parser/http_parser.gyp:http_parser',
'deps/uv/uv.gyp:libuv',
'node_js2c#host',
],
@@ -192,6 +192,10 @@
'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ],
}],
+ [ 'node_shared_http_parser=="false"', {
+ 'dependencies': [ 'deps/http_parser/http_parser.gyp:http_parser' ],
+ }],
+
[ 'OS=="win"', {
'sources': [
'src/res/node.rc',
--
1.8.0

View file

@ -0,0 +1,117 @@
From a82e1d2bf3b5f2208ceddd1f5a51396a4997fb66 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Tue, 23 Oct 2012 10:27:19 -0400
Subject: [PATCH 2/3] build: allow linking against system c-ares
---
configure | 35 +++++++++++++++++++++++++++++++++++
doc/api/process.markdown | 1 +
node.gyp | 6 +++++-
3 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 1fa522755de68a0eb182dde110b8c4a1a8f4aa7c..a23c04cb77fda65453e4cbe9c916d3d3f14f3d26 100755
--- a/configure
+++ b/configure
@@ -144,6 +144,26 @@ parser.add_option("--shared-http-parser-libname",
dest="shared_http_parser_libname",
help="Alternative lib name to link to (default: 'http_parser')")
+parser.add_option("--shared-cares",
+ action="store_true",
+ dest="shared_cares",
+ help="Link to a shared cares DLL instead of static linking")
+
+parser.add_option("--shared-cares-includes",
+ action="store",
+ dest="shared_cares_includes",
+ help="Directory containing cares header files")
+
+parser.add_option("--shared-cares-libpath",
+ action="store",
+ dest="shared_cares_libpath",
+ help="A directory to search for the shared cares DLL")
+
+parser.add_option("--shared-cares-libname",
+ action="store",
+ dest="shared_cares_libname",
+ help="Alternative lib name to link to (default: 'cares')")
+
parser.add_option("--with-dtrace",
action="store_true",
dest="with_dtrace",
@@ -434,6 +454,20 @@ def configure_http_parser(o):
o['include_dirs'] += [options.shared_http_parser_includes]
+def configure_cares(o):
+ o['variables']['node_shared_cares'] = b(options.shared_cares)
+
+ # assume shared cares if one of these is set?
+ if options.shared_cares_libpath:
+ o['libraries'] += ['-L%s' % options.shared_cares_libpath]
+ if options.shared_cares_libname:
+ o['libraries'] += ['-l%s' % options.shared_cares_libname]
+ elif options.shared_cares:
+ o['libraries'] += ['-lcares']
+ if options.shared_cares_includes:
+ o['include_dirs'] += [options.shared_cares_includes]
+
+
def configure_v8(o):
o['variables']['v8_use_snapshot'] = b(not options.without_snapshot)
o['variables']['node_shared_v8'] = b(options.shared_v8)
@@ -488,6 +522,7 @@ output = {
configure_node(output)
configure_libz(output)
configure_http_parser(output)
+configure_cares(output)
configure_v8(output)
configure_openssl(output)
diff --git a/doc/api/process.markdown b/doc/api/process.markdown
index 41b163a15532f829a7d6c2b88ae9a9f31de0a9c8..1593eec879ff5141d13cee548df4675e9a18213c 100644
--- a/doc/api/process.markdown
+++ b/doc/api/process.markdown
@@ -299,6 +299,7 @@ An example of the possible output looks like:
{ host_arch: 'x64',
node_install_npm: 'true',
node_prefix: '',
+ node_shared_cares: 'false',
node_shared_http_parser: 'false',
node_shared_v8: 'false',
node_shared_zlib: 'false',
diff --git a/node.gyp b/node.gyp
index a9903cd1c42cab4295d79d452ef1187c7fa7dbe3..ca1a9f30503c40099fe4d1770887750fb681d5b9 100644
--- a/node.gyp
+++ b/node.gyp
@@ -9,6 +9,7 @@
'node_shared_v8%': 'false',
'node_shared_zlib%': 'false',
'node_shared_http_parser%': 'false',
+ 'node_shared_cares%': 'false',
'node_use_openssl%': 'true',
'node_shared_openssl%': 'false',
'library_files': [
@@ -58,7 +59,6 @@
'type': 'executable',
'dependencies': [
- 'deps/cares/cares.gyp:cares',
'deps/uv/uv.gyp:libuv',
'node_js2c#host',
],
@@ -196,6 +196,10 @@
'dependencies': [ 'deps/http_parser/http_parser.gyp:http_parser' ],
}],
+ [ 'node_shared_cares=="false"', {
+ 'dependencies': [ 'deps/cares/cares.gyp:cares' ],
+ }],
+
[ 'OS=="win"', {
'sources': [
'src/res/node.rc',
--
1.8.0

View file

@ -0,0 +1,117 @@
From c11c6c57eb3f87d32207bf5e86a2e53cbabc8a60 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Tue, 23 Oct 2012 19:54:22 -0400
Subject: [PATCH 3/3] build: allow linking against system libuv
---
configure | 35 +++++++++++++++++++++++++++++++++++
doc/api/process.markdown | 1 +
node.gyp | 6 +++++-
3 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index a23c04cb77fda65453e4cbe9c916d3d3f14f3d26..9461d791ec63a63a7271dd3c99ebdf5456032187 100755
--- a/configure
+++ b/configure
@@ -164,6 +164,26 @@ parser.add_option("--shared-cares-libname",
dest="shared_cares_libname",
help="Alternative lib name to link to (default: 'cares')")
+parser.add_option("--shared-libuv",
+ action="store_true",
+ dest="shared_libuv",
+ help="Link to a shared libuv DLL instead of static linking")
+
+parser.add_option("--shared-libuv-includes",
+ action="store",
+ dest="shared_libuv_includes",
+ help="Directory containing libuv header files")
+
+parser.add_option("--shared-libuv-libpath",
+ action="store",
+ dest="shared_libuv_libpath",
+ help="A directory to search for the shared libuv DLL")
+
+parser.add_option("--shared-libuv-libname",
+ action="store",
+ dest="shared_libuv_libname",
+ help="Alternative lib name to link to (default: 'uv')")
+
parser.add_option("--with-dtrace",
action="store_true",
dest="with_dtrace",
@@ -468,6 +488,20 @@ def configure_cares(o):
o['include_dirs'] += [options.shared_cares_includes]
+def configure_libuv(o):
+ o['variables']['node_shared_libuv'] = b(options.shared_libuv)
+
+ # assume shared libuv if one of these is set?
+ if options.shared_libuv_libpath:
+ o['libraries'] += ['-L%s' % options.shared_libuv_libpath]
+ if options.shared_libuv_libname:
+ o['libraries'] += ['-l%s' % options.shared_libuv_libname]
+ elif options.shared_libuv:
+ o['libraries'] += ['-luv']
+ if options.shared_libuv_includes:
+ o['include_dirs'] += [options.shared_libuv_includes]
+
+
def configure_v8(o):
o['variables']['v8_use_snapshot'] = b(not options.without_snapshot)
o['variables']['node_shared_v8'] = b(options.shared_v8)
@@ -523,6 +557,7 @@ configure_node(output)
configure_libz(output)
configure_http_parser(output)
configure_cares(output)
+configure_libuv(output)
configure_v8(output)
configure_openssl(output)
diff --git a/doc/api/process.markdown b/doc/api/process.markdown
index 1593eec879ff5141d13cee548df4675e9a18213c..d479238f197e67972ad00412b6ba39eb78e93fa5 100644
--- a/doc/api/process.markdown
+++ b/doc/api/process.markdown
@@ -301,6 +301,7 @@ An example of the possible output looks like:
node_prefix: '',
node_shared_cares: 'false',
node_shared_http_parser: 'false',
+ node_shared_libuv: 'false',
node_shared_v8: 'false',
node_shared_zlib: 'false',
node_use_dtrace: 'false',
diff --git a/node.gyp b/node.gyp
index ca1a9f30503c40099fe4d1770887750fb681d5b9..3366535cc70751ca6d591a3428e1acdbb7e0d9c1 100644
--- a/node.gyp
+++ b/node.gyp
@@ -10,6 +10,7 @@
'node_shared_zlib%': 'false',
'node_shared_http_parser%': 'false',
'node_shared_cares%': 'false',
+ 'node_shared_libuv%': 'false',
'node_use_openssl%': 'true',
'node_shared_openssl%': 'false',
'library_files': [
@@ -59,7 +60,6 @@
'type': 'executable',
'dependencies': [
- 'deps/uv/uv.gyp:libuv',
'node_js2c#host',
],
@@ -200,6 +200,10 @@
'dependencies': [ 'deps/cares/cares.gyp:cares' ],
}],
+ [ 'node_shared_libuv=="false"', {
+ 'dependencies': [ 'deps/uv/uv.gyp:libuv' ],
+ }],
+
[ 'OS=="win"', {
'sources': [
'src/res/node.rc',
--
1.8.0

View file

@ -0,0 +1,25 @@
From 93eb51852e0d9cdf5aebc6212eee5cb3273ddbc4 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Fri, 14 Dec 2012 08:33:47 -0500
Subject: [PATCH 4/4] Build debugging symbols by default
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index 9461d791ec63a63a7271dd3c99ebdf5456032187..ff3e75fd655ad4431dd402a200dbb810bc00eba2 100755
--- a/configure
+++ b/configure
@@ -550,7 +550,7 @@ output = {
'include_dirs': [],
'libraries': [],
'defines': [],
- 'cflags': [],
+ 'cflags': ['-g'],
}
configure_node(output)
--
1.8.0.1

129
nodejs.spec Normal file
View file

@ -0,0 +1,129 @@
Name: nodejs
Version: 0.9.3
Release: 6%{?dist}
Summary: JavaScript runtime
License: MIT and ASL 2.0 and ISC and BSD
Group: Development/Languages
URL: http://nodejs.org/
Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
BuildRequires: v8-devel
BuildRequires: http-parser-devel >= 2.0
BuildRequires: libuv-devel
BuildRequires: c-ares-devel
BuildRequires: findutils
BuildRequires: zlib-devel
# Node.js requires some features from openssl 1.0.1 for SPDY support
BuildRequires: openssl-devel >= 1:1.0.1
# Node.js currently has a conflict with the 'node' package in Fedora
# The ham-radio group has agreed to rename their binary for us, but
# in the meantime, we're setting an explicit Conflicts: here
Conflicts: node <= 0.3.2-11
# Patches
# The following patches have been accepted upstream and can
# be removed once node.js 0.9.4 is released
Patch0001: 0001-build-allow-linking-against-system-http_parser.patch
Patch0002: 0002-build-allow-linking-against-system-c-ares.patch
Patch0003: 0003-build-allow-linking-against-system-libuv.patch
# This patch is Fedora-specific and allows building the release
# binaries with debugging symbols
Patch0004: 0004-Build-debugging-symbols-by-default.patch
%description
Node.js is a platform built on Chrome's JavaScript runtime
for easily building fast, scalable network applications.
Node.js uses an event-driven, non-blocking I/O model that
makes it lightweight and efficient, perfect for data-intensive
real-time applications that run across distributed devices.
%prep
%setup -q -n node-v%{version}
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
%patch0004 -p1
# Make sure nothing gets included from bundled deps:
# We only delete the source and header files, because
# the remaining build scripts are still used.
find deps/cares -name "*.c" -exec rm -f {} \;
find deps/cares -name "*.h" -exec rm -f {} \;
find deps/npm -name "*.c" -exec rm -f {} \;
find deps/npm -name "*.h" -exec rm -f {} \;
find deps/zlib -name "*.c" -exec rm -f {} \;
find deps/zlib -name "*.h" -exec rm -f {} \;
find deps/v8 -name "*.c" -exec rm -f {} \;
find deps/v8 -name "*.h" -exec rm -f {} \;
find deps/http_parser -name "*.c" -exec rm -f {} \;
find deps/http_parser -name "*.h" -exec rm -f {} \;
find deps/openssl -name "*.c" -exec rm -f {} \;
find deps/openssl -name "*.h" -exec rm -f {} \;
find deps/uv -name "*.c" -exec rm -f {} \;
find deps/uv -name "*.h" -exec rm -f {} \;
%build
./configure --prefix=%{_prefix} \
--shared-v8 \
--shared-openssl \
--shared-zlib \
--shared-cares \
--shared-libuv \
--shared-http-parser \
--without-npm \
--without-dtrace
make %{?_smp_mflags}
%install
rm -rf %{buildroot}
%make_install INSTALL='install -p'
# and remove dtrace file again
rm -rf %{buildroot}/%{_prefix}/lib/dtrace
# Set the binary permissions properly
chmod 0755 %{buildroot}/%{_bindir}/node
%clean
rm -rf $RPM_BUILD_ROOT
%files
%doc ChangeLog LICENSE README.md AUTHORS
%{_bindir}/node
%{_mandir}/man1/node.*
%changelog
* Fri Dec 14 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-6
* Thu Dec 13 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-5
- Return back to using the standard binary name
- Temporarily adding a conflict against the ham radio node package until they
complete an agreed rename of their binary.
* Wed Nov 28 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-4
- Rename binary and manpage to nodejs
* Mon Nov 19 2012 Stephen Gallagher <sgallagh@redhat.com> - 0.9.3-3
- Update to latest upstream development release 0.9.3
- Include upstreamed patches to unbundle dependent libraries
* Tue Oct 23 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.8.12-1
- Fixes and Patches suggested by Matthias Runge
* Mon Apr 09 2012 Adrian Alves <alvesadrian@fedoraproject.org> 0.6.5
- First build.

View file

@ -0,0 +1 @@
4a7576567ddd8bb13b763d578d9481f0 node-v0.9.3.tar.gz