nodejs-js-yaml/nodejs-js-yaml.spec

58 lines
1.6 KiB
RPMSpec
Raw Normal View History

2020-09-01 13:56:32 +08:00
%{?nodejs_find_provides_and_requires}
%global enable_tests 1
Name: nodejs-js-yaml
Version: 3.10.0
Release: 1
Summary: YAML 1.2 parser and serializer
License: MIT
URL: https://github.com/nodeca/js-yaml
2020-09-07 16:36:28 +08:00
Source0: https://github.com/nodeca/js-yaml/archive/%{version}.tar.gz
2020-09-01 13:56:32 +08:00
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(esprima) npm(mocha)
%endif
%description
This is an implementation of YAML (YAML Ain't Markup Language), a human
friendly data serialization language. It started as PyYAML port, and was
completely rewritten from scratch. Now it's very fast, and supports the
1.2 spec.
%prep
2020-09-07 16:36:28 +08:00
%autosetup -n js-yaml-%{version}
2020-09-01 13:56:32 +08:00
sed -i '1s/env //' bin/js-yaml.js
%nodejs_fixdep esprima
%build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/js-yaml
cp -pr package.json index.js lib/ \
%{buildroot}%{nodejs_sitelib}/js-yaml
mkdir -p %{buildroot}%{nodejs_sitelib}/js-yaml/bin
install -p -D -m0755 bin/js-yaml.js \
%{buildroot}%{nodejs_sitelib}/js-yaml/bin/js-yaml.js
mkdir -p %{buildroot}%{_bindir}
ln -sf %{nodejs_sitelib}/js-yaml/bin/js-yaml.js \
%{buildroot}%{_bindir}/js-yaml
%nodejs_symlink_deps
%check
%nodejs_symlink_deps --check
%{__nodejs} -e 'require("./")'
%if 0%{?enable_tests}
NODE_ENV=test %{_bindir}/mocha -R spec
%endif
%files
%{!?_licensedir:%global license %doc}
%doc README.md CHANGELOG.md examples/
%license LICENSE
%{nodejs_sitelib}/js-yaml
%{_bindir}/js-yaml
%changelog
* Thu Aug 20 2020 wangxiao <wangxiao65@huawei.com> - 3.10.0-1
- Package init