82 lines
2.3 KiB
RPMSpec
82 lines
2.3 KiB
RPMSpec
%global gem_name sinatra
|
|
%{?_with_bootstrap: %global bootstrap 1}
|
|
Summary: Ruby-based web application framework
|
|
Name: rubygem-%{gem_name}
|
|
Version: 2.0.3
|
|
Release: 1
|
|
License: MIT
|
|
URL: http://www.sinatrarb.com/
|
|
Source0: https://rubygems.org/gems/sinatra-%{version}.gem
|
|
Source1: https://github.com/sinatra/sinatra/archive/v%{version}.tar.gz
|
|
BuildRequires: rubygems-devel
|
|
%if ! 0%{?bootstrap}
|
|
BuildRequires: rubygem(rack) >= 2.0 rubygem(rack-protection) = %{version} rubygem(tilt)
|
|
BuildRequires: rubygem(mustermann) rubygem(rack-test)
|
|
BuildRequires: rubygem(minitest) > 5
|
|
%endif
|
|
Epoch: 1
|
|
BuildArch: noarch
|
|
%description
|
|
Sinatra is a DSL intended for quickly creating web-applications in Ruby
|
|
with minimal effort.
|
|
|
|
%package doc
|
|
Summary: Documentation for %{name}
|
|
Requires: %{name} = %{epoch}:%{version}-%{release}
|
|
%description doc
|
|
This package contains 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 -rv .%{gem_dir}/* %{buildroot}%{gem_dir}
|
|
sed -i -e 's|^#!/usr/bin/env ruby|#!/usr/bin/ruby|' \
|
|
%{buildroot}%{gem_instdir}/examples/*.rb
|
|
|
|
%check
|
|
%if ! 0%{?bootstrap}
|
|
pushd .%{gem_instdir}
|
|
tar xzvf %{SOURCE1}
|
|
cd %{gem_name}-%{version}
|
|
for FILE in $(grep -rl '^require.*bundler.*' test/); do
|
|
sed -i "/^require 'bundler.*'/ s/^/#/" ${FILE}
|
|
done
|
|
mv test/integration_test.rb{,.disabled}
|
|
ruby -e 'Dir.glob "./test/*_test.rb", &method(:require)'
|
|
popd
|
|
%endif
|
|
|
|
%files
|
|
%dir %{gem_instdir}
|
|
%exclude %{gem_instdir}/.*
|
|
%license %{gem_instdir}/LICENSE
|
|
%{gem_libdir}
|
|
%exclude %{gem_instdir}/sinatra.gemspec
|
|
%exclude %{gem_cache}
|
|
%{gem_spec}
|
|
|
|
%files doc
|
|
%doc %{gem_docdir}
|
|
%doc %{gem_instdir}/AUTHORS.md
|
|
%doc %{gem_instdir}/CHANGELOG.md
|
|
%doc %{gem_instdir}/CONTRIBUTING.md
|
|
%{gem_instdir}/Gemfile
|
|
%doc %{gem_instdir}/MAINTENANCE.md
|
|
%doc %{gem_instdir}/README*.md
|
|
%{gem_instdir}/Rakefile
|
|
%doc %{gem_instdir}/SECURITY.md
|
|
%{gem_instdir}/VERSION
|
|
%{gem_instdir}/examples
|
|
|
|
%changelog
|
|
* Mon Aug 10 2020 yanan li <liyanan032@huawei.com> - 2.0.3-1
|
|
- Package init
|