%global npmname one-time Name: nodejs-%{npmname} Version: 1.0.0 Release: 1%{?dist} Summary: Run the supplied function exactly one time (once) License: MIT URL: https://www.npmjs.com/package/%{npmname} # Tests not included on NPM. Source0: https://github.com/3rd-Eden/one-time/archive/%{version}/%{name}-%{version}.tar.gz BuildRequires: nodejs-packaging BuildRequires: mocha BuildRequires: nodejs-assume BuildRequires: nodejs-fn-dot-name BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch %description Call the supplied function exactly one time. This prevents double callback execution. This module can be used on both Node.js, React-Native, or browsers using Browserify. No magical ES5/6 methods used unlike the once module does (except for the async version). %prep %autosetup -n one-time-%{version} %build # Nothing to build, this is a noarch package %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{npmname} cp -a index.js async.js %{buildroot}%{nodejs_sitelib}/%{npmname}/ cp -a package.json %{buildroot}%{nodejs_sitelib}/%{npmname}/ %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' mocha test.js %files %{nodejs_sitelib}/%{npmname}/ %license LICENSE %doc README.md %changelog * Tue Apr 28 2020 Ben Rosser - 1.0.0-1 - Initial package for Fedora.