]> git.pld-linux.org Git - SPECS.git/blob - ruby-bson_ext.spec
SPECS updated Mon 29 Apr 22:05:02 CEST 2024
[SPECS.git] / ruby-bson_ext.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define gem_name bson_ext
6 Summary:        C extensions for Ruby BSON
7 Name:           ruby-%{gem_name}
8 Version:        1.6.4
9 Release:        1
10 License:        Apache v2.0
11 Group:          Development/Languages
12 Source0:        http://rubygems.org/gems/%{gem_name}-%{version}.gem
13 # Source0-md5:  5360798f3d7d94d65be6c19aeacfc91f
14 # git clone http://github.com/mongodb/mongo-ruby-driver.git && cd mongo-ruby-driver/
15 # git checkout 1.6.4
16 # tar czvf bson_ext-1.6.4-tests.tgz test/bson/ test/support/
17 Source1:        %{gem_name}-%{version}-tests.tgz
18 URL:            http://www.mongodb.org/display/DOCS/BSON
19 BuildRequires:  rpm-rubyprov
20 BuildRequires:  rpmbuild(macros) >= 1.656
21 BuildRequires:  ruby-devel
22 BuildRequires:  setup.rb
23 %if %{with tests}
24 BuildRequires:  ruby-bson >= 1.4.0
25 BuildRequires:  ruby-json
26 BuildRequires:  ruby-minitest
27 %endif
28 Requires:       ruby-bson >= 1.4.0
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
32 C extensions to accelerate the Ruby BSON serialization. For more
33 information about BSON, see <http://bsonspec.org>. For information
34 about MongoDB, see <http://www.mongodb.org>.
35
36 %package doc
37 Summary:        Documentation for %{name}
38 Group:          Documentation
39 Requires:       %{name} = %{version}-%{release}
40
41 %description doc
42 Documentation for %{name}
43
44 %prep
45 %setup -q -n %{gem_name}-%{version} -a1
46 cp -p %{_datadir}/setup.rb .
47
48 %build
49 %{__ruby} setup.rb config
50 %{__make} V=1 -C ext/cbson \
51         CC="%{__cc}"
52
53 %if %{with tests}
54 # Run the test suite with minitest.
55 # https://jira.mongodb.org/browse/RUBY-465
56 sed -i "/gem 'test-unit'/ d" test/bson/test_helper.rb
57
58 # Remove the inclusion of bson (absolute path that doesn't exist) and rather require it while running ruby
59 sed -i "/require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'bson')/d" test/bson/test_helper.rb
60
61 # Test suite fails on i386 :/
62 # https://jira.mongodb.org/browse/RUBY-466
63 ruby -Iext -e "require 'bson'; Dir.glob('./test/bson/*_test.rb').each {|t| require t}" || :
64 %endif
65
66 %install
67 rm -rf $RPM_BUILD_ROOT
68 install -d $RPM_BUILD_ROOT%{ruby_vendorarchdir}
69 install -p ext/cbson/cbson.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}
70
71 %clean
72 rm -rf $RPM_BUILD_ROOT
73
74 %files
75 %defattr(644,root,root,755)
76 %attr(755,root,root) %{ruby_vendorarchdir}/cbson.so
This page took 0.248934 seconds and 3 git commands to generate.