Skip to content

Instantly share code, notes, and snippets.

@pvalena
Created November 30, 2021 17:26
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/43c710f143c0b82d3bb86c4dd47bb991 to your computer and use it in GitHub Desktop.
Save pvalena/43c710f143c0b82d3bb86c4dd47bb991 to your computer and use it in GitHub Desktop.
--- rubygem-spring/.generated.spec 2021-11-30 18:22:25.827429334 +0100
+++ rubygem-spring/rubygem-spring.spec 2021-11-30 16:55:41.781271395 +0100
@@ -1,5 +1,3 @@
-Downloaded spring-3.1.1
-# Generated from spring-3.1.1.gem by gem2rpm -*- rpm-spec -*-
%global gem_name spring
Name: rubygem-%{gem_name}
@@ -9,16 +7,25 @@
License: MIT
URL: https://github.com/rails/spring
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
+# git clone https://github.com/rails/spring.git --no-checkout
+# git -C spring archive -v -o spring-3.1.1-tests.tar.gz v3.1.1 test/
+Source1: %{gem_name}-%{version}-tests.tar.gz
+# Needed by `spring status`
+Requires: %{_bindir}/ps
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
-BuildRequires: ruby >= 2.5.0
-# BuildRequires: rubygem(bump)
-# BuildRequires: rubygem(activesupport)
+BuildRequires: ruby >= 2.4.0
+BuildRequires: rubygem(bundler)
+BuildRequires: rubygem(activesupport)
BuildArch: noarch
+# OkJson is allowed to be bundled:
+# https://fedorahosted.org/fpc/ticket/113
+Provides: bundled(okjson) = 43
%description
-Preloads your application so things like console, rake and tests run faster.
-
+Spring is a Rails application preloader. It speeds up development by keeping
+your application running in the background so you don't need to boot it every
+time you run a test, rake task or migration.
%package doc
Summary: Documentation for %{name}
@@ -29,14 +36,10 @@
Documentation for %{name}.
%prep
-%setup -q -n %{gem_name}-%{version}
+%setup -q -n %{gem_name}-%{version} -b 1
%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
@@ -53,7 +56,10 @@
%check
pushd .%{gem_instdir}
-# Run the test suite.
+ln -s %{_builddir}/test test
+
+# Run only unit test now, acceptance tests wants to compile gems extensions
+ruby -Ilib -e 'Dir.glob "./test/unit/**/*_test.rb", &method(:require)'
popd
%files
@@ -70,5 +76,81 @@
%doc %{gem_instdir}/README.md
%changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment