diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4bde761 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/node-gyp-3.4.0.tgz diff --git a/.rh-nodejs6-node-gyp.metadata b/.rh-nodejs6-node-gyp.metadata new file mode 100644 index 0000000..b4f144d --- /dev/null +++ b/.rh-nodejs6-node-gyp.metadata @@ -0,0 +1 @@ +dda558393b3ecbbe24c9e6b8703c71194c63fa36 SOURCES/node-gyp-3.4.0.tgz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +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..ced4c5b --- /dev/null +++ b/SOURCES/addon-rpm.gypi @@ -0,0 +1,44 @@ +{ + 'target_defaults': { + 'type': 'loadable_module', + 'product_prefix': '', + 'include_dirs': [ + '/opt/rh/rh-nodejs6/root/usr/include', + '/opt/rh/rh-nodejs6/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-node-dirs.patch b/SOURCES/node-gyp-node-dirs.patch new file mode 100644 index 0000000..0020d68 --- /dev/null +++ b/SOURCES/node-gyp-node-dirs.patch @@ -0,0 +1,46 @@ +diff --git a/lib/configure.js b/lib/configure.js +index 2ff476d..7a69e1c 100644 +--- a/lib/configure.js ++++ b/lib/configure.js +@@ -62,7 +62,9 @@ function configure (gyp, argv, callback) { + log.verbose('get node dir', 'compiling against --target node version: %s', release.version) + } else { + // if no --target was specified then use the current host node version ++ // if no --target was specified then use RPM installed headers + log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', release.version) ++ log.verbose('get node dir', 'no --target version specified, falling back to RPM installed headers') + } + + if (!release.semver) { +@@ -75,7 +77,7 @@ function configure (gyp, argv, callback) { + gyp.commands.install([ release.version ], function (err, version) { + if (err) return callback(err) + log.verbose('get node dir', 'target node version installed:', release.versionDir) +- nodeDir = path.resolve(gyp.devDir, release.versionDir) ++ nodeDir = '/opt/rh/rh-nodejs6/root/usr/share/node' + createBuildDir() + }) + } +@@ -247,9 +249,10 @@ 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 addon_gypi = path.resolve(__dirname, '..', 'addon.gypi') +- var common_gypi = path.resolve(nodeDir, 'include/node/common.gypi') ++ var gyp_script = '/opt/rh/rh-nodejs6/root/usr/bin/gyp' ++ 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, '/opt/rh/rh-nodejs6/root/usr/include/node/common.gypi') + fs.stat(common_gypi, function (err, stat) { + if (err) + common_gypi = path.resolve(nodeDir, 'common.gypi') +@@ -273,7 +276,7 @@ function configure (gyp, argv, callback) { + argv.push('-Dnode_lib_file=' + release.name + '.lib') + argv.push('-Dmodule_root_dir=' + process.cwd()) + argv.push('--depth=.') +- argv.push('--no-parallel') ++ //argv.push('--no-parallel') + + // tell gyp to write the Makefile/Solution files into output_dir + argv.push('--generator-output', output_dir) diff --git a/SPECS/node-gyp.spec b/SPECS/node-gyp.spec new file mode 100644 index 0000000..b2bfc18 --- /dev/null +++ b/SPECS/node-gyp.spec @@ -0,0 +1,218 @@ +%{?scl:%scl_package node-gyp} +%{!?scl:%global pkg_name %{name}} + +%{?nodejs_find_provides_and_requires} + +Name: %{?scl_prefix}node-gyp +Version: 3.4.0 +Release: 5%{?dist} +Summary: Node.js native addon build tool +License: MIT +URL: https://github.com/TooTallNate/node-gyp +Source0: http://registry.npmjs.org/node-gyp/-/node-gyp-%{version}.tgz +Source1: addon-rpm.gypi +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 + +# Merged previous patches into one +#Patch3: node-gyp-system-stuff.patch + +# Patch for v3.4.0 +Patch1: node-gyp-node-dirs.patch + +BuildRequires: %{?scl_prefix}nodejs-devel + +#gyp is the actual build framework node-gyp uses +Requires: %{?scl_prefix}gyp +#this is the standard set of headers expected to build any node native module +Requires: %{?scl_prefix}nodejs-devel %{?scl_prefix}libuv-devel %{?scl_prefix}http-parser-devel +#we also need a C++ compiler to actually build stuff +Requires: gcc-c++ +#node-gyp needs python and make too +Requires: python-devel +Requires: make + +%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 + +%patch1 -p1 + +%nodejs_fixdep --caret + +#dependencies that were not processed right by macro +%nodejs_fixdep nopt +%nodejs_fixdep npmlog +%nodejs_fixdep semver + +%build +#nothing to do + +%install + +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 + +%files +%{nodejs_sitelib}/node-gyp +%{_bindir}/node-gyp +%doc README.md LICENSE + +%changelog +* Tue Jan 17 2017 Zuzana Svetlikova - 3.4.0-5 +- Update addon.gypi +- Update patch +- Fixdep badly processed deps +- Updated with script +- Rebuild from zvetlik/rh-nodejs6 + +* Fri Jun 10 2016 Zuzana Svetlikova - 3.3.1-4 +- Resolves: #1343976 +- Merge patches into one + +* Fri Apr 08 2016 Zuzana Svetlikova - 3.3.1-3 +- Fix dependencies + +* Fri Apr 08 2016 Zuzana Svetlikova - 3.3.1-2 +- Add python and make dependencies + +* Fri Apr 08 2016 Zuzana Svetlikova - 3.3.1-1 +- Update + +* Tue Feb 23 2016 Zuzana Svetlikova - 3.2.0-7 +- Fix dependencies + +* Wed Feb 17 2016 Tomas Hrcka - 3.2.0-6 +- Rebase patches to new collection paths +- Remove --no-parallel argument from default config + +* Thu Feb 11 2016 Tomas Hrcka - 3.2.0-3 +- Disable dependency on v8314 collection + +* Mon Nov 30 2015 Tomas Hrcka - 3.2.0-2 +- New upstream release + +* Thu Jul 23 2015 Tomas Hrcka - 2.0.2-1 +- Rebase to latest upstream stable + +* Thu Jan 29 2015 Tomas Hrcka - 1.0.2-3 +- Fix dependencies versions of nopt and glob +- Backport Patch1 to new sources + +* Thu Jan 08 2015 Tomas Hrcka - 1.0.2-1 +- New upstream release + +* 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 +<<<<<<< HEAD +- require v8314-v8 + +* Thu Dec 05 2013 Tomas Hrcka - 0.10.6-2.1 +- rebuilt with gyp from v8 scl +======= +- replace dependency on nodejs010-v8 with v8314-v8 + +* Thu Dec 05 2013 Tomas Hrcka - 0.10.6-2.1 +- rebuilt with gyp from v8 collection +>>>>>>> rhscl-2.1-nodejs010-rhel-6 + +* 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