Skip to content

Instantly share code, notes, and snippets.

@pvalena
Created January 20, 2021 13:21
Show Gist options
  • Save pvalena/160baec47dc31c9790203c1e8365b3b8 to your computer and use it in GitHub Desktop.
Save pvalena/160baec47dc31c9790203c1e8365b3b8 to your computer and use it in GitHub Desktop.
--- rubygem-bcrypt/.generated.spec 2021-01-20 14:15:07.746281743 +0100
+++ rubygem-bcrypt/rubygem-bcrypt.spec 2021-01-20 14:13:49.205895851 +0100
@@ -1,30 +1,27 @@
-# Generated from bcrypt-3.1.16.gem by gem2rpm -*- rpm-spec -*-
%global gem_name bcrypt
Name: rubygem-%{gem_name}
Version: 3.1.16
Release: 1%{?dist}
-Summary: OpenBSD's bcrypt() password hashing algorithm
-License: MIT
+Summary: Wrapper around bcrypt() password hashing algorithm
+# ext/* - Public Domain
+# spec/TestBCrypt.java - ISC
+License: MIT and Public Domain and ISC
URL: https://github.com/codahale/bcrypt-ruby
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
+BuildRequires: ruby
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby-devel
-# Compiler is required for build of gem binary extension.
-# https://fedoraproject.org/wiki/Packaging:C_and_C++#BuildRequires_and_Requires
+BuildRequires: rubygem(rspec)
BuildRequires: gcc
-# BuildRequires: rubygem(rake-compiler) >= 0.9.2
-# BuildRequires: rubygem(rake-compiler) < 0.10
-# BuildRequires: rubygem(rspec) >= 3
+# bcrypt-ruby is renamed to bcrypt
+Obsoletes: rubygem-bcrypt-ruby <= 3.1.2-2
%description
bcrypt() is a sophisticated and secure hash algorithm designed by The
-OpenBSD project
-for hashing passwords. The bcrypt Ruby gem provides a simple wrapper for
-safely handling
-passwords.
-
+OpenBSD project for hashing passwords. bcrypt-ruby provides a simple,
+humane wrapper for safely handling passwords.
%package doc
Summary: Documentation for %{name}
@@ -38,11 +35,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
@@ -56,33 +49,170 @@
# Prevent dangling symlink in -debuginfo (rhbz#878863).
rm -rf %{buildroot}%{gem_instdir}/ext/
-
%check
pushd .%{gem_instdir}
-# rspec spec
+rspec -I$(dirs +1)%{gem_extdir_mri} spec
popd
%files
%dir %{gem_instdir}
%{gem_extdir_mri}
-%exclude %{gem_instdir}/.gitignore
-%exclude %{gem_instdir}/.travis.yml
+%exclude %{gem_instdir}/.*
+%exclude %{gem_instdir}/appveyor.yml
%license %{gem_instdir}/COPYING
-%{gem_instdir}/appveyor.yml
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
-%exclude %{gem_instdir}/.rspec
%doc %{gem_instdir}/CHANGELOG
-%{gem_instdir}/Gemfile
+%{gem_instdir}/Gemfile*
%doc %{gem_instdir}/README.md
%{gem_instdir}/Rakefile
-%{gem_instdir}/bcrypt.gemspec
+%{gem_instdir}/%{gem_name}.gemspec
%{gem_instdir}/spec
%changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment