64 lines
1.8 KiB
RPMSpec
64 lines
1.8 KiB
RPMSpec
|
|
%global gem_name execjs
|
||
|
|
Summary: Run JavaScript code from Ruby
|
||
|
|
Name: rubygem-%{gem_name}
|
||
|
|
Version: 2.7.0
|
||
|
|
Release: 1
|
||
|
|
License: MIT
|
||
|
|
URL: https://github.com/rails/execjs
|
||
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
||
|
|
Source1: https://github.com/rails/%{gem_name}/archive/v%{version}.tar.gz
|
||
|
|
# Revert f47c02c and 8b22842 fixing conflict to unbundle json2.js.
|
||
|
|
Patch0: rubygem-execjs-2.7.0-delete-JScript-and-json2.js.patch
|
||
|
|
BuildRequires: ruby(release) rubygems-devel rubygem(minitest) nodejs
|
||
|
|
BuildArch: noarch
|
||
|
|
%description
|
||
|
|
ExecJS lets you run JavaScript code from Ruby. It automatically picks the
|
||
|
|
best runtime available to evaluate your JavaScript program, then returns
|
||
|
|
the result to you as a Ruby object.
|
||
|
|
|
||
|
|
%package doc
|
||
|
|
Summary: Documentation for %{name}
|
||
|
|
Requires: %{name} = %{version}-%{release}
|
||
|
|
BuildArch: noarch
|
||
|
|
%description doc
|
||
|
|
Documentation for %{name}
|
||
|
|
|
||
|
|
%prep
|
||
|
|
gem unpack %{SOURCE0}
|
||
|
|
%setup -q -D -T -n %{gem_name}-%{version}
|
||
|
|
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
|
||
|
|
%patch0 -p1
|
||
|
|
sed -i -e '/files/ s|"lib/execjs/support/jscript_runner.js".freeze, ||' \
|
||
|
|
-e '/files/ s|"lib/execjs/support/json2.js".freeze, ||' %{gem_name}.gemspec
|
||
|
|
|
||
|
|
%build
|
||
|
|
gem build %{gem_name}.gemspec
|
||
|
|
%gem_install
|
||
|
|
|
||
|
|
%install
|
||
|
|
mkdir -p %{buildroot}%{gem_dir}
|
||
|
|
cp -a .%{gem_dir}/* \
|
||
|
|
%{buildroot}%{gem_dir}/
|
||
|
|
|
||
|
|
%check
|
||
|
|
pushd .%{gem_instdir}
|
||
|
|
tar xzf %{SOURCE1}
|
||
|
|
ln -s %{gem_name}-%{version}/test test
|
||
|
|
ruby -Ilib -e 'Dir.glob "./test/**/test_*.rb", &method(:require)'
|
||
|
|
popd
|
||
|
|
|
||
|
|
%files
|
||
|
|
%dir %{gem_instdir}
|
||
|
|
%license %{gem_instdir}/MIT-LICENSE
|
||
|
|
%{gem_libdir}
|
||
|
|
%exclude %{gem_cache}
|
||
|
|
%{gem_spec}
|
||
|
|
|
||
|
|
%files doc
|
||
|
|
%doc %{gem_docdir}
|
||
|
|
%doc %{gem_instdir}/README.md
|
||
|
|
|
||
|
|
%changelog
|
||
|
|
* Fri Aug 21 2020 fanjiachen <fanjiachen3@huawei.com> - 2.7.0-1
|
||
|
|
- package init
|