Blame SPECS/rubygem-mongo.spec

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