92 lines
2.9 KiB
RPMSpec
92 lines
2.9 KiB
RPMSpec
%global gem_name thin
|
|
Name: rubygem-%{gem_name}
|
|
Version: 1.7.2
|
|
Release: 2
|
|
Summary: A thin and fast web server
|
|
License: (GPLv2+ or Ruby) and BSD and MIT
|
|
URL: https://rubygems.org/gems/%{gem_name}/versions/%{version}
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
|
Source1: https://github.com/macournoyer/thin/archive/v%{version}.tar.gz
|
|
# Fix the test suite error due to way Ruby 2.5 reports warnings.
|
|
# https://github.com/macournoyer/thin/pull/346
|
|
Patch0: rubygem-thin-1.7.2-Mock-Kernel.warn-in-Ruby-2.5-compatible-way.patch
|
|
Patch1: 0001-Fix-maximum_connections-limiting-test.patch
|
|
BuildRequires: ruby(release) rubygems-devel ruby-devel gcc rubygem(rspec2)
|
|
BuildRequires: rubygem(eventmachine) >= 1.0.4 rubygem(daemons) >= 1.0.9 rubygem(rack) >= 1.0.0
|
|
%description
|
|
Thin is a Ruby web server that glues together three of the best Ruby
|
|
libraries in web history.
|
|
The Mongrel parser, the root of Mongrel speed and security,
|
|
Event Machine, a network I/O library with extremely high scalability and
|
|
Rack, a minimal interface between webservers and Ruby frameworks.
|
|
|
|
%package doc
|
|
Summary: Documentation for %{name}
|
|
Requires: %{name} = %{version}-%{release}
|
|
BuildArch: noarch
|
|
|
|
%description doc
|
|
Documentation for %{name}.
|
|
|
|
%prep
|
|
%setup -q -c -T
|
|
%gem_install -n %{SOURCE0}
|
|
|
|
%build
|
|
|
|
%install
|
|
mkdir -p %{buildroot}%{gem_dir}
|
|
cp -a .%{gem_dir}/* \
|
|
%{buildroot}%{gem_dir}/
|
|
mkdir -p %{buildroot}%{gem_extdir_mri}
|
|
cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/
|
|
rm -rf %{buildroot}%{gem_instdir}/ext/
|
|
mkdir -p %{buildroot}%{_bindir}
|
|
cp -a .%{_bindir}/* \
|
|
%{buildroot}%{_bindir}/
|
|
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
|
|
pushd %{buildroot}/%{gem_instdir}/example
|
|
chmod 755 async_chat.ru
|
|
chmod 755 async_tailer.ru
|
|
popd
|
|
|
|
%check
|
|
pushd .%{gem_instdir}
|
|
tar xzvf %{SOURCE1}
|
|
cp -r thin-%{version}/spec spec
|
|
cat %{PATCH0} | patch -p1
|
|
cat %{PATCH1} | patch -p1
|
|
find spec/perf -name "*_spec.rb" -exec \
|
|
sed -i '/be_faster_then/ i \ pending' {} \;
|
|
sed -i -r "/'should (force )?kill process in pid file'/a \ pending" \
|
|
spec/daemonizing_spec.rb
|
|
sed -i '/^ def server_should_start_in_less_then/,/^ end/ s/(10)/(20)/' \
|
|
spec/daemonizing_spec.rb
|
|
sed -i '/"tracing routines (with NO custom logger)"/a \ before { pending }' \
|
|
spec/logging_spec.rb
|
|
rspec2 -I$(dirs +1)%{gem_extdir_mri} spec
|
|
popd
|
|
|
|
%files
|
|
%dir %{gem_instdir}
|
|
%{_bindir}/thin
|
|
%{gem_extdir_mri}
|
|
%{gem_instdir}/bin
|
|
%{gem_libdir}
|
|
%exclude %{gem_cache}
|
|
%{gem_spec}
|
|
|
|
%files doc
|
|
%doc %{gem_docdir}
|
|
%{gem_instdir}/example/
|
|
%doc %{gem_instdir}/CHANGELOG
|
|
%doc %{gem_instdir}/README.md
|
|
%{gem_instdir}/Rakefile
|
|
|
|
%changelog
|
|
* Fri Mar 19 2021 maminjie <maminjie1@huawei.com> - 1.7.2-2
|
|
- Fix maximum_connections limiting test
|
|
|
|
* Sat Aug 22 2020 tuShenmei <tushenmei@huawei.com> - 1.7.2-1
|
|
- package init
|