Blame SPECS/rubygem-mongo.spec

be7e24
%{?scl:%scl_package rubygem-%{gem_name}}
be7e24
%{!?scl:%global pkg_name %{name}}
be7e24
be7e24
%global gem_name mongo
be7e24
be7e24
# Enable test. This includes RSpec into sources.
be7e24
%bcond_with tests
be7e24
be7e24
%if %{with tests}
be7e24
# Fallback to rh-mongodb36. rh-mongodb36-scldevel is probably not available in
be7e24
# the buildroot.
be7e24
%{?scl:%{!?scl_mongodb:%global scl_mongodb rh-mongodb36}}
be7e24
%{?scl:%{!?scl_prefix_mongodb:%global scl_prefix_mongodb %{scl_mongodb}-}}
be7e24
%endif
be7e24
be7e24
Name: %{?scl_prefix}rubygem-%{gem_name}
be7e24
Version: 2.11.3
be7e24
Release: 1%{?dist}
be7e24
Summary: Ruby driver for MongoDB
be7e24
Group: Development/Languages
be7e24
License: ASL 2.0
be7e24
URL: https://docs.mongodb.com/ruby-driver/
be7e24
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
be7e24
# Sources of RSpec for interanl tests. Don't import these.
be7e24
%if %{with tests}
be7e24
Source200: https://rubygems.org/gems/diff-lcs-1.3.gem
be7e24
Source201: https://rubygems.org/gems/rspec-3.7.0.gem
be7e24
Source202: https://rubygems.org/gems/rspec-core-3.7.0.gem
be7e24
Source203: https://rubygems.org/gems/rspec-expectations-3.7.0.gem
be7e24
Source204: https://rubygems.org/gems/rspec-mocks-3.7.0.gem
be7e24
Source205: https://rubygems.org/gems/rspec-support-3.7.0.gem
be7e24
%endif
be7e24
Requires:      %{?scl_prefix}ruby(release)
be7e24
Requires:      %{?scl_prefix}ruby(rubygems)
be7e24
Requires:      %{?scl_prefix}rubygem(bson) >= 4.6.0
be7e24
BuildRequires: %{?scl_prefix}ruby(release)
be7e24
BuildRequires: %{?scl_prefix}ruby(rubygems)
be7e24
BuildRequires: %{?scl_prefix}ruby
be7e24
BuildRequires: %{?scl_prefix}rubygems-devel
be7e24
%if %{with tests}
be7e24
# For running the tests
be7e24
BuildRequires: %{?scl_prefix_mongodb}mongodb-server
be7e24
BuildRequires: %{?scl_prefix}rubygem(bson) >= 4.6.0
be7e24
%endif
be7e24
BuildArch: noarch
be7e24
Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version}
be7e24
be7e24
%description
be7e24
A Ruby driver for MongoDB.
be7e24
be7e24
%package doc
be7e24
Summary: Documentation for %{pkg_name}
be7e24
Group: Documentation
be7e24
Requires:%{?scl_prefix}%{pkg_name} = %{version}-%{release}
be7e24
BuildArch: noarch
be7e24
be7e24
%description doc
be7e24
Documentation for %{pkg_name}.
be7e24
be7e24
%prep
be7e24
%{?scl:scl enable %{scl} - << \EOF}
be7e24
set -ex
be7e24
gem unpack %{SOURCE0}
be7e24
be7e24
%setup -q -D -T -n  %{gem_name}-%{version}
be7e24
be7e24
gem spec %{SOURCE0} -l --ruby > ../%{gem_name}-%{version}.gemspec
be7e24
%{?scl:EOF}
be7e24
be7e24
%build
be7e24
%{?scl:scl enable %{scl} - << \EOF}
be7e24
set -ex
be7e24
# Create the gem as gem install only works on a gem file
be7e24
gem build ../%{gem_name}-%{version}.gemspec
be7e24
be7e24
%gem_install
be7e24
%{?scl:EOF}
be7e24
be7e24
%install
be7e24
mkdir -p %{buildroot}%{gem_dir}
be7e24
cp -a .%{gem_dir}/* \
be7e24
        %{buildroot}%{gem_dir}/
be7e24
be7e24
be7e24
mkdir -p %{buildroot}%{_bindir}
be7e24
cp -a .%{_bindir}/* \
be7e24
        %{buildroot}%{_bindir}/
be7e24
be7e24
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
be7e24
be7e24
# Drop the shebang, file is not executable anyway.
be7e24
sed -i '/#!\// d' %{buildroot}%{gem_instdir}/Rakefile
be7e24
be7e24
%if %{with tests}
be7e24
%check
be7e24
%{?scl:scl enable %{scl} %{scl_mongodb} - << \EOF}
be7e24
set -ex
be7e24
pushd .%{gem_instdir}
be7e24
be7e24
pushd %{_sourcedir}
be7e24
gem install rspec*.gem --local --no-document
be7e24
popd
be7e24
# Export path with locally installed rspec executable.
be7e24
export PATH="~/bin:${PATH}"
be7e24
be7e24
# Create data directory and start testing mongo instance.
be7e24
# See https://github.com/mongodb/mongo-ruby-driver/blob/master/.travis.yml
be7e24
mkdir data
be7e24
mongod \
be7e24
  --dbpath data \
be7e24
  --logpath data/log \
be7e24
  --fork \
be7e24
  --auth
be7e24
be7e24
# timeout-interrupt is not available in Fedora yet.
be7e24
sed -i "/^if SpecConfig\.instance\.mri?$/i\\
be7e24
require 'timeout'\\
be7e24
TimeoutInterrupt = Timeout\\
be7e24
" spec/spec_helper.rb
be7e24
sed -i "/^if SpecConfig\.instance\.mri?$/,/^end$/ s/^/#/" spec/spec_helper.rb
be7e24
be7e24
# rspec-retry is not available in Fedora yet.
be7e24
sed -i "/require 'rspec\/retry'/ s/^/#/" spec/spec_helper.rb
be7e24
be7e24
# I can't figure why this fails. It might be upstream issue, because it seems
be7e24
# it was not tested against MonogoDB 4.x.
be7e24
sed -i "/collection.client.use(:admin).command(FAIL_POINT_BASE_COMMAND.merge(/i\        pending" \
be7e24
  spec/integration/bulk_insert_spec.rb
be7e24
be7e24
CI=1 EXTERNAL_DISABLED=1 rspec spec
be7e24
be7e24
# Shutdown mongo and cleanup the data.
be7e24
mongod --shutdown --dbpath data
be7e24
rm -rf data
be7e24
popd
be7e24
%{?scl:EOF}
be7e24
%endif
be7e24
be7e24
%files
be7e24
%dir %{gem_instdir}
be7e24
%{_bindir}/mongo_console
be7e24
%license %{gem_instdir}/LICENSE
be7e24
%{gem_instdir}/bin
be7e24
%{gem_libdir}
be7e24
%exclude %{gem_cache}
be7e24
%{gem_spec}
be7e24
be7e24
%files doc
be7e24
%doc %{gem_docdir}
be7e24
%doc %{gem_instdir}/CONTRIBUTING.md
be7e24
%doc %{gem_instdir}/README.md
be7e24
%{gem_instdir}/Rakefile
be7e24
%{gem_instdir}/mongo.gemspec
be7e24
%{gem_instdir}/spec
be7e24
be7e24
%changelog
be7e24
* Thu Mar 12 2020 Jun Aruga <jaruga@redhat.com> - 2.11.3-1
be7e24
- Update to mongo 2.11.3.
be7e24
be7e24
* Fri Dec 20 2019 Jun Aruga <jaruga@redhat.com> - 2.11.2-1
be7e24
- Update to mongo 2.11.2.
be7e24
be7e24
* Thu Jan 10 2019 Vít Ondruch <vondruch@redhat.com> - 2.6.2-1
be7e24
- Update to mongo 2.6.2.
be7e24
be7e24
* Mon Feb 26 2018 Jun Aruga <jaruga@redhat.com> - 2.5.1-1
be7e24
- Update to mongo 2.5.1.
be7e24
be7e24
* Fri Feb 16 2018 Jun Aruga <jaruga@redhat.com> - 2.5.0-1
be7e24
- Update to mongo 2.5.0.
be7e24
- Escape macros in %%changelog
be7e24
be7e24
* Thu Feb 15 2018 Jun Aruga <jaruga@redhat.com> - 2.4.3-2
be7e24
- Update mongodb SCL used in tests to rh-mongodb36.
be7e24
be7e24
* Mon Dec 18 2017 Jun Aruga <jaruga@redhat.com> - 2.4.3-1
be7e24
- Update to mongo 2.4.3.
be7e24
be7e24
* Thu Jan 19 2017 Jun Aruga <jaruga@redhat.com> - 2.4.1-1
be7e24
- Update to mongo 2.4.1.
be7e24
be7e24
* Mon Apr 18 2016 Pavel Valena <pvalena@redhat.com> - 2.2.3-5
be7e24
- Use rspec tests
be7e24
be7e24
* Tue Apr 12 2016 Pavel Valena <pvalena@redhat.com> - 2.2.3-4
be7e24
- Fix Fix missing wrapper for mongo_console executable
be7e24
  - Resolves: rhbz#1315283
be7e24
be7e24
* Wed Apr 06 2016 Pavel Valena <pvalena@redhat.com> - 2.2.3-3
be7e24
- Add rubygem-shoulda to BuildReqires (for tests)
be7e24
be7e24
* Wed Apr 06 2016 Pavel Valena <pvalena@redhat.com> - 2.2.3-2
be7e24
- Enable tests
be7e24
be7e24
* Mon Feb 29 2016 Pavel Valena <pvalena@redhat.com> - 2.2.3-1
be7e24
- Update to 2.2.3
be7e24
be7e24
* Tue Feb 16 2016 Troy Dawson <tdawson@redhat.com> - 1.10.2-5
be7e24
- Disable tests until mongodb becomes stable in rawhide again.
be7e24
be7e24
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.2-4
be7e24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
be7e24
be7e24
* Mon Jul 27 2015 Troy Dawson <tdawson@redhat.com> - 1.10.2-2
be7e24
- Fix tests
be7e24
be7e24
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10.2-2
be7e24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
be7e24
be7e24
* Thu Jun 26 2014 Vít Ondruch <vondruch@redhat.com> - 1.10.2-1
be7e24
- Update to mongo 1.10.2.
be7e24
be7e24
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.2-2
be7e24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
be7e24
be7e24
* Tue Nov 19 2013 Vít Ondruch <vondruch@redhat.com> - 1.9.2-1
be7e24
- Update to mongo 1.9.2.
be7e24
- Enabled test suite.
be7e24
be7e24
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.4-5
be7e24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
be7e24
be7e24
* Wed Mar 13 2013 Troy Dawson <tdawson@redhat.com> - 1.6.4-4
be7e24
- Fix to make it build/install on F19+
be7e24
be7e24
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.4-3
be7e24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
be7e24
be7e24
* Fri Aug 10 2012 Troy Dawson <tdawson@redhat.com> - 1.6.4-2
be7e24
- Fixed doc
be7e24
- removed more BuildRequires that are not required
be7e24
be7e24
* Thu Aug 09 2012 Troy Dawson <tdawson@redhat.com> - 1.6.4-1
be7e24
- Updated to latest version
be7e24
- Removed BuildRequires that are not needed
be7e24
be7e24
* Thu Aug 09 2012 Troy Dawson <tdawson@redhat.com> - 1.4.0-7
be7e24
- Fixed checks.  
be7e24
  Only run checks that do not require a running mongodb server
be7e24
be7e24
* Tue Aug 07 2012 Troy Dawson <tdawson@redhat.com> - 1.4.0-6
be7e24
- Changed .gemspec and Rakefile to not be doc
be7e24
- Added checks
be7e24
be7e24
* Thu Aug 02 2012 Troy Dawson <tdawson@redhat.com> - 1.4.0-5
be7e24
- Fixed rubygem(bson) requires
be7e24
be7e24
* Mon Jul 23 2012 Troy Dawson <tdawson@redhat.com> - 1.4.0-4
be7e24
- Updated to meet new fedora rubygem guidelines
be7e24
be7e24
* Thu Nov 17 2011 Troy Dawson <tdawson@redhat.com> - 1.4.0-3
be7e24
- Changed group to Development/Languages
be7e24
- Changed the global variables
be7e24
- Seperated the doc and test into the doc rpm
be7e24
be7e24
* Thu Nov 17 2011 Troy Dawson <tdawson@redhat.com> - 1.4.0-2
be7e24
- Added %%{?dist} to version
be7e24
be7e24
* Tue Nov 15 2011  <tdawson@redhat.com> - 1.4.0-1
be7e24
- Initial package