Skip to content

Instantly share code, notes, and snippets.

@pvalena
Created January 11, 2024 05:07
Show Gist options
  • Save pvalena/78776fa47c6a78cba6554bafba8abdc7 to your computer and use it in GitHub Desktop.
Save pvalena/78776fa47c6a78cba6554bafba8abdc7 to your computer and use it in GitHub Desktop.
--- rubygem-addressable/.generated.spec 2024-01-11 05:56:47.715767260 +0100
+++ rubygem-addressable/rubygem-addressable.spec 2024-01-11 05:43:05.049600072 +0100
@@ -1,5 +1,4 @@
-Downloaded addressable-2.8.6
-# Generated from addressable-2.8.6.gem by gem2rpm -*- rpm-spec -*-
+# Generated from addressable-2.5.2.gem by gem2rpm -*- rpm-spec -*-
%global gem_name addressable
Name: rubygem-%{gem_name}
@@ -11,7 +10,9 @@
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
-BuildRequires: ruby >= 2.2
+BuildRequires: rubygem(bigdecimal)
+BuildRequires: rubygem(public_suffix)
+BuildRequires: rubygem(rspec-its)
BuildArch: noarch
%description
@@ -32,11 +33,7 @@
%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
@@ -44,11 +41,15 @@
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
-
-
%check
pushd .%{gem_instdir}
-# Run the test suite.
+# Drop Bundler dependency.
+sed -i "/require 'bundler\/setup'/ s/^/#/" spec/spec_helper.rb
+
+# Remove tests failing because of missing internet connection.
+mv spec/addressable/net_http_compat_spec.rb{,.disabled}
+
+LC_ALL=C.UTF-8 rspec spec/
popd
%files
@@ -64,11 +65,142 @@
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG.md
%{gem_instdir}/Gemfile
+%{gem_instdir}/%{gem_name}.gemspec
%doc %{gem_instdir}/README.md
%{gem_instdir}/Rakefile
-%{gem_instdir}/addressable.gemspec
%{gem_instdir}/spec
%changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment