rubygem-sinatra/rubygem-sinatra.spec

95 lines
2.7 KiB
RPMSpec
Raw Permalink Normal View History

2020-08-21 09:54:11 +08:00
%global gem_name sinatra
%{?_with_bootstrap: %global bootstrap 1}
Summary: Ruby-based web application framework
Name: rubygem-%{gem_name}
Version: 2.0.3
2024-11-20 09:32:45 +08:00
Release: 3
2020-08-21 09:54:11 +08:00
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
2024-11-20 09:32:45 +08:00
Patch0: Fix-broken-spec.patch
# Security fix
Patch3000: backport-CVE-2022-45442.patch
Patch3001: backport-CVE-2022-45442-test.patch
2020-08-21 09:54:11 +08:00
BuildRequires: rubygems-devel
%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
2024-11-20 09:32:45 +08:00
%setup -q -n %{gem_name}-%{version} -b 1
%patch0 -p1
%patch3000 -p1
%patch3001 -p1
2020-08-21 09:54:11 +08:00
%build
2024-11-20 09:32:45 +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
%check
%if ! 0%{?bootstrap}
pushd .%{gem_instdir}
2024-11-20 09:32:45 +08:00
ln -s %{_builddir}/%{gem_name}-%{version}/test test
2020-08-21 09:54:11 +08:00
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}
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-11-20 09:32:45 +08:00
* Wed Nov 20 2024 yaoxin <yao_xin001@hoperun.com> - 1:2.0.3-3
- Fix CVE-2022-45442
* Fri Dec 03 2021 xu_ping <xuping33@huawei.com> - 2.0.3-2
- Fix tests failed
2020-08-24 09:24:51 +08:00
* Sat Aug 22 2020 liyanan <liyanan32@huawei.com> - 2.0.3-1
- package init