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