rubygem-unf/rubygem-unf.spec

92 lines
1.9 KiB
RPMSpec
Raw Permalink Normal View History

2020-08-20 15:34:21 +08:00
%global gem_name unf
%global rubyabi 1.9.1
%undefine __brp_mangle_shebangs
Name: rubygem-%{gem_name}
Version: 0.1.4
2022-05-10 17:29:09 +08:00
Release: 2
License: BSD-2-Clause
2020-08-20 15:34:21 +08:00
Summary: Wrapper library to bring Unicode Normalization Form support to Ruby/JRuby
URL: https://github.com/knu/ruby-unf
Source0: http://rubygems.org/gems/unf-%{version}.gem
Requires: ruby(release) ruby(rubygems) rubygem(unf_ext)
BuildRequires: ruby(release) rubygems-devel rubygem(minitest) rubygem(shoulda) rubygem(unf_ext)
BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version}-%{release}
%description
This is a wrapper library to bring Unicode Normalization Form support
to Ruby/JRuby.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%setup -q -c -T
TOPDIR=$(pwd)
mkdir tmpunpackdir
pushd tmpunpackdir
gem unpack %{SOURCE0}
cd %{gem_name}-%{version}
gem specification -l --ruby %{SOURCE0} > %{gem_name}.gemspec
gem build %{gem_name}.gemspec
mv %{gem_name}-%{version}.gem $TOPDIR
popd
rm -rf tmpunpackdir
%build
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
pushd %{buildroot}%{gem_instdir}
rm -rf \
Gemfile \
Rakefile \
*.gemspec \
.gitignore \
.travis.yml \
test/ \
%{nil}
popd
%check
pushd .%{gem_instdir}
sed -i.orig \
-e '/begin/,/end/d' \
-e '/bundler/d' \
test/helper.rb
sed -i.minitest \
-e 's|Test::Unit::TestCase|Minitest::Test|' \
test/*.rb
cat > test/unit.rb << EOF
gem "minitest"
require "minitest/autorun"
EOF
for f in test/test_*.rb
do
ruby -Ilib:test:. $f
done
popd
%files
%dir %{gem_instdir}
%doc %{gem_instdir}/[A-Z]*
%{gem_libdir}/
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%changelog
2022-05-10 17:29:09 +08:00
* Tue May 10 2022 yaoxin <yaoxin30@h-partners.com> - 0.1.4-2
- License compliance rectification
2020-08-20 15:34:21 +08:00
* Sat Aug 8 2020 yanan li <liyanan032@huawei.com> - 0.1.4-1
- Package init