Project

General

Profile

« Previous | Next » 

Revision 776d41fe

Added by Ewoud Kohl van Wijngaarden about 4 years ago

Add %check to rubygem-pg

View differences:

packages/foreman/rubygem-pg/rubygem-pg.spec
%{!?scl:%global pkg_name %{name}}
%global gem_name pg
%global gem_require_name %{gem_name}
Name: %{?scl_prefix}rubygem-%{gem_name}
Version: 1.1.4
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Pg is the Ruby interface to the PostgreSQL RDBMS
Group: Development/Languages
# Upstream license clarification (https://bitbucket.org/ged/ruby-pg/issue/72/)
......
# Prevent dangling symlink in -debuginfo (rhbz#878863).
rm -rf %{buildroot}%{gem_instdir}/ext/
%check
%{?scl:scl enable %{scl} - << \EOF}
# Ideally, this would be something like this:
# GEM_PATH="%{buildroot}%{gem_dir}:$GEM_PATH" ruby -e "require '%{gem_require_name}'"
# But that fails to find native extensions on EL8, so we fake the structure that ruby expects
mkdir gem_ext_test
cp -a %{buildroot}%{gem_dir} gem_ext_test/
mkdir -p gem_ext_test/gems/extensions/%{_arch}-%{_target_os}/$(ruby -r rbconfig -e 'print RbConfig::CONFIG["ruby_version"]')/
cp -a %{buildroot}%{gem_extdir_mri} gem_ext_test/gems/extensions/%{_arch}-%{_target_os}/$(ruby -r rbconfig -e 'print RbConfig::CONFIG["ruby_version"]')/
GEM_PATH="./gem_ext_test/gems:$GEM_PATH" ruby -e "require '%{gem_require_name}'"
rm -rf gem_ext_test
%{?scl:EOF}
%files
%dir %{gem_instdir}
%{gem_extdir_mri}
......
%{gem_instdir}/spec
%changelog
* Thu Apr 16 2020 Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl> - 1.1.4-3
- Add check section to test native library
* Wed Apr 08 2020 Zach Huntington-Meath <zhunting@redhat.com> - 1.1.4-2
- Bump to release for EL8

Also available in: Unified diff