2020-08-21 09:54:11 +08:00
|
|
|
%global gem_name sinatra
|
2022-02-24 11:33:55 +08:00
|
|
|
%bcond_with bootstrap
|
2020-08-21 09:54:11 +08:00
|
|
|
Summary: Ruby-based web application framework
|
|
|
|
|
Name: rubygem-%{gem_name}
|
2022-02-24 11:33:55 +08:00
|
|
|
Version: 2.0.8.1
|
2024-05-11 14:55:23 +08:00
|
|
|
Release: 3
|
2020-08-21 09:54:11 +08:00
|
|
|
License: MIT
|
|
|
|
|
URL: http://www.sinatrarb.com/
|
2022-02-24 11:33:55 +08:00
|
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
|
|
|
|
# git clone https://github.com/sinatra/sinatra.git && cd sinatra
|
|
|
|
|
# git archive -v -o sinatra-2.0.8.1-test.tar.gz v2.0.8.1 test/
|
|
|
|
|
Source1: %{gem_name}-%{version}-test.tar.gz
|
|
|
|
|
# Fix test failure due to Rack 2.2.2 incompatibility.
|
|
|
|
|
# https://github.com/sinatra/sinatra/pull/1605
|
|
|
|
|
Patch0: rubygem-sinatra-2.0.8.1-Fix-failing-tests.patch
|
2023-01-17 11:31:40 +08:00
|
|
|
Patch1: Internal-Sinatra-errors-now-extend-Sinatra-Error-test.patch
|
|
|
|
|
Patch2: Internal-Sinatra-errors-now-extend-Sinatra-Error.patch
|
2024-05-11 14:55:23 +08:00
|
|
|
Patch3: Fix-broken-spec.patch
|
2022-02-24 11:33:55 +08:00
|
|
|
BuildRequires: rubygems-devel ruby(release) ruby >= 2.2.0
|
2020-08-21 09:54:11 +08:00
|
|
|
%if ! 0%{?bootstrap}
|
|
|
|
|
BuildRequires: rubygem(rack) >= 2.0 rubygem(rack-protection) = %{version} rubygem(tilt)
|
2020-08-24 09:24:51 +08:00
|
|
|
BuildRequires: rubygem(mustermann) rubygem(rack-test) rubygem(minitest) > 5
|
2020-08-21 09:54:11 +08:00
|
|
|
%endif
|
|
|
|
|
Epoch: 1
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
%description
|
|
|
|
|
Sinatra is a DSL intended for quickly creating web-applications in Ruby
|
|
|
|
|
with minimal effort.
|
|
|
|
|
|
2020-08-24 09:24:51 +08:00
|
|
|
%package help
|
2020-08-21 09:54:11 +08:00
|
|
|
Summary: Documentation for %{name}
|
|
|
|
|
Requires: %{name} = %{epoch}:%{version}-%{release}
|
2020-08-24 09:24:51 +08:00
|
|
|
Provides: %{name}-doc = %{version}-%{release}
|
|
|
|
|
Obsoletes: %{name}-doc < %{version}-%{release}
|
|
|
|
|
%description help
|
2020-08-21 09:54:11 +08:00
|
|
|
This package contains documentation for %{name}.
|
|
|
|
|
|
|
|
|
|
%prep
|
2022-02-24 11:33:55 +08:00
|
|
|
%setup -q -n %{gem_name}-%{version} -b 1
|
|
|
|
|
|
|
|
|
|
pushd %{_builddir}
|
|
|
|
|
%patch0 -p1
|
2023-01-17 11:31:40 +08:00
|
|
|
%patch1 -p1
|
2024-05-11 14:55:23 +08:00
|
|
|
%patch3 -p1
|
2022-02-24 11:33:55 +08:00
|
|
|
popd
|
2020-08-21 09:54:11 +08:00
|
|
|
|
2023-01-17 11:31:40 +08:00
|
|
|
%patch2 -p1
|
|
|
|
|
|
2020-08-21 09:54:11 +08:00
|
|
|
%build
|
2022-02-24 11:33:55 +08:00
|
|
|
gem build ../%{gem_name}-%{version}.gemspec
|
2020-08-21 09:54:11 +08:00
|
|
|
%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
|
|
|
|
|
|
2022-02-24 11:33:55 +08:00
|
|
|
%if %{without bootstrap}
|
2020-08-21 09:54:11 +08:00
|
|
|
%check
|
|
|
|
|
pushd .%{gem_instdir}
|
2022-02-24 11:33:55 +08:00
|
|
|
cp -a %{_builddir}/test test
|
|
|
|
|
sed -i '/active_support/ s/$/ unless Hash.method_defined?(:slice)/' test/helper.rb
|
2020-08-21 09:54:11 +08:00
|
|
|
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}
|
|
|
|
|
|
2020-08-24 09:24:51 +08:00
|
|
|
%files help
|
2020-08-21 09:54:11 +08:00
|
|
|
%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
|
2024-05-11 14:55:23 +08:00
|
|
|
* Sat May 11 2024 Zhengxin Guo <guozhengxin@kylinos.cn> - 1:2.0.8.1-3
|
|
|
|
|
- fix the correctly ignores syntactically invalid range requests test
|
|
|
|
|
|
2023-01-17 11:31:40 +08:00
|
|
|
* Tue Jan 17 2023 wulei <wulei80@h-partners.com> - 1:2.0.8.1-2
|
|
|
|
|
- fix the error_highlight test
|
|
|
|
|
|
2022-02-24 11:33:55 +08:00
|
|
|
* Thu Feb 24 2022 liyanan <liyanan32@huawei.com> - 2.0.8.1-1
|
|
|
|
|
- update to 2.0.8.1
|
|
|
|
|
|
2021-02-10 11:45:42 +08:00
|
|
|
* Wed Feb 10 2021 Ge Wang <wangge20@huawei.com> - 2.0.3-2
|
|
|
|
|
- solve test error due to rubygem-rack update to 2.2.0+
|
|
|
|
|
|
2020-08-24 09:24:51 +08:00
|
|
|
* Sat Aug 22 2020 liyanan <liyanan32@huawei.com> - 2.0.3-1
|
|
|
|
|
- package init
|