nodejs-hash_file/nodejs-hash_file.spec
2020-08-20 19:47:13 +08:00

43 lines
1013 B
RPMSpec

%global enable_tests 1
%global srcname hash_file
Name: nodejs-%{srcname}
Version: 0.1.1
Release: 1
Summary: A simple utility for getting a hash of a file
License: MIT
URL: https://github.com/timoxley/hash_file
Source0: https://registry.npmjs.org/%{srcname}/-/%{srcname}-%{version}.tgz
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(mocha)
%endif
%description
%{summary}.
%prep
%setup -q -n package
rm -rf node_modules/
%build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{srcname}
cp -pr package.json *.js %{buildroot}%{nodejs_sitelib}/%{srcname}
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
mocha -t 60000 ./test/test.js
%endif
%files
%doc README.md
%{nodejs_sitelib}/%{srcname}
%changelog
* Thu Aug 20 2020 wangxiao <wangxiao65@huawei.com> - 0.1.1-1
- Package init