Skip to content

Instantly share code, notes, and snippets.

@pvalena
Created January 17, 2024 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pvalena/8d309785240d96b4a47332f0cd2c5b24 to your computer and use it in GitHub Desktop.
Save pvalena/8d309785240d96b4a47332f0cd2c5b24 to your computer and use it in GitHub Desktop.
--- rubygem-simplecov/.generated.spec 2024-01-17 14:14:27.950441723 +0100
+++ rubygem-simplecov/rubygem-simplecov.spec 2024-01-17 14:03:00.702675231 +0100
@@ -1,22 +1,34 @@
-Downloaded simplecov-0.22.0
-# Generated from simplecov-0.22.0.gem by gem2rpm -*- rpm-spec -*-
%global gem_name simplecov
+%bcond_without bootstrap
+
+Summary: Code coverage analysis tool for Ruby 1.9
Name: rubygem-%{gem_name}
Version: 0.22.0
Release: 1%{?dist}
-Summary: Code coverage for Ruby
License: MIT
-URL: https://github.com/simplecov-ruby/simplecov
-Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
+URL: http://github.com/colszowka/simplecov
+Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
+
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
-BuildRequires: ruby >= 2.5.0
+# For tests
+%if %{without bootstrap}
+BuildRequires: rubygem(aruba)
+BuildRequires: rubygem(bundler)
+BuildRequires: rubygem(capybara)
+BuildRequires: rubygem(cucumber)
+BuildRequires: rubygem(docile)
+BuildRequires: rubygem(rake)
+BuildRequires: rubygem(rspec)
+BuildRequires: rubygem(simplecov-html)
+BuildRequires: rubygem(test-unit)
+%endif
BuildArch: noarch
%description
-Code coverage for Ruby with a powerful configuration library and automatic
-merging of coverage across test suites.
+Code coverage for Ruby 1.9 with a powerful configuration library and automatic
+merging of coverage across test suites
%package doc
@@ -25,30 +37,38 @@
BuildArch: noarch
%description doc
-Documentation for %{name}.
+Documentation for %{name}
%prep
%setup -q -n %{gem_name}-%{version}
%build
-# 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
%install
mkdir -p %{buildroot}%{gem_dir}
-cp -a .%{gem_dir}/* \
- %{buildroot}%{gem_dir}/
-
+cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/
+#cleanup
+rm -f %{buildroot}%{gem_instdir}/.gitignore
+rm -f %{buildroot}%{gem_instdir}/.rspec
+rm -f %{buildroot}%{gem_instdir}/.rubocop.yml
+rm -f %{buildroot}%{gem_instdir}/.travis.yml
+rm -rf %{buildroot}%{gem_instdir}/.yardopts
+rm -rf %{buildroot}%{gem_instdir}/.yardoc
+rm -f %{buildroot}%{gem_instdir}/Gemfile
+rm -f %{buildroot}%{gem_instdir}/simplecov.gemspec
+mv %{buildroot}%{gem_instdir}/doc %{buildroot}/%{gem_docdir}/
+%if %{without bootstrap}
%check
-pushd .%{gem_instdir}
-# Run the test suite.
+pushd %{buildroot}%{gem_instdir}
+rm -rf spec/faked_project/
+rspec -Ilib spec
+rm -rf %{buildroot}%{gem_instdir}/tmp
popd
+%endif
%files
%dir %{gem_instdir}
@@ -59,10 +79,120 @@
%files doc
%doc %{gem_docdir}
-%doc %{gem_instdir}/CHANGELOG.md
-%doc %{gem_instdir}/README.md
-%doc %{gem_instdir}/doc
+%{gem_instdir}/CHANGELOG.md
+%{gem_instdir}/README.md
%changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment