rubygem-ejs/rubygem-ejs.spec
2020-08-28 14:25:34 +08:00

57 lines
1.5 KiB
RPMSpec

%global gem_name ejs
Name: rubygem-%{gem_name}
Version: 1.1.1
Release: 1
Summary: EJS (Embedded JavaScript) template compiler
License: MIT
URL: https://github.com/sstephenson/ruby-ejs/
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Source1: https://github.com/sstephenson/ruby-%{gem_name}/archive/v%{version}.tar.gz
BuildRequires: ruby(release) rubygems-devel ruby rubygem(execjs) rubygem(test-unit) nodejs
BuildArch: noarch
%description
Compile and evaluate EJS (Embedded JavaScript) templates from Ruby.
%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
%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 ruby-%{gem_name}-%{version}/test test
ruby -Ilib -e 'Dir.glob "./test/**/test_*.rb", &method(:require)'
popd
%files
%dir %{gem_instdir}
%license %{gem_instdir}/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> - 1.1.1-1
- package init