diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2814b12 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/node-gyp-0.12.2.tgz diff --git a/.nodejs010-node-gyp.metadata b/.nodejs010-node-gyp.metadata new file mode 100644 index 0000000..a84a214 --- /dev/null +++ b/.nodejs010-node-gyp.metadata @@ -0,0 +1 @@ +bdca7e7025feb308ddd7fd3434300e47703ec57a SOURCES/node-gyp-0.12.2.tgz diff --git a/README.md b/README.md deleted file mode 100644 index ce46a88..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -\ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/addon-rpm.gypi b/SOURCES/addon-rpm.gypi new file mode 100644 index 0000000..0ce8f35 --- /dev/null +++ b/SOURCES/addon-rpm.gypi @@ -0,0 +1,44 @@ +{ + 'target_defaults': { + 'type': 'loadable_module', + 'product_prefix': '', + 'include_dirs': [ + '/opt/rh/nodejs010/root/usr/include', + '/opt/rh/nodejs010/root/usr/include/node' + ], + + 'target_conditions': [ + ['_type=="loadable_module"', { + 'product_extension': 'node', + 'defines': [ 'BUILDING_NODE_EXTENSION' ], + }], + ['_type=="static_library"', { + # set to `1` to *disable* the -T thin archive 'ld' flag. + # older linkers don't support this flag. + 'standalone_static_library': '<(standalone_static_library)' + }], + ], + + 'conditions': [ + [ 'OS=="mac"', { + 'defines': [ '_DARWIN_USE_64_BIT_INODE=1' ], + 'libraries': [ '-undefined dynamic_lookup' ], + 'xcode_settings': { + 'DYLIB_INSTALL_NAME_BASE': '@rpath' + }, + }], + [ 'OS=="win"', { + 'libraries': [ '-l<(node_root_dir)/$(Configuration)/node.lib' ], + # warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent' + # needs to have dll-interface to be used by clients of class 'node::ObjectWrap' + 'msvs_disabled_warnings': [ 4251 ], + }, { + # OS!="win" + 'defines': [ '_LARGEFILE_SOURCE', '_FILE_OFFSET_BITS=64' ], + }], + [ 'OS=="freebsd" or OS=="openbsd" or OS=="solaris" or (OS=="linux" and target_arch!="ia32")', { + 'cflags': [ '-fPIC' ], + }] + ] + } +} diff --git a/SOURCES/node-gyp-addon-gypi.patch b/SOURCES/node-gyp-addon-gypi.patch new file mode 100644 index 0000000..5005c68 --- /dev/null +++ b/SOURCES/node-gyp-addon-gypi.patch @@ -0,0 +1,80 @@ +From d2dbe4c41b0f3e0608430acfbf9fc342d396f7de Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hr=C4=8Dka?= +Date: Tue, 4 Mar 2014 16:04:16 +0100 +Subject: [PATCH] use custom addon.gypi by default instead of downloading node + back port of original patch + http://pkgs.fedoraproject.org/cgit/node-gyp.git/tree/node-gyp-addon-gypi.patch + +--- + lib/configure.js | 45 +++++++++++++++++++++++---------------------- + 1 file changed, 23 insertions(+), 22 deletions(-) + +diff --git a/lib/configure.js b/lib/configure.js +index 1770e76..6829310 100644 +--- a/lib/configure.js ++++ b/lib/configure.js +@@ -129,30 +129,30 @@ function configure (gyp, argv, callback) { + // if --target was given, then determine a target version to compile for + versionStr = gyp.opts.target + log.verbose('get node dir', 'compiling against --target node version: %s', versionStr) ++ // make sure we have a valid version ++ try { ++ version = semver.parse(versionStr) ++ } catch (e) { ++ return callback(e) ++ } ++ if (!version) { ++ return callback(new Error('Invalid version number: ' + versionStr)) ++ } ++ // ensure that the target node version's dev files are installed ++ gyp.opts.ensure = true ++ gyp.commands.install([ versionStr ], function (err, version) { ++ if (err) return callback(err) ++ log.verbose('get node dir', 'target node version installed:', version) ++ nodeDir = path.resolve(gyp.devDir, version) ++ createBuildDir() ++ }) + } else { +- // if no --target was specified then use the current host node version +- versionStr = process.version +- log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', versionStr) ++ // if no --target was specified then use RPM-installed headers ++ log.verbose('get node dir', 'no --target version specified, falling back to RPM installed headers') ++ nodeDir = '/opt/rh/nodejs010/root/usr/share/node' ++ createBuildDir() + } + +- // make sure we have a valid version +- try { +- version = semver.parse(versionStr) +- } catch (e) { +- return callback(e) +- } +- if (!version) { +- return callback(new Error('Invalid version number: ' + versionStr)) +- } +- +- // ensure that the target node version's dev files are installed +- gyp.opts.ensure = true +- gyp.commands.install([ versionStr ], function (err, version) { +- if (err) return callback(err) +- log.verbose('get node dir', 'target node version installed:', version) +- nodeDir = path.resolve(gyp.devDir, version) +- createBuildDir() +- }) + } + } + +@@ -296,7 +296,8 @@ function configure (gyp, argv, callback) { + + // this logic ported from the old `gyp_addon` python file + var gyp_script = '/opt/rh/v8314/root/usr/bin/gyp' +- var addon_gypi = path.resolve(__dirname, '..', 'addon.gypi') ++ var addon_gypi_file = gyp.opts.target || gyp.opts.nodeDir ? 'addon.gypi' : 'addon-rpm.gypi' ++ var addon_gypi = path.resolve(__dirname, '..', addon_gypi_file) + var common_gypi = path.resolve(nodeDir, 'common.gypi') + var output_dir = 'build' + if (win) { +-- +1.8.3.1 + diff --git a/SOURCES/node-gyp-use-system-gyp.patch b/SOURCES/node-gyp-use-system-gyp.patch new file mode 100644 index 0000000..9cb8d91 --- /dev/null +++ b/SOURCES/node-gyp-use-system-gyp.patch @@ -0,0 +1,25 @@ +From 7fda2be94434dde9698cbd7fb4f48eb6a42e09d9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hr=C4=8Dka?= +Date: Thu, 16 Jan 2014 13:35:22 +0100 +Subject: [PATCH] Use system gyp + +--- + lib/configure.js | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/configure.js b/lib/configure.js +index e101a31..1770e76 100644 +--- a/lib/configure.js ++++ b/lib/configure.js +@@ -295,7 +295,7 @@ function configure (gyp, argv, callback) { + }) + + // this logic ported from the old `gyp_addon` python file +- var gyp_script = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py') ++ var gyp_script = '/opt/rh/v8314/root/usr/bin/gyp' + var addon_gypi = path.resolve(__dirname, '..', 'addon.gypi') + var common_gypi = path.resolve(nodeDir, 'common.gypi') + var output_dir = 'build' +-- +1.8.3.1 + diff --git a/SPECS/node-gyp.spec b/SPECS/node-gyp.spec new file mode 100644 index 0000000..0353eef --- /dev/null +++ b/SPECS/node-gyp.spec @@ -0,0 +1,161 @@ +%{?scl:%scl_package node-gyp} +%{!?scl:%global pkg_name %{name}} + +%{?nodejs_find_provides_and_requires} + +Name: %{?scl_prefix}node-gyp +Version: 0.12.2 +Release: 2%{?dist} +Summary: Node.js native addon build tool +License: MIT +Group: System Environment/Libraries +URL: https://github.com/TooTallNate/node-gyp +Source0: http://registry.npmjs.org/node-gyp/-/node-gyp-%{version}.tgz +Source1: addon-rpm.gypi +BuildRoot: %{_tmppath}/%{pkg_name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch + +# These patches are Fedora-specific for the moment, although I'd like to find +# a way to support this kind of stuff upstream. +Patch1: node-gyp-addon-gypi.patch +# use RPM installed headers by default instead of downloading a source tree +# for the currently running node version +#use gyp from scl +Patch2: node-gyp-use-system-gyp.patch +BuildRequires: %{?scl_prefix}nodejs-devel + +#gyp is the actual build framework node-gyp uses +Requires: v8314-gyp +#this is the standard set of headers expected to build any node native module +Requires: %{?scl_prefix}nodejs-devel v8314-v8-devel %{?scl_prefix}libuv-devel %{?scl_prefix}http-parser-devel +#we also need a C++ compiler to actually build stuff ;-) +Requires: gcc-c++ + +%description +node-gyp is a cross-platform command-line tool written in Node.js for compiling +native addon modules for Node.js, which takes away the pain of dealing with the +various differences in build platforms. It is the replacement to the node-waf +program which is removed for node v0.8. + +%prep +%setup -q -n package + +%patch2 -p1 +%patch1 -p1 +%nodejs_fixdep request 2.x +%nodejs_fixdep semver 2.1 + +%build +#nothing to do + +%install +rm -rf %{buildroot} + +mkdir -p %{buildroot}%{nodejs_sitelib}/node-gyp +cp -pr addon*.gypi bin lib package.json %{buildroot}%{nodejs_sitelib}/node-gyp +cp -p %{SOURCE1} %{buildroot}%{nodejs_sitelib}/node-gyp/addon-rpm.gypi + +mkdir -p %{buildroot}%{_bindir} +ln -sf ../lib/node_modules/node-gyp/bin/node-gyp.js %{buildroot}%{_bindir}/node-gyp + +%nodejs_symlink_deps + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%{nodejs_sitelib}/node-gyp +%{_bindir}/node-gyp +%doc README.md LICENSE + +%changelog +* Tue Mar 04 2014 Tomas Hrcka - 0.12.2-2 +- Fix addon-rpm-gypi +- Backport patch to new sources + +* Thu Jan 16 2014 Tomas Hrcka - 0.12.2-1 +- New upstream release + +* Tue Jan 14 2014 Tomas Hrcka - 0.10.6-2.3 +- use proper path for gyp since its comming from v8 collection + +* Thu Jan 09 2014 Tomas Hrcka - 0.10.6-2.2 +- require v8314-v8 + +* Thu Dec 05 2013 Tomas Hrcka - 0.10.6-2.1 +- rebuilt with gyp from v8 scl + +* Tue Jul 30 2013 T.C. Hollingsworth - 0.10.6-2 +- fix semver dep + +* Fri Jul 12 2013 T.C. Hollingsworth - 0.10.6-1 +- new upstream release 0.10.6 + +* Sat Jun 22 2013 T.C. Hollingsworth - 0.10.1-1 +- new upstream release 0.10.1 + +* Sat Jun 22 2013 T.C. Hollingsworth - 0.9.5-3 +- restrict to compatible arches + +* Fri Apr 19 2013 Stanislav Ochotnicky - 0.9.5-3 +- Use proper prefixed paths for gyp + +* Mon Apr 15 2013 T.C. Hollingsworth - 0.9.5-2 +- add macro for EPEL6 dependency generation + +* Fri Apr 12 2013 Stanislav Ochotnicky - 0.9.5-2 +- Add support for software collections + +* Wed Apr 03 2013 T.C. Hollingsworth - 0.9.5-1 +- new upstream release 0.9.5 + +* Wed Mar 13 2013 T.C. Hollingsworth - 0.9.1-2 +- update addon-rpm.gypi +- split out addon-rpm.gypi so it's easier to maintain + +* Wed Mar 13 2013 T.C. Hollingsworth - 0.9.1-1 +- new upstream release 0.9.1 + +* Sat Feb 09 2013 T.C. Hollingsworth - 0.8.4-1 +- new upstream release 0.8.4 + +* Mon Jan 21 2013 T.C. Hollingsworth - 0.8.3-1 +- new upstream release 0.8.3 +- add missing Requires on http-parser-devel + +* Tue Jan 08 2013 T.C. Hollingsworth - 0.8.2-3 +- add missing build section + +* Sat Jan 05 2013 T.C. Hollingsworth - 0.8.2-2 +- use RPM-installed headers by default +- now patched to use the system gyp instead of relying on a symlink + +* Mon Dec 31 2012 T.C. Hollingsworth - 0.8.2-1 +- new upstream release 0.8.2 +- clean up for submission + +* Thu Apr 26 2012 T.C. Hollingsworth - 0.4.1-2 +- fix dependencies + +* Wed Apr 18 2012 T.C. Hollingsworth - 0.4.1-1 +- New upstream release 0.4.1 + +* Fri Apr 06 2012 T.C. Hollingsworth - 0.3.11-1 +- New upstream release 0.3.11 + +* Mon Apr 02 2012 T.C. Hollingsworth - 0.3.10-1 +- New upstream release 0.3.10 + +* Thu Mar 29 2012 T.C. Hollingsworth - 0.3.9-1 +- New upstream release 0.3.9 + +* Wed Mar 28 2012 T.C. Hollingsworth - 0.3.8-1 +- new upstream release 0.3.8 + +* Thu Mar 22 2012 T.C. Hollingsworth - 0.3.7-1 +- new upstream release 0.3.7 + +* Thu Mar 15 2012 T.C. Hollingsworth - 0.3.5-1 +- initial package