nodejs-spdx-license-ids/nodejs-spdx-license-ids.spec
2020-08-21 17:49:31 +08:00

53 lines
1.4 KiB
RPMSpec

%global npm_name spdx-license-ids
%{?nodejs_find_provides_and_requires}
%global enable_tests 0
Name: nodejs-spdx-license-ids
Version: 1.2.0
Release: 1
Summary: A list of SPDX license identifiers
Url: https://github.com/shinnn/spdx-license-ids
Source0: https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-%{version}.tgz
Source1: https://spdx.org/licenses/licenses.json
Source2: https://raw.githubusercontent.com/shinnn/spdx-license-ids/v1.2.0/test.js
License: Unlicense
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: jq nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(rimraf) npm(tape)
%endif
%description
A list of SPDX license identifiers
%prep
%setup -q -n package
cp -p %{SOURCE1} .
cp -p %{SOURCE2} .
chmod -x README.md
rm spdx-license-ids.json
%build
%{_bindir}/jq '[.licenses[].licenseId] | map(select(endswith("+")|not))' licenses.json > spdx-license-ids.json
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name}
cp -pr package.json spdx-license-ids.json %{buildroot}%{nodejs_sitelib}/%{npm_name}
%{nodejs_symlink_deps}
%check
%{nodejs_symlink_deps} --check
%{__nodejs} -e 'require("./")'
%if 0%{?enable_tests}
%{__nodejs} --harmony_arrow_functions test.js
%endif
%files
%{!?_licensedir:%global license %doc}
%{nodejs_sitelib}/spdx-license-ids
%doc README.md
%license LICENSE
%changelog
* Fri Aug 21 2020 wangchong <wangchong56@huawei.com> - 1.2.0-1
- package init