[rubygem-openscap/devel: 1/2] Enable SCL build of rubygem-openscap.

Šimon Lukašík isimluk at fedoraproject.org
Thu Oct 23 22:15:32 UTC 2014


commit bde58025f85aaa1add7c33d71f9add093b279dcd
Author: Šimon Lukašík <slukasik at redhat.com>
Date:   Wed Oct 22 11:47:47 2014 +0200

    Enable SCL build of rubygem-openscap.

 rubygem-openscap.spec |   55 ++++++++++++++++++++++++++++++------------------
 1 files changed, 34 insertions(+), 21 deletions(-)
---
diff --git a/rubygem-openscap.spec b/rubygem-openscap.spec
index 9c405b4..3e4a01b 100644
--- a/rubygem-openscap.spec
+++ b/rubygem-openscap.spec
@@ -1,7 +1,16 @@
-# Generated from openscap-0.1.0.gem by gem2rpm -*- rpm-spec -*-
+# This package contains macros that provide functionality relating to
+# Software Collections. These macros are not used in default
+# Fedora builds, and should not be blindly copied or enabled.
+# Specifically, the "scl" macro must not be defined in official Fedora
+# builds. For more information, see:
+# http://docs.fedoraproject.org/en-US/Fedora_Contributor_Documentation/1/html/Software_Collections_Guide/index.html
+
+%{?scl:%scl_package rubygem-%{gem_name}}
+%{!?scl:%global pkg_name %{name}}
+
 %global gem_name openscap
 
-Name: rubygem-%{gem_name}
+Name: %{?scl_prefix}rubygem-%{gem_name}
 Version: 0.2.0
 Release: 2%{?dist}
 Summary: A FFI wrapper around the OpenSCAP library
@@ -9,25 +18,25 @@ Group: Development/Languages
 License: GPLv2+
 URL: https://github.com/isimluk/ruby-openscap
 Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
-Requires: ruby(release)
-Requires: ruby(rubygems)
-Requires: rubygem(ffi) >= 1.4.0
+Requires: %{?scl_prefix}ruby(release)
+Requires: %{?scl_prefix}ruby(rubygems)
+Requires: %{?scl_prefix}rubygem(ffi) >= 1.4.0
 # require libopenscap.so.8 in an arch neutral way
 Requires: openscap >= 1.0.0
 Requires: openscap < 1.2.0
-BuildRequires: ruby(release)
-BuildRequires: rubygems-devel
-BuildRequires: ruby >= 2.0.0
+BuildRequires: %{?scl_prefix}ruby(release)
+BuildRequires: %{?scl_prefix}rubygems-devel
+BuildRequires: %{?scl_prefix}ruby >= 2.0.0
 # For tests we need:
-BuildRequires: rubygem(rake)
-BuildRequires: rubygem(bundler)
-BuildRequires: rubygem(test-unit)
-BuildRequires: rubygem(ffi) >= 1.4.0
+BuildRequires: %{?scl_prefix}rubygem(rake)
+BuildRequires: %{?scl_prefix}rubygem(bundler)
+BuildRequires: %{?scl_prefix}rubygem(test-unit)
+BuildRequires: %{?scl_prefix}rubygem(ffi) >= 1.4.0
 BuildRequires: openscap-devel
 # End (for the tests we needed)
 
 BuildArch: noarch
-Provides: rubygem(%{gem_name}) = %{version}
+Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version}
 
 %description
 A FFI wrapper around the OpenSCAP library. The %{name}
@@ -43,19 +52,27 @@ BuildArch: noarch
 Development files for %{name}
 
 %prep
+%{?scl:scl enable %{scl} "}
 gem unpack %{SOURCE0}
+%{?scl:"}
 
 %setup -q -D -T -n  %{gem_name}-%{version}
 
+%{?scl:scl enable %{scl} "}
 gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
+%{?scl:"}
 
 %build
-# Create the gem as gem install only works on a gem file
+mkdir -p .%{gem_dir}
+
+%{?scl:scl enable %{scl} "}
 gem build %{gem_name}.gemspec
+%{?scl:"}
 
-# %%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
+%{?scl:scl enable %{scl} "}
+gem install --local --install-dir .%{gem_dir} \
+            --force %{SOURCE0} --no-rdoc --no-ri
+%{?scl:"}
 
 %check
 rake test
@@ -64,12 +81,8 @@ rake test
 mkdir -p %{buildroot}%{gem_dir}
 cp -pa .%{gem_dir}/* \
         %{buildroot}%{gem_dir}/
-rm %{buildroot}%{gem_instdir}/.gitignore
-rm %{buildroot}%{gem_instdir}/VERSION
-mv %{buildroot}%{gem_instdir}/openscap.gemspec %{buildroot}/%{gem_spec}
 
 %files
-%doc %{gem_docdir}
 %doc %{gem_instdir}/COPYING
 %doc %{gem_instdir}/README.md
 %dir %{gem_instdir}


More information about the scm-commits mailing list