rubygem-mustermann/rubygem-mustermann.spec

89 lines
2.6 KiB
RPMSpec
Raw Normal View History

2020-08-28 16:38:19 +08:00
%global gem_name mustermann
%{?_with_bootstrap: %global bootstrap 1}
Name: rubygem-%{gem_name}
Version: 1.1.1
Release: 1
2020-08-28 16:38:19 +08:00
Summary: Your personal string matching expert
License: MIT
URL: https://github.com/sinatra/mustermann
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# Support and mustermann-contrib routines required by test suite.
# git clone https://github.com/sinatra/mustermann.git && cd mustermann
# git checkout v1.1.1 && tar czvf mustermann-1.1.1-support.tgz support/
Source1: %{gem_name}-%{version}-support.tgz
# tar czvf mustermann-1.1.1-mustermann-contrib.tgz mustermann-contrib/
Source2: %{gem_name}-%{version}-mustermann-contrib.tgz
2020-08-28 16:38:19 +08:00
BuildRequires: ruby(release) rubygems-devel ruby >= 2.2.0 rubygem(rspec) rubygem(rspec-its)
%if ! 0%{?bootstrap}
BuildRequires: rubygem(sinatra)
%endif
BuildRequires: rubygem(rack-test)
BuildArch: noarch
%description
A library implementing patterns that behave like regular expressions.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version} -b 1 -b 2
%gemspec_remove_dep -g ruby2_keywords
2020-08-28 16:38:19 +08:00
%build
gem build ../%{gem_name}-%{version}.gemspec
2020-08-28 16:38:19 +08:00
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
pushd %{_builddir}/%{gem_name}-%{version}/%{gem_instdir}
mv spec/identity_spec.rb{,.disabled}
mv spec/concat_spec.rb{,.disabled}
popd
2020-08-28 16:38:19 +08:00
%if ! 0%{?bootstrap}
%check
sed -i "/^require 'tool\/warning_filter'/ s/^/#/" \
%{_builddir}/support/lib/support/env.rb
sed -i "/^require 'support\/coverage'/ s/^/#/" \
%{_builddir}/support/lib/support.rb
pushd .%{gem_instdir}
mv spec/extension_spec.rb{,.disabled}
sed -i "/^require 'mustermann\/extension'/ s/^/#/" \
spec/mustermann_spec.rb
sed -i '/^ describe :extend_object do$/,/^ end$/ s/^/#/' \
spec/mustermann_spec.rb
rspec -I%{_builddir}/{support,mustermann-contrib}/lib spec
popd
%endif
%files
%dir %{gem_instdir}
%license %{gem_instdir}/LICENSE
%{gem_libdir}
%exclude %{gem_instdir}/mustermann.gemspec
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/README.md
%{gem_instdir}/bench
%{gem_instdir}/spec
%changelog
* Thu Feb 24 2022 liyanan <liyanan32@huawei.com> - 1.1.1-1
- update to 1.1.1
2020-09-08 14:38:48 +08:00
* Tue Sep 8 2020 yanan li <liyanan032@huawei.com> - 1.0.2-2
- fix build fail
2020-08-28 16:38:19 +08:00
* Wed Aug 19 2020 geyanan <geyanan2@huawei.com> - 1.0.2-1
- package init