%global npmname diagnostics Name: nodejs-%{npmname} Version: 2.0.2 Release: 1%{?dist} Summary: Tools for debugging your node.js modules License: MIT URL: https://www.npmjs.com/package/%{npmname} Source0: https://github.com/3rd-Eden/%{npmname}/archive/%{version}/%{name}-%{version}.tar.gz Patch0: nodejs-diagnostics-no-storage-engine.patch BuildRequires: nodejs-packaging BuildRequires: mocha BuildRequires: nodejs-assume BuildRequires: nodejs-colorspace BuildRequires: nodejs-enabled BuildRequires: nodejs-kuler BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch %description Enabled is a small utility that can check if certain namespace are enabled by environment variables which are automatically transformed to regular expressions for matching. %prep %autosetup -n %{npmname}-%{version} -p1 # Remove dependency on storage-engine. # I *think* this is only needed for use with react... # and rather than try to package all of that I'm just going # to strip the part out that depends on storage-engine. # I am not sure, but I don't believe that breaks the package. %nodejs_fixdep -r storage-engine # Remove asyncstorage adapter. Since there are other adapters... # I hope this is fine? rm -f diagnostics/adapters/asyncstorage.js %build # Nothing to build, this is a noarch package %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{npmname} cp -a diagnostics.js %{buildroot}%{nodejs_sitelib}/%{npmname}/ cp -a node adapters logger modifiers %{buildroot}%{nodejs_sitelib}/%{npmname}/ cp -a package.json %{buildroot}%{nodejs_sitelib}/%{npmname}/ %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' # Unfortunately, one of these tests does not actually work with mocha 2.4.5. # I tested that applying the patch to remove asyncstorage support # and running with a local install of mocha from npm works, so I believe # the problem is that in Fedora 31 we have mocha 2.4.5 when the package # claims to want 5.2.x. I suppose that it isn't so surprising it doesn't work... # If mocha is ever updated, I guess this could be reenabled. #mocha test/mock test/node.js %files %{nodejs_sitelib}/%{npmname}/ %license LICENSE %doc README.md example* %changelog * Tue Apr 28 2020 Ben Rosser - 2.0.2-1 - Initial package for Fedora.