]> git.pld-linux.org Git - packages/ruby-ohai.git/blob - ruby-ohai.spec
build with rubygems provides
[packages/ruby-ohai.git] / ruby-ohai.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define pkgname ohai
6 Summary:        Profiles your system and emits JSON
7 Name:           ruby-%{pkgname}
8 Version:        6.16.0
9 Release:        4
10 License:        Apache v2.0
11 Group:          Development/Languages
12 Source0:        https://github.com/opscode/ohai/archive/%{version}.tar.gz
13 # Source0-md5:  5c00b0ba4c313bedfec62cd5e1525551
14 Patch0:         virtualization-vserver.patch
15 URL:            http://docs.opscode.com/ohai.html
16 BuildRequires:  rpm-rubyprov
17 BuildRequires:  rpmbuild(macros) >= 1.665
18 BuildRequires:  ruby-rake
19 BuildRequires:  sed >= 4.0
20 %if %{with tests}
21 BuildRequires:  ruby-ipaddress
22 BuildRequires:  ruby-mixlib-config
23 BuildRequires:  ruby-mixlib-log
24 BuildRequires:  ruby-mixlib-shellout
25 BuildRequires:  ruby-rspec
26 BuildRequires:  ruby-systemu
27 BuildRequires:  ruby-yajl
28 %endif
29 Requires:       lsb-release
30 Requires:       ruby-ipaddress
31 Requires:       ruby-mixlib-cli
32 Requires:       ruby-mixlib-config
33 Requires:       ruby-mixlib-log
34 Requires:       ruby-mixlib-shellout
35 Requires:       ruby-systemu
36 Requires:       ruby-yajl
37 BuildArch:      noarch
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %description
41 Ohai detects data about your operating system and prints out a JSON
42 data blob. It can be used standalone, but it's primary purpose is to
43 provide node data to Chef.
44
45 %package doc
46 Summary:        Documentation for %{name}
47 Group:          Documentation
48 Requires:       %{name} = %{version}-%{release}
49
50 %description doc
51 This package contains documentation for %{name}.
52
53 %prep
54 %setup -q -n ohai-%{version}
55 %patch0 -p1
56 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
57
58 # no plist and not darwin so don't care
59 rm spec/unit/plugins/darwin/system_profiler_spec.rb
60
61 # can't figure how to fix -r rubygems does not help
62 # ohai-6.16.0/spec/unit/plugins/ruby_spec.rb:52:in `block in <top (required)>': uninitialized cons tant Gem (NameError)
63 rm spec/unit/plugins/ruby_spec.rb
64
65 %build
66 rake gem
67 %{__tar} -xmf pkg/ohai-%{version}.gem
68 %__gem_helper spec
69
70 %if %{with tests}
71 # Occasionally fails with "undefined method `rfc2822' for nil:NilClass" during
72 # mock. Unsure why - disable for now.
73 #sed -i 's^Time.should_receive(:now)^^' spec/ohai/plugins/ohai_time_spec.rb
74 LC_ALL=en_US.utf8 \
75 rake -r rubygems spec
76 %endif
77
78 %install
79 rm -rf $RPM_BUILD_ROOT
80 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir},%{_mandir}/man1}
81 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
82 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
83 cp -p docs/man/man1/ohai.1 $RPM_BUILD_ROOT%{_mandir}/man1
84 cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
85
86 %clean
87 rm -rf $RPM_BUILD_ROOT
88
89 %files
90 %defattr(644,root,root,755)
91 %doc README.rdoc CHANGELOG NOTICE
92 %attr(755,root,root) %{_bindir}/ohai
93 %{_mandir}/man1/ohai.1*
94 %{ruby_vendorlibdir}/%{pkgname}.rb
95 %{ruby_vendorlibdir}/%{pkgname}
96 %{ruby_specdir}/%{pkgname}-%{version}.gemspec
This page took 1.528368 seconds and 4 git commands to generate.