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