2020-08-25 10:51:53 +08:00
|
|
|
%global gem_name marcel
|
|
|
|
|
Name: rubygem-%{gem_name}
|
2022-03-03 15:33:55 +08:00
|
|
|
Version: 1.0.2
|
2020-08-25 10:51:53 +08:00
|
|
|
Release: 1
|
|
|
|
|
Summary: Simple mime type detection using magic numbers, file names, and extensions
|
2022-03-03 15:33:55 +08:00
|
|
|
License: MIT and ASL 2.0
|
2020-08-25 10:51:53 +08:00
|
|
|
URL: https://github.com/basecamp/marcel
|
|
|
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
2022-03-03 15:33:55 +08:00
|
|
|
# git clone https://github.com/rails/marcel.git && cd marcel
|
|
|
|
|
# git archive -v -o marcel-1.0.2-test.tar.gz v1.0.2 test/
|
|
|
|
|
Source1: %{gem_name}-%{version}-test.tar.gz
|
|
|
|
|
BuildRequires: ruby(release) rubygems-devel ruby >= 2.2 rubygem(minitest)
|
2020-08-25 10:51:53 +08:00
|
|
|
BuildRequires: rubygem(rack)
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
%description
|
|
|
|
|
Simple mime type detection using magic numbers, file names, and extensions.
|
|
|
|
|
|
|
|
|
|
%package doc
|
|
|
|
|
Summary: Documentation for %{name}
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
%description doc
|
|
|
|
|
Documentation for %{name}.
|
|
|
|
|
|
|
|
|
|
%prep
|
2022-03-03 15:33:55 +08:00
|
|
|
%setup -q -n %{gem_name}-%{version} -b 1
|
2020-08-25 10:51:53 +08:00
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
gem build ../%{gem_name}-%{version}.gemspec
|
|
|
|
|
%gem_install
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
mkdir -p %{buildroot}%{gem_dir}
|
|
|
|
|
cp -a .%{gem_dir}/* \
|
|
|
|
|
%{buildroot}%{gem_dir}/
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
pushd .%{gem_instdir}
|
2022-03-03 15:33:55 +08:00
|
|
|
ln -s %{_builddir}/test .
|
|
|
|
|
sed -i "/require 'byebug'/ s/^/#/" test/test_helper.rb
|
|
|
|
|
ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
|
2020-08-25 10:51:53 +08:00
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%dir %{gem_instdir}
|
|
|
|
|
%license %{gem_instdir}/MIT-LICENSE
|
2022-03-03 15:33:55 +08:00
|
|
|
%license %{gem_instdir}/APACHE-LICENSE
|
2020-08-25 10:51:53 +08:00
|
|
|
%{gem_libdir}
|
|
|
|
|
%exclude %{gem_cache}
|
|
|
|
|
%{gem_spec}
|
|
|
|
|
|
|
|
|
|
%files doc
|
|
|
|
|
%doc %{gem_docdir}
|
|
|
|
|
%doc %{gem_instdir}/README.md
|
|
|
|
|
|
|
|
|
|
%changelog
|
2022-03-03 15:33:55 +08:00
|
|
|
* Thu Mar 03 2022 jiangxinyu <jiangxinyu@kylinos.cn> - 1.0.2-1
|
|
|
|
|
- update to 1.0.2
|
|
|
|
|
|
2020-08-25 10:51:53 +08:00
|
|
|
* Wed Aug 19 2020 geyanan <geyanan2@huawei.com> - 0.3.2-1
|
|
|
|
|
- package init
|