init package

This commit is contained in:
caodongxia 2022-03-02 15:47:27 +08:00
parent ad779b13ee
commit ecc3f8b1ab
3 changed files with 74 additions and 0 deletions

74
rubygem-zeitwerk.spec Normal file
View File

@ -0,0 +1,74 @@
%global gem_name zeitwerk
Name: rubygem-%{gem_name}
Version: 2.5.4
Release: 1
Summary: Efficient and thread-safe constant autoloader
License: MIT
URL: https://github.com/fxn/zeitwerk
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# cd zeitwerk && git archive -v -o zeitwerk-2.5.4-tests.txz v2.5.4 test
Source2: %{gem_name}-%{version}-tests.txz
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby
BuildRequires: rubygem(minitest)
BuildArch: noarch
%description
Zeitwerk implements constant autoloading with Ruby semantics. Each gem
and application may have their own independent autoloader, with its own
configuration, inflector, and logger. Supports autoloading, preloading,
reloading, and eager loading.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version} -b2
%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}
ln -s %{_builddir}/test .
sed -i '/require..minitest.focus./ s/^/#/' test/test_helper.rb
sed -i '/require..minitest.reporters./ s/^/#/' test/test_helper.rb
sed -i '/Minitest::Reporters/ s/^/#/' test/test_helper.rb
# https://github.com/fxn/zeitwerk/issues/202
sed -i '/returns true for a file in a descendant of an ignored directory/ a \
skip' test/lib/zeitwerk/test_ignore.rb
ruby -Itest:lib -e 'Dir.glob "./test/**/test_*.rb", &method(:require)'
popd
%files
%dir %{gem_instdir}
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%license %{gem_instdir}/MIT-LICENSE
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/README.md
%changelog
* Wed Mar 2 2022 caodongxia <caodongxia@huawei.com> - 2.5.4-1
- Init package

BIN
zeitwerk-2.5.4-tests.txz Normal file

Binary file not shown.

BIN
zeitwerk-2.5.4.gem Normal file

Binary file not shown.