rubygem-rake-compiler/rubygem-rake-compiler.spec
2023-11-15 15:33:49 +08:00

106 lines
2.9 KiB
RPMSpec

%global gem_name rake-compiler
%undefine _changelog_trimtime
Summary: Rake-based Ruby C Extension task generator
Name: rubygem-%{gem_name}
Version: 1.2.5
Release: 1
License: MIT
URL: http://github.com/rake-compiler/rake-compiler
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
#git clone http://github.com/rake-compiler/rake-compiler
#cd rake-compiler
#git archive -v -o rake-compiler-1.2.5-specs.tar.gz v1.2.5 spec/
Source1: rake-compiler-%{version}-specs.tar.gz
Requires: ruby(release)
BuildRequires: ruby(release) ruby(rubygems) >= 1.3.5 rubygem(rake) rubygem(rspec) >= 3
BuildRequires: rubygems-devel rubygem(cucumber) gcc ruby-devel
Requires: ruby(rubygems) >= 1.3.5 rubygem(rake) >= 0.8.3 rubygem(did_you_mean)
BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version}-%{release}
%description
rake-compiler aims to help Gem developers while dealing with
Ruby C extensions, simplifiying the code and reducing the duplication.
It follows *convention over configuration* and set an standarized
structure to build and package C extensions in your gems.
This is the result of expriences dealing with several Gems
that required native extensions across platforms and different
user configurations where details like portability and
clarity of code were lacking.
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
%description doc
This package contains documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version} -b1
mv ../%{gem_name}-%{version}.gemspec .
find ./lib/rake -name \*.rb | xargs sed -i -e '\@/usr/bin/env@d'
find . -name \*.rb -print0 | xargs --null chmod 0644
grep -rl be_true features/ | xargs sed -i 's|be_true|be_truthy|'
grep -rl be_false features/ | xargs sed -i 's|be_false|be_falsey|'
sed -i tasks/bin/cross-ruby.rake \
-e '\@LDFLAGS=@d'
sed -i cucumber.yml -e "s|~@java|'not @java'|"
%build
gem build %{gem_name}-%{version}.gemspec
%gem_install
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{_prefix}/* %{buildroot}%{_prefix}/
rm -f %{buildroot}%{gem_cache}
pushd %{buildroot}%{gem_instdir}
rm -rf \
Gemfile \
Rakefile \
appveyor.yml \
cucumber.yml \
features/ \
spec/ \
tasks/ \
tmp/ \
%{nil}
popd
%check
rm -rf .%{gem_instdir}/spec
cp -a ../spec/ .%{gem_instdir}/
pushd .%{gem_instdir}
ruby -Ilib -S rspec spec/
export CUCUMBER_PUBLISH_QUIET=true
ruby -Ilib -S cucumber
popd
%files
%{_bindir}/rake-compiler
%license %{gem_instdir}/LICENSE.txt
%dir %{gem_instdir}
%doc %{gem_instdir}/README.md
%doc %{gem_instdir}/History.md
%{gem_instdir}/bin/
%{gem_libdir}
%{gem_spec}
%files doc
%{gem_docdir}
%changelog
* Wed Nov 15 2023 liyanan <liyanan61@h-partners.com> - 1.2.5-1
- update to 1.2.5
* Thu Nov 19 2020 caodongxia <caodongxia@huawei.com> - 1.1.0-1
- package init