nodejs-underscore/nodejs-underscore.spec

71 lines
2.2 KiB
RPMSpec
Raw Normal View History

2020-08-28 11:58:01 +08:00
%{?nodejs_find_provides_and_requires}
%global enable_tests 0
%global installdir %{_jsdir}/underscore
Name: nodejs-underscore
2023-10-30 11:45:59 +08:00
Version: 1.13.6
Release: 1
2020-08-28 11:58:01 +08:00
Summary: JavaScript's functional programming helper library
License: MIT
2020-09-08 09:54:48 +08:00
URL: http://github.com/jashkenas/underscore
2023-10-30 11:45:59 +08:00
Source0: https://github.com/jashkenas/underscore/archive/%{version}/underscore-%{version}.tar.gz
2020-08-28 11:58:01 +08:00
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: web-assets-devel
BuildRequires: nodejs-packaging uglify-js
%if 0%{?enable_tests}
BuildRequires: npm(phantomjs)
%endif
%description
Underscore.js is a utility-belt library for JavaScript that provides support
for the usual functional suspects (each, map, reduce, filter...) without
extending any core JavaScript objects.
%package -n js-underscore
Summary: JavaScript's functional programming helper library
Requires: web-assets-filesystem
%description -n js-underscore
Underscore.js is a utility-belt library for JavaScript that provides support
for the usual functional suspects (each, map, reduce, filter...) without
extending any core JavaScript objects.
%prep
2020-09-08 09:54:48 +08:00
%autosetup -n underscore-%{version}
2020-08-28 11:58:01 +08:00
%build
2023-10-30 11:45:59 +08:00
/usr/bin/uglifyjs underscore.js -m --source-map -o underscore-min.js
2020-08-28 11:58:01 +08:00
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/underscore
2023-10-30 11:45:59 +08:00
cp -pr package.json underscore*.js underscore*.cjs underscore*.map \
2020-08-28 11:58:01 +08:00
%{buildroot}%{nodejs_sitelib}/underscore
2023-10-30 11:45:59 +08:00
2020-08-28 11:58:01 +08:00
mkdir -p %{buildroot}%{installdir}
2023-10-30 11:45:59 +08:00
cp -pr underscore.js underscore-min.js underscore-min.js.map \
2020-08-28 11:58:01 +08:00
%{buildroot}%{installdir}
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%{nodejs_sitelib}/phantomjs/bin/phantomjs \
test/vendor/runner.js test/index.html?noglobals=true
%endif
%files
%doc LICENSE README.md
%{nodejs_sitelib}/underscore
%files -n js-underscore
%doc LICENSE README.md
%{installdir}
%changelog
2023-10-30 11:45:59 +08:00
* Mon Oct 30 2023 wulei <wu_lei@hoperun.com> - 1.13.6-1
- Update to 1.13.6
2021-04-13 23:01:36 +08:00
* Fri Apr 16 2021 wangxiao <wangxiao65@huawei.com> - 1.9.1-2
- Fix CVE-2021-23358
2020-08-28 11:58:01 +08:00
* Thu Aug 20 2020 zhanghua <zhanghua40@huawei.com> - 1.9.1-1
- Package init