rubygem-crack/rubygem-crack.spec

75 lines
2.0 KiB
RPMSpec
Raw Permalink Normal View History

2020-07-31 15:48:17 +08:00
%global gem_name crack
Summary: Really simple JSON and XML parsing, ripped from Merb and Rails
Name: rubygem-%{gem_name}
2020-08-19 09:26:54 +08:00
Version: 0.4.5
2022-06-20 01:53:18 +00:00
Release: 2
2020-07-31 15:48:17 +08:00
License: MIT
2020-08-19 09:26:54 +08:00
URL: https://github.com/jnunemaker/crack
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Source1: crack-%{version}-tests.tar.gz
2022-06-20 01:53:18 +00:00
# https://github.com/jnunemaker/crack/pull/73
Patch0: rubygem-crack-0.4.5-Use-named-parameters-for-safe_load.patch
2020-07-31 15:48:17 +08:00
# ruby package has just soft dependency on rubygem(bigdecimal), while
# crack always requires it.
Requires: rubygem(bigdecimal)
2020-08-19 09:26:54 +08:00
BuildRequires: rubygems-devel rubygem(bigdecimal) rubygem(minitest)
BuildRequires: rubygem-rexml
2020-07-31 15:48:17 +08:00
BuildArch: noarch
#BZ 781829
Epoch: 1
%description
Really simple JSON and XML parsing, ripped from Merb and Rails.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{epoch}:%{version}-%{release}
2020-08-19 09:26:54 +08:00
BuildArch: noarch
2020-07-31 15:48:17 +08:00
%description doc
This package contains documentation for %{name}.
%prep
2020-08-19 09:26:54 +08:00
%setup -q -n %{gem_name}-%{version} -b 1
2022-06-20 01:53:18 +00:00
%patch0 -p1
2020-07-31 15:48:17 +08:00
%build
2020-08-19 09:26:54 +08:00
# Create the gem as gem install only works on a gem file
gem build ../%{gem_name}-%{version}.gemspec
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
# by default, so that we can move it into the buildroot in %%install
%gem_install
2020-07-31 15:48:17 +08:00
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
%check
pushd .%{gem_instdir}
2020-08-19 09:26:54 +08:00
ln -s %{_builddir}/test test
2020-07-31 15:48:17 +08:00
ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
popd
%files
%dir %{gem_instdir}
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%changelog
2022-06-20 01:53:18 +00:00
* Wed Jan 4 2023 liyanan <liyanan32@h-partners.com> - 1:0.4.5-2
- Fix Ruby 3.1 / Psych 4.0 compatibility
2022-06-17 06:48:29 +00:00
* Tue Mar 29 2022 liyanan <liyanan32@huawei.com> - 0.4.5-1
2020-08-19 09:26:54 +08:00
- update to 0.4.5
2020-07-31 15:48:17 +08:00
* Mon Jul 27 2020 wangxiao <wangxiao65@huawei.com> - 0.4.2-1
- package init