2020-08-28 15:04:37 +08:00
|
|
|
%{?nodejs_find_provides_and_requires}
|
|
|
|
|
|
|
|
|
|
%global enable_tests 1
|
|
|
|
|
|
|
|
|
|
Name: nodejs-requirejs
|
|
|
|
|
Version: 2.1.11
|
2020-09-11 09:06:26 +08:00
|
|
|
Release: 2
|
2020-08-28 15:04:37 +08:00
|
|
|
Summary: Node.js adapter for RequireJS, for loading AMD modules
|
|
|
|
|
License: MIT or BSD
|
|
|
|
|
URL: https://github.com/jrburke/r.js
|
2020-09-08 14:17:47 +08:00
|
|
|
Source0: https://github.com/jrburke/r.js/archive/%{version}.tar.gz
|
2020-09-09 16:22:46 +08:00
|
|
|
Patch0000: 0001-fix-package.json-make-the-rpm-can-provides-npm-requi.patch
|
2020-08-28 15:04:37 +08:00
|
|
|
BuildArch: noarch
|
|
|
|
|
ExclusiveArch: %{nodejs_arches} noarch
|
|
|
|
|
BuildRequires: nodejs-packaging
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
RequireJS is a JavaScript file and module loader. It is optimized for
|
|
|
|
|
in-browser use, but it can be used in other JavaScript environments,
|
|
|
|
|
like Rhino and Node. Using a modular script loader like RequireJS will
|
|
|
|
|
improve the speed and quality of your code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
2020-09-09 16:22:46 +08:00
|
|
|
%autosetup -p1 -n r.js-%{version}
|
2020-08-28 15:04:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
mkdir -p %{buildroot}%{nodejs_sitelib}/requirejs
|
|
|
|
|
cp -pr package.json require.js \
|
|
|
|
|
%{buildroot}%{nodejs_sitelib}/requirejs
|
|
|
|
|
mkdir -p %{buildroot}%{nodejs_sitelib}/requirejs/bin
|
2020-09-08 14:17:47 +08:00
|
|
|
install -p -D -m0755 dist/r.js \
|
2020-08-28 15:04:37 +08:00
|
|
|
%{buildroot}%{nodejs_sitelib}/requirejs/bin/r.js
|
|
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}%{_bindir}
|
|
|
|
|
ln -s %{nodejs_sitelib}/requirejs/bin/r.js \
|
|
|
|
|
%{buildroot}%{_bindir}/r.js
|
|
|
|
|
|
|
|
|
|
%nodejs_symlink_deps
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if 0%{?enable_tests}
|
|
|
|
|
%check
|
|
|
|
|
pushd tests/
|
2020-09-08 14:17:47 +08:00
|
|
|
%__nodejs ../dist/r.js all.js
|
2020-08-28 15:04:37 +08:00
|
|
|
popd
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%doc LICENSE README.md
|
|
|
|
|
%{nodejs_sitelib}/requirejs
|
|
|
|
|
%{_bindir}/r.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%changelog
|
2020-09-11 09:06:26 +08:00
|
|
|
* Fri Sep 11 2020 wangxiao <wangxiao65@huawei.com> - 2.1.11-2
|
|
|
|
|
- fix package.json
|
2020-08-28 15:04:37 +08:00
|
|
|
* Wed Aug 19 2020 wangxiao <wangxiao65@huawei.com> - 2.1.11-1
|
|
|
|
|
- package init
|