Skip to content

Instantly share code, notes, and snippets.

@a15y87
Created October 13, 2016 15:18
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 a15y87/ea09cfd5fb92fccc670703938fb3be40 to your computer and use it in GitHub Desktop.
Save a15y87/ea09cfd5fb92fccc670703938fb3be40 to your computer and use it in GitHub Desktop.
# Generated from string-scrub-0.0.5.gem by gem2rpm -*- rpm-spec -*-
%global gem_name string-scrub
%global gem_name_mri string
Name: rubygem-%{gem_name}
Version: 0.1.1
Release: 1%{?dist}
Summary: String#scrub for Ruby 2.0.0 and 1.9.3
Group: Development/Languages
License: MIT
URL: https://github.com/hsbt/string-scrub
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby-devel >= 1.9.3
# BuildRequires: rubygem(rake-compiler)
# BuildRequires: rubygem(test-unit)
%description
String#scrub for Ruby 2.0.0 and 1.9.3.
%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
gem unpack %{SOURCE0}
%setup -q -D -T -n %{gem_name}-%{version}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%build
# Create the gem as gem install only works on a gem file
gem build %{gem_name}.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}/
%if 0%{?fedora} > 0
mkdir -p %{buildroot}%{gem_extdir_mri}
cp -ar .%{gem_extdir_mri}/{gem.build_complete,%{gem_name_mri}} %{buildroot}%{gem_extdir_mri}/
%endif
#%if 0%{?rhel} >= 7
#mkdir -p %{buildroot}%{gem_extdir_mri}/lib/%{gem_name_mri}
#cp -ar .%{gem_instdir}/lib/%{gem_name_mri}/%{gem_name_mri}.so %{buildroot}%{gem_extdir_mri}/lib/%{gem_name}
#%endif
# Prevent dangling symlink in -debuginfo (rhbz#878863).
rm -rf %{buildroot}%{gem_instdir}/ext/
# Run the test suite
%check
pushd .%{gem_instdir}
popd
%files
%dir %{gem_instdir}
%if 0%{?fedora} > 0
%{gem_extdir_mri}
%endif
%exclude %{gem_instdir}/.gitignore
%exclude %{gem_instdir}/.travis.yml
%license %{gem_instdir}/LICENSE.txt
###%{gem_instdir}/ext
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%{gem_instdir}/Gemfile
%doc %{gem_instdir}/README.md
%{gem_instdir}/Rakefile
%{gem_instdir}/string-scrub.gemspec
%{gem_instdir}/test
%changelog
* Tue May 24 2016 Andrey Bardin <a15y87@gmail.com> - 0.1.1-1
- Updated to 0.1.1
* Tue Dec 15 2015 Andrey Bardin <a15y87@gmail.com> - 0.0.5-1
- Initial package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment