| |
@@ -1,38 +1,28 @@
|
| |
%global gem_name unf
|
| |
- %if 0%{?fedora} < 19
|
| |
- %global rubyabi 1.9.1
|
| |
- %endif
|
| |
|
| |
- %undefine __brp_mangle_shebangs
|
| |
+ %bcond_without tests
|
| |
+ %global prerelease .beta2
|
| |
|
| |
Summary: Wrapper library to bring Unicode Normalization Form support to Ruby/JRuby
|
| |
Name: rubygem-%{gem_name}
|
| |
- Version: 0.1.4
|
| |
- Release: 14%{?dist}
|
| |
+ Version: 0.2.0
|
| |
+ Release: 1%{?dist}
|
| |
|
| |
License: BSD
|
| |
URL: https://github.com/knu/ruby-unf
|
| |
- Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
|
| |
+ Source0: http://rubygems.org/gems/%{gem_name}-%{version}%{?prerelease}.gem
|
| |
|
| |
- %if 0%{?fedora} >= 19
|
| |
- Requires: ruby(release)
|
| |
BuildRequires: ruby(release)
|
| |
- %else
|
| |
- Requires: ruby(abi) = %{rubyabi}
|
| |
- Requires: ruby
|
| |
- BuildRequires: ruby(abi) = %{rubyabi}
|
| |
BuildRequires: ruby
|
| |
- %endif
|
| |
|
| |
- Requires: ruby(rubygems)
|
| |
- Requires: rubygem(unf_ext)
|
| |
BuildRequires: rubygems-devel
|
| |
# %%check
|
| |
+ %if %{with tests}
|
| |
BuildRequires: rubygem(minitest)
|
| |
- BuildRequires: rubygem(shoulda)
|
| |
+ BuildRequires: %{_bindir}/rake
|
| |
+ %endif
|
| |
BuildRequires: rubygem(unf_ext)
|
| |
BuildArch: noarch
|
| |
- Provides: rubygem(%{gem_name}) = %{version}-%{release}
|
| |
|
| |
%description
|
| |
This is a wrapper library to bring Unicode Normalization Form support
|
| |
@@ -48,23 +38,16 @@
|
| |
Documentation for %{name}.
|
| |
|
| |
%prep
|
| |
- %setup -q -c -T
|
| |
-
|
| |
- TOPDIR=$(pwd)
|
| |
- mkdir tmpunpackdir
|
| |
- pushd tmpunpackdir
|
| |
+ %setup -q -n %{gem_name}-%{version}%{?prerelease}
|
| |
|
| |
- gem unpack %{SOURCE0}
|
| |
- cd %{gem_name}-%{version}
|
| |
+ sed -i '/^\s*s.extensions = / d' \
|
| |
+ ../%{gem_name}-%{version}%{?prerelease}.gemspec
|
| |
|
| |
- gem specification -l --ruby %{SOURCE0} > %{gem_name}.gemspec
|
| |
- gem build %{gem_name}.gemspec
|
| |
- mv %{gem_name}-%{version}.gem $TOPDIR
|
| |
-
|
| |
- popd
|
| |
- rm -rf tmpunpackdir
|
| |
+ %gemspec_remove_file Dir.glob("ext/*")
|
| |
+ rm -rf ext
|
| |
|
| |
%build
|
| |
+ gem build ../%{gem_name}-%{version}%{?prerelease}.gemspec
|
| |
%gem_install
|
| |
|
| |
%install
|
| |
@@ -72,54 +55,53 @@
|
| |
cp -a .%{gem_dir}/* \
|
| |
%{buildroot}%{gem_dir}/
|
| |
|
| |
- pushd %{buildroot}%{gem_instdir}
|
| |
- rm -rf \
|
| |
- Gemfile \
|
| |
- Rakefile \
|
| |
- *.gemspec \
|
| |
- .gitignore \
|
| |
- .travis.yml \
|
| |
- test/ \
|
| |
- %{nil}
|
| |
- popd
|
| |
-
|
| |
-
|
| |
+ %if %{with tests}
|
| |
%check
|
| |
pushd .%{gem_instdir}
|
| |
- sed -i.orig \
|
| |
+ sed -i \
|
| |
-e '/begin/,/end/d' \
|
| |
-e '/bundler/d' \
|
| |
test/helper.rb
|
| |
|
| |
- %if 0%{?fedora} >= 21
|
| |
- sed -i.minitest \
|
| |
- -e 's|Test::Unit::TestCase|Minitest::Test|' \
|
| |
- test/*.rb
|
| |
+ sed -i -e 's|Test::Unit::TestCase|Minitest::Test|' \
|
| |
+ test/*.rb
|
| |
+
|
| |
cat > test/unit.rb << EOF
|
| |
gem "minitest"
|
| |
require "minitest/autorun"
|
| |
EOF
|
| |
|
| |
- %endif
|
| |
+ # Rename tests to work with MiniTest
|
| |
+ sed -i 's/test "raise ArgumentError.*$/def test_raise_argumenterror/' \
|
| |
+ test/*.rb
|
| |
+ sed -i 's/test "pass all tests.*$/def test_pass_all_tests/' \
|
| |
+ test/*.rb
|
| |
|
| |
- for f in test/test_*.rb
|
| |
- do
|
| |
- ruby -Ilib:test:. $f
|
| |
- done
|
| |
+ ruby -Ilib:test:. -e 'Dir.glob("test/test_*.rb").each(&method(:require))'
|
| |
popd
|
| |
+ %endif
|
| |
|
| |
%files
|
| |
%dir %{gem_instdir}
|
| |
- %doc %{gem_instdir}/[A-Z]*
|
| |
-
|
| |
%{gem_libdir}/
|
| |
%exclude %{gem_cache}
|
| |
+ %exclude %{gem_instdir}/.*
|
| |
%{gem_spec}
|
| |
+ %license %{gem_instdir}/LICENSE
|
| |
|
| |
%files doc
|
| |
%doc %{gem_docdir}
|
| |
+ %{gem_instdir}/*.gemspec
|
| |
+ %{gem_instdir}/test/
|
| |
+ %{gem_instdir}/Gemfile
|
| |
+ %{gem_instdir}/Rakefile
|
| |
+ %doc %{gem_instdir}/CHANGELOG.md
|
| |
+ %doc %{gem_instdir}/README.md
|
| |
|
| |
%changelog
|
| |
+ * Fri Nov 15 2019 Pavel Valena <pvalena@redhat.com> - 0.2.0-1
|
| |
+ - Update to 0.2.0.beta2 prerelease.
|
| |
+
|
| |
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.4-14
|
| |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
| |
|
| |
also enhance .spec and .gitignore file.
To have latest unf gem in Fedora.
Up-to-date Koji scratch-build:
https://koji.fedoraproject.org/koji/taskinfo?taskID=41394108
Up-to-date Copr build:
https://copr.fedorainfracloud.org/coprs/build/1222303
Checks: