Blame SPECS/rubygem-pg.spec

24c35d
%{?scl:%scl_package rubygem-%{gem_name}}
24c35d
%{!?scl:%global pkg_name %{name}}
24c35d
24c35d
# Enable test. This includes RSpec into sources.
24c35d
%bcond_with tests
24c35d
24c35d
# Generated from pg-0.11.0.gem by gem2rpm -*- rpm-spec -*-
24c35d
%global gem_name pg
24c35d
24c35d
Name: %{?scl_prefix}rubygem-%{gem_name}
24c35d
Version: 1.2.3
24c35d
Release: 1%{?dist}
24c35d
Summary: A Ruby interface to the PostgreSQL RDBMS
24c35d
# Upstream license clarification (https://bitbucket.org/ged/ruby-pg/issue/72/)
24c35d
#
24c35d
# The portions of the code that are BSD-licensed are licensed under
24c35d
# the BSD 3-Clause license; the contents of the BSD file are incorrect.
24c35d
#
24c35d
License: (BSD or Ruby) and PostgreSQL
24c35d
URL: https://github.com/ged/ruby-pg
24c35d
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
24c35d
# Sources of RSpec for interanl tests. Don't import these.
24c35d
%if %{with tests}
24c35d
Source200: https://rubygems.org/gems/diff-lcs-1.3.gem
24c35d
Source201: https://rubygems.org/gems/rspec-3.7.0.gem
24c35d
Source202: https://rubygems.org/gems/rspec-core-3.7.0.gem
24c35d
Source203: https://rubygems.org/gems/rspec-expectations-3.7.0.gem
24c35d
Source204: https://rubygems.org/gems/rspec-mocks-3.7.0.gem
24c35d
Source205: https://rubygems.org/gems/rspec-support-3.7.0.gem
24c35d
%endif
24c35d
# Disable RPATH.
24c35d
# https://bitbucket.org/ged/ruby-pg/issue/183
24c35d
Patch0: rubygem-pg-0.17.1-remove-rpath.patch
24c35d
# Required in ext/pg_text_decoder.c
24c35d
Requires: %{?scl_prefix}rubygem(bigdecimal)
24c35d
BuildRequires: %{?scl_prefix}ruby(release)
24c35d
BuildRequires: %{?scl_prefix}rubygems-devel
24c35d
BuildRequires: %{?scl_prefix}ruby-devel
24c35d
# Compiler is required for build of gem binary extension.
24c35d
# https://fedoraproject.org/wiki/Packaging:C_and_C++#BuildRequires_and_Requires
24c35d
BuildRequires: gcc
24c35d
24c35d
BuildRequires: postgresql-server postgresql-devel
24c35d
BuildRequires: %{?scl_prefix}rubygem(bigdecimal)
24c35d
Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version}
24c35d
24c35d
%description
24c35d
This is the extension library to access a PostgreSQL database from Ruby.
24c35d
This library works with PostgreSQL 9.1 and later.
24c35d
24c35d
24c35d
%package doc
24c35d
Summary: Documentation for %{pkg_name}
24c35d
Requires: %{?scl_prefix}%{pkg_name} = %{version}-%{release}
24c35d
BuildArch: noarch
24c35d
24c35d
%description doc
24c35d
Documentation for %{pkg_name}.
24c35d
24c35d
%prep
24c35d
%{?scl:scl enable %{scl} - << \EOF}
24c35d
set -ex
24c35d
gem unpack %{SOURCE0}
24c35d
24c35d
%setup -q -D -T -n  %{gem_name}-%{version}
24c35d
24c35d
gem spec %{SOURCE0} -l --ruby > ../%{gem_name}-%{version}.gemspec
24c35d
24c35d
%patch0 -p1
24c35d
%{?scl:EOF}
24c35d
24c35d
%build
24c35d
%{?scl:scl enable %{scl} - << \EOF}
24c35d
set -ex
24c35d
# Create the gem as gem install only works on a gem file
24c35d
gem build ../%{gem_name}-%{version}.gemspec
24c35d
24c35d
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
24c35d
# by default, so that we can move it into the buildroot in %%install
24c35d
%gem_install
24c35d
%{?scl:EOF}
24c35d
24c35d
%install
24c35d
set -ex
24c35d
mkdir -p %{buildroot}%{gem_dir}
24c35d
cp -a .%{gem_dir}/* \
24c35d
        %{buildroot}%{gem_dir}/
24c35d
24c35d
mkdir -p %{buildroot}%{gem_extdir_mri}
24c35d
cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/
24c35d
24c35d
# Prevent dangling symlink in -debuginfo (rhbz#878863).
24c35d
rm -rf %{buildroot}%{gem_instdir}/ext/
24c35d
24c35d
# Remove useless shebangs.
24c35d
sed -i -e '/^#!\/usr\/bin\/env/d' %{buildroot}%{gem_instdir}/Rakefile
24c35d
sed -i -e '/^#!\/usr\/bin\/env/d' %{buildroot}%{gem_instdir}/Rakefile.cross
24c35d
24c35d
# Files under %%{gem_libdir} are not executable.
24c35d
for file in `find %{buildroot}%{gem_libdir} -type f -name "*.rb"`; do
24c35d
    sed -i '/^#!\/usr\/bin\/env/ d' $file \
24c35d
    && chmod -v 644 $file
24c35d
done
24c35d
24c35d
%if %{with tests}
24c35d
%check
24c35d
%{?scl:scl enable %{scl} - << \EOF}
24c35d
set -ex
24c35d
pushd .%{gem_instdir}
24c35d
24c35d
# Set a test directory to prevent DB start failures due to
24c35d
# 'Unix-domain socket path "..." is too long (maximum 107 bytes)'.
24c35d
export RUBY_PG_TEST_DIR="${HOME}/tmp_test_specs"
24c35d
24c35d
pushd %{_sourcedir}
24c35d
gem install rspec*.gem --local --no-document
24c35d
popd
24c35d
# Export path with locally installed rspec executable.
24c35d
export PATH="~/bin:${PATH}"
24c35d
24c35d
# Set --verbose to show detail log by $VERBOSE.
24c35d
# See https://github.com/ged/ruby-pg/blob/master/spec/helpers.rb $VERBOSE
24c35d
# Assign a random port to consider a case of multi builds in parallel in a host.
24c35d
# https://github.com/ged/ruby-pg/pull/39
24c35d
if ! PGPORT="$((54321 + ${RANDOM} % 1000))" ruby -S --verbose \
24c35d
  rspec -I$(dirs +1)%{gem_extdir_mri} -f d spec; then
24c35d
  echo "==== [setup.log start ] ===="
24c35d
  cat tmp_test_specs/setup.log
24c35d
  echo "==== [setup.log end ] ===="
24c35d
  false
24c35d
fi
24c35d
popd
24c35d
%{?scl:EOF}
24c35d
%endif
24c35d
24c35d
%files
24c35d
%dir %{gem_instdir}
24c35d
%{gem_extdir_mri}
24c35d
%exclude %{gem_instdir}/.gemtest
24c35d
%license %{gem_instdir}/BSDL
24c35d
%license %{gem_instdir}/POSTGRES
24c35d
%license %{gem_instdir}/LICENSE
24c35d
%{gem_libdir}
24c35d
%exclude %{gem_cache}
24c35d
%{gem_spec}
24c35d
24c35d
%files doc
24c35d
%doc %{gem_docdir}
24c35d
%doc %{gem_instdir}/ChangeLog
24c35d
%doc %{gem_instdir}/Contributors.rdoc
24c35d
%doc %{gem_instdir}/History.rdoc
24c35d
%doc %{gem_instdir}/Manifest.txt
24c35d
%doc %{gem_instdir}/README-OS_X.rdoc
24c35d
%doc %{gem_instdir}/README-Windows.rdoc
24c35d
%doc %{gem_instdir}/README.ja.rdoc
24c35d
%doc %{gem_instdir}/README.rdoc
24c35d
%{gem_instdir}/Rakefile*
24c35d
%{gem_instdir}/spec
24c35d
24c35d
%changelog
24c35d
* Thu Mar 19 2020 Jun Aruga <jaruga@redhat.com> - 1.2.3-1
24c35d
- Update to pg 1.2.3.
24c35d
24c35d
* Mon Jan 06 2020 Jun Aruga <jaruga@redhat.com> - 1.2.1-1
24c35d
- Update to pg 1.2.1.
24c35d
- Add marking lines at the start and end of the setup.log
24c35d
- Assign a random testing port.
24c35d
24c35d
* Thu Jan 10 2019 Vít Ondruch <vondruch@redhat.com> - 1.1.4-1
24c35d
- Update to pg 1.1.4.
24c35d
24c35d
* Sun Feb 18 2018 Jun Aruga <jaruga@redhat.com> - 1.0.0-1
24c35d
- Update to pg 1.0.0.
24c35d
24c35d
* Fri Dec 08 2017 Jun Aruga <jaruga@redhat.com> - 0.21.0-2
24c35d
- Fix failed tests for PostgreSQL-10.
24c35d
24c35d
* Thu Aug 17 2017 Vít Ondruch <vondruch@redhat.com> - 0.21.0-1
24c35d
- Update to pg 0.21.0.
24c35d
24c35d
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.20.0-3
24c35d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
24c35d
24c35d
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.20.0-2
24c35d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
24c35d
24c35d
* Mon May 29 2017 Vít Ondruch <vondruch@redhat.com> - 0.20.0-1
24c35d
- Update to pg 0.20.0.
24c35d
24c35d
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.18.4-4
24c35d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
24c35d
24c35d
* Sun Jan 15 2017 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.18.4-3
24c35d
- F-26: rebuild for ruby24
24c35d
- Patch from the upstream for test failure with integer unification
24c35d
24c35d
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.18.4-2
24c35d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
24c35d
24c35d
* Wed Jan 06 2016 Vít Ondruch <vondruch@redhat.com> - 0.18.4-1
24c35d
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.3
24c35d
- Update to pg 0.18.4.
24c35d
24c35d
* Wed Aug 26 2015 Vít Ondruch <vondruch@redhat.com> - 0.18.2-1
24c35d
- Update to pg 0.18.2.
24c35d
24c35d
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.18.1-2
24c35d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
24c35d
24c35d
* Fri Jan 16 2015 Vít Ondruch <vondruch@redhat.com> - 0.18.1-1
24c35d
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.2
24c35d
- Update to pg 0.18.1.
24c35d
24c35d
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.17.1-3
24c35d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
24c35d
24c35d
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.17.1-2
24c35d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
24c35d
24c35d
* Tue Apr 15 2014 Vít Ondruch <vondruch@redhat.com> - 0.17.1-1
24c35d
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.1
24c35d
- Update to pg 0.17.1.
24c35d
24c35d
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.14.1-2
24c35d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
24c35d
24c35d
* Thu Mar 07 2013 Vít Ondruch <vondruch@redhat.com> - 0.14.1-1
24c35d
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
24c35d
- Update to pg 0.14.1.
24c35d
24c35d
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12.2-4
24c35d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
24c35d
24c35d
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12.2-3
24c35d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
24c35d
24c35d
* Tue Feb 07 2012 Vít Ondruch <vondruch@redhat.com> - 0.12.2-2
24c35d
- Obsolete ruby-postgress, which was retired.
24c35d
24c35d
* Tue Jan 24 2012 Vít Ondruch <vondruch@redhat.com> - 0.12.2-1
24c35d
- Rebuilt for Ruby 1.9.3.
24c35d
- Upgrade to pg 0.12.2.
24c35d
24c35d
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.0-6
24c35d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
24c35d
24c35d
* Fri Jun 03 2011 Vít Ondruch <vondruch@redhat.com> - 0.11.0-5
24c35d
- Pass CFLAGS to extconf.rb.
24c35d
24c35d
* Fri Jun 03 2011 Vít Ondruch <vondruch@redhat.com> - 0.11.0-4
24c35d
- Binary extension moved into ruby_sitearch dir.
24c35d
- -doc subpackage made architecture independent.
24c35d
24c35d
* Wed Jun 01 2011 Vít Ondruch <vondruch@redhat.com> - 0.11.0-3
24c35d
- Quoted upstream license clarification.
24c35d
24c35d
* Mon May 30 2011 Vít Ondruch <vondruch@redhat.com> - 0.11.0-2
24c35d
- Removed/fixed shebang in non-executables.
24c35d
- Removed sources.
24c35d
24c35d
* Thu May 26 2011 Vít Ondruch <vondruch@redhat.com> - 0.11.0-1
24c35d
- Initial package