Skip to content

Instantly share code, notes, and snippets.

@pvalena
Created August 11, 2020 02: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/5ade36ce435de2313fbbcfa957ce7714 to your computer and use it in GitHub Desktop.
Save pvalena/5ade36ce435de2313fbbcfa957ce7714 to your computer and use it in GitHub Desktop.
diff --git a/rubygem-actiontext.spec b/rubygem-actiontext.spec
index 80d15ce..2fe4ca1 100644
--- a/rubygem-actiontext.spec
+++ b/rubygem-actiontext.spec
@@ -1,35 +1,16 @@
-# Generated from actiontext-6.0.3.1.gem by gem2rpm -*- rpm-spec -*-
+# Generated from actiontext-6.0.3.2.gem by gem2rpm -*- rpm-spec -*-
%global gem_name actiontext
-# Circular dependency with rubygem-railties.
-%bcond_with bootstrap
-
Name: rubygem-%{gem_name}
-Version: 6.0.3.1
-Release: 2%{?dist}
+Version: 6.0.3.2
+Release: 1%{?dist}
Summary: Rich text framework
License: MIT
URL: https://rubyonrails.org
-Source0: https://rubygems.org/gems/%{gem_name}-%{version}%{?prerelease}.gem
-# Tests are not shipped with the gem
-# git clone https://github.com/rails/rails.git --no-checkout
-# cd rails/actiontext && git archive -v -o actiontext-6.0.3.1-tests.txz v6.0.3.1 test/
-Source1: %{gem_name}-%{version}%{?prerelease}-tests.txz
-# The tools are needed for the test suite, are however unpackaged in gem file.
-# You may get them like so
-# git clone http://github.com/rails/rails.git --no-checkout
-# cd rails && git archive -v -o rails-6.0.3.1-tools.txz v6.0.3.1 tools/
-Source2: rails-%{version}%{?prerelease}-tools.txz
-
+Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby >= 2.5.0
-%if %{without bootstrap}
-BuildRequires: rubygem(railties) = %{version}
-BuildRequires: rubygem(activestorage) = %{version}
-BuildRequires: rubygem(actionmailer) = %{version}
-BuildRequires: rubygem(sqlite3)
-%endif
BuildArch: noarch
%description
@@ -45,10 +26,14 @@ BuildArch: noarch
Documentation for %{name}.
%prep
-%setup -q -n %{gem_name}-%{version}%{?prerelease} -b1 -b2
+%setup -q -n %{gem_name}-%{version}
%build
-gem build ../%{gem_name}-%{version}%{?prerelease}.gemspec
+# 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
@@ -56,21 +41,12 @@ mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
-%if %{without bootstrap}
-%check
-pushd .%{gem_instdir}
-ln -s %{_builddir}/tools ..
-mv %{_builddir}/test .
-
-# Remove bundler usage
-sed -i '/Bundler.require/ s/^/#/' test/dummy/config/application.rb
-# Remove asset pipeline initializer
-echo > test/dummy/config/initializers/assets.rb
-ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
+%check
+pushd .%{gem_instdir}
+# Run the test suite.
popd
-%endif
%files
%dir %{gem_instdir}
@@ -88,5 +64,5 @@ popd
%doc %{gem_instdir}/README.md
%changelog
-* Mon Aug 03 07:01:37 GMT 2020 Pavel Valena <pvalena@redhat.com> - 6.0.3.1-2
-- Initial package Action Text 6.0.3.1.
+* Tue Aug 11 2020 Pavel Valena <pvalena@redhat.com> - 6.0.3.2-1
+- Initial package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment