%global node_gyp_nodejs_major_ver %(node --version | cut -d . -f 1 | cut -c 2-) # remove versionless requires %global __requires_exclude_from %{nodejs_sitelib}/%{name}/package.json Name: node-gyp Version: 13.0.1 Release: 1%{?dist} Summary: Node.js native addon build tool License: Apache-2.0 AND BlueOak-1.0.0 AND ISC AND MIT URL: https://github.com/nodejs/node-gyp # Use github source because nodejs-packaging-bundler strips tests Source0: https://github.com/nodejs/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz Source1: %{name}-%{version}-nm-prod.tgz Source2: %{name}-%{version}-nm-dev.tgz Source3: %{name}-%{version}-bundled-licenses.txt Source4: addon-rpm.gypi # Use system gyp and nodejs-devel # Upstream status: Not going upstream, Fedora specific Patch1: %{name}-system-node-gyp.patch # Disable tests that require network access # Upstream status: Not going upstream, Fedora specific Patch2: %{name}-tests.patch BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch Requires: gcc-c++ Requires: gyp Requires: (nodejs22-devel or nodejs24-devel or nodejs26-devel) BuildRequires: /usr/bin/node BuildRequires: (nodejs22-devel or nodejs24-devel or nodejs26-devel) BuildRequires: npm # for tests BuildRequires: gcc-c++ BuildRequires: gyp %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 %autosetup -p1 sed -i 's~/usr/share/node~/usr/share/node-%{node_gyp_nodejs_major_ver}~' lib/configure.js cp -p %{SOURCE3} . cp -p %{SOURCE4} addon-rpm.gypi # Setup bundled runtime(prod) node modules tar xfz %{SOURCE1} mkdir -p node_modules pushd node_modules ln -s ../node_modules_prod/* . ln -s ../node_modules_prod/.bin . popd # remove bundled gyp-next rm -r gyp/ %build %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{name} cp -rp package.json addon.gypi addon-rpm.gypi bin/ lib/ \ %{buildroot}%{nodejs_sitelib}/%{name} cp -rp node_modules node_modules_prod \ %{buildroot}%{nodejs_sitelib}/%{name} mkdir -p %{buildroot}%{_bindir} chmod 0755 %{buildroot}%{nodejs_sitelib}/%{name}/bin/node-gyp.js ln -sf %{nodejs_sitelib}/%{name}/bin/node-gyp.js %{buildroot}%{_bindir}/%{name} %check %{__nodejs} -e 'require("./")' mv node_modules node_modules_orig tar xfz %{SOURCE2} mv node_modules_dev node_modules npm test %files %doc README.md CHANGELOG.md %license LICENSE %{name}-%{version}-bundled-licenses.txt %{nodejs_sitelib}/%{name} %{_bindir}/%{name} %changelog * Sun Aug 23 2026 Michael Cronenworth - 13.0.1-1 - Package review changes * Mon Aug 17 2026 Michael Cronenworth - 13.0.1-0.1 - Version update * Sat Jan 31 2026 Michael Cronenworth - 12.2.0-0.1 - Version update * Thu Nov 21 2024 Michael Cronenworth - 10.2.0-0.1 - Initial spec