]> git.pld-linux.org Git - packages/ruby-ohai.git/blobdiff - ruby-ohai.spec
up to 6.22.0
[packages/ruby-ohai.git] / ruby-ohai.spec
index abfd6ec118671df5bc3a8306ef6b26c48d6cdf54..07b741587fc4deaf46421284c4799f7b29849264 100644 (file)
@@ -1,23 +1,44 @@
-%define gemname ohai
+#
+# Conditional build:
+%bcond_without tests           # build without tests
+
+%define pkgname ohai
 Summary:       Profiles your system and emits JSON
-Name:          ruby-%{gemname}
-Version:       0.6.10
+Name:          ruby-%{pkgname}
+Version:       6.22.0
 Release:       1
 License:       Apache v2.0
 Group:         Development/Languages
-Source0:       http://gems.rubyforge.org/gems/%{gemname}-%{version}.gem
-# Source0-md5: 01dea23cd76c6c7e609923810dce9607
-# Request to include: http://tickets.opscode.com/browse/OHAI-169
-Source1:       ohai.1
+Source0:       https://github.com/opscode/ohai/archive/%{version}/%{pkgname}-%{version}.tar.gz
+# Source0-md5: 10631d1b5cfcfe960336680d0ad3b030
+Patch0:                virtualization-vserver.patch
+Patch1:                php-builddate.patch
+Patch2:                https://github.com/glensc/ruby-ohai/compare/OHAI-295.patch
+# Patch2-md5:  7e0f3de1daa40df05a2aa82547d7ca67
 URL:           http://docs.opscode.com/ohai.html
 BuildRequires: rpm-rubyprov
-BuildRequires: rpmbuild(macros) >= 1.656
-Requires:      ruby-extlib
-Requires:      ruby-json
+BuildRequires: rpmbuild(macros) >= 1.665
+BuildRequires: ruby-rake
+BuildRequires: sed >= 4.0
+%if %{with tests}
+BuildRequires: ruby-ipaddress
+BuildRequires: ruby-mixlib-config
+BuildRequires: ruby-mixlib-log
+BuildRequires: ruby-mixlib-shellout
+BuildRequires: ruby-rspec
+BuildRequires: ruby-systemu >= 2.5.2
+BuildRequires: ruby-yajl
+%endif
+Requires:      iproute2
+Requires:      lsb-release
+Requires:      ruby-ipaddress
 Requires:      ruby-mixlib-cli
 Requires:      ruby-mixlib-config
 Requires:      ruby-mixlib-log
-Requires:      ruby-systemu
+Requires:      mount
+Requires:      ruby-mixlib-shellout
+Requires:      ruby-systemu >= 2.5.2
+Requires:      ruby-yajl
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -35,38 +56,48 @@ Requires:   %{name} = %{version}-%{release}
 This package contains documentation for %{name}.
 
 %prep
-%setup -q
+%setup -q -n ohai-%{version}
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
+
+# no plist and not darwin so don't care
+rm spec/unit/plugins/darwin/system_profiler_spec.rb
+
+# can't figure how to fix -r rubygems does not help
+# ohai-6.16.0/spec/unit/plugins/ruby_spec.rb:52:in `block in <top (required)>': uninitialized cons tant Gem (NameError)
+rm spec/unit/plugins/ruby_spec.rb
 
 %build
+rake gem
+%{__tar} -xmf pkg/ohai-%{version}.gem
+%__gem_helper spec
+
 %if %{with tests}
 # Occasionally fails with "undefined method `rfc2822' for nil:NilClass" during
 # mock. Unsure why - disable for now.
-sed -i 's^Time.should_receive(:now)^^' spec/ohai/plugins/ohai_time_spec.rb
-rake spec
+#sed -i 's^Time.should_receive(:now)^^' spec/ohai/plugins/ohai_time_spec.rb
+LC_ALL=en_US.utf8 \
+rake -r rubygems spec
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}}
+install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir},%{_mandir}/man1}
 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
-
-# http://tickets.opscode.com/browse/OHAI-169
-install -d $RPM_BUILD_ROOT%{_mandir}/man1
-install -Dp %{SOURCE1} $RPM_BUILD_ROOT%{_mandir}/man1/ohai.1
+cp -p docs/man/man1/ohai.1 $RPM_BUILD_ROOT%{_mandir}/man1
+cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc README.rdoc
+%doc README.rdoc CHANGELOG.md NOTICE
 %attr(755,root,root) %{_bindir}/ohai
 %{_mandir}/man1/ohai.1*
-%{ruby_vendorlibdir}/ohai.rb
-%{ruby_vendorlibdir}/ohai
-
-%if 0
-%files doc
-%defattr(644,root,root,755)
-%endif
+%{ruby_vendorlibdir}/%{pkgname}.rb
+%{ruby_vendorlibdir}/%{pkgname}
+%{ruby_specdir}/%{pkgname}-%{version}.gemspec
This page took 0.066734 seconds and 4 git commands to generate.