[packages/ruby-ohai/dev-7.0.0] up to 7.0.0 alpha1 snapshot

glen glen at pld-linux.org
Mon Nov 25 22:07:35 CET 2013


commit 3b794a9f2ecab8f9709ec3919e00d0baccb8353a
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Nov 25 23:07:00 2013 +0200

    up to 7.0.0 alpha1 snapshot

 php-builddate.patch          | 23 -------------
 ruby-ohai.spec               | 25 ++++++++------
 virtualization-vserver.patch | 80 ++++++++++++++++++++++++--------------------
 3 files changed, 57 insertions(+), 71 deletions(-)
---
diff --git a/ruby-ohai.spec b/ruby-ohai.spec
index e051e71..c2b23bf 100644
--- a/ruby-ohai.spec
+++ b/ruby-ohai.spec
@@ -1,18 +1,18 @@
 #
 # Conditional build:
-%bcond_without	tests		# build without tests
+%bcond_with	tests		# build without tests
 
 %define pkgname ohai
 Summary:	Profiles your system and emits JSON
 Name:		ruby-%{pkgname}
-Version:	6.18.0
-Release:	1
+Version:	7.0.0
+Release:	0.1
 License:	Apache v2.0
 Group:		Development/Languages
-Source0:	https://github.com/opscode/ohai/archive/%{version}/%{pkgname}-%{version}.tar.gz
-# Source0-md5:	898ee1f9395b9b7dc5c7d9779b8a6291
+#Source0:	https://github.com/opscode/ohai/archive/%{version}/%{pkgname}-%{version}.tar.gz
+Source0:	https://github.com/opscode/ohai/archive/master/%{pkgname}-%{version}-bcc1557.tar.gz
+# Source0-md5:	1192ea216030e105171162b57a40ca6f
 Patch0:		virtualization-vserver.patch
-Patch1:		php-builddate.patch
 URL:		http://docs.opscode.com/ohai.html
 BuildRequires:	rpm-rubyprov
 BuildRequires:	rpmbuild(macros) >= 1.665
@@ -52,9 +52,9 @@ Requires:	%{name} = %{version}-%{release}
 This package contains documentation for %{name}.
 
 %prep
-%setup -q -n ohai-%{version}
+%setup -qc
+mv ohai-*/* .
 %patch0 -p1
-%patch1 -p1
 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
 
 # no plist and not darwin so don't care
@@ -66,7 +66,7 @@ rm spec/unit/plugins/ruby_spec.rb
 
 %build
 rake gem
-%{__tar} -xmf pkg/ohai-%{version}.gem
+%{__tar} -xmf pkg/ohai-%{version}*.gem
 %__gem_helper spec
 
 %if %{with tests}
@@ -83,7 +83,10 @@ install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir},%{_ma
 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
 cp -p docs/man/man1/ohai.1 $RPM_BUILD_ROOT%{_mandir}/man1
-cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
+cp -p %{pkgname}-%{version}*.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
+
+# testing tool (used by spec/... files)
+rm $RPM_BUILD_ROOT%{_bindir}/grab_data.rb
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -95,4 +98,4 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/ohai.1*
 %{ruby_vendorlibdir}/%{pkgname}.rb
 %{ruby_vendorlibdir}/%{pkgname}
-%{ruby_specdir}/%{pkgname}-%{version}.gemspec
+%{ruby_specdir}/%{pkgname}-%{version}*.gemspec
diff --git a/php-builddate.patch b/php-builddate.patch
deleted file mode 100644
index 091c534..0000000
--- a/php-builddate.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-fix build date parsing from php if php patched with suhosin:
-
-$ php -v
-PHP 5.3.27 with Suhosin-Patch (cli) (built: Aug 30 2013 04:30:30) 
-Copyright (c) 1997-2013 The PHP Group
-Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
-
---- ohai-6.16.0/lib/ohai/plugins/php.rb	2013-01-17 21:03:16.000000000 +0200
-+++ ohai-6.16.0/lib/ohai/plugins/php.rb	2013-09-11 15:26:11.000000000 +0300
-@@ -26,10 +26,10 @@
- 
- status, stdout, stderr = run_command(:no_status_check => true, :command => "php -v")
- if status == 0
--  output = stdout.split
--  if output.length >= 6
-+  output = /PHP (\S+).+built: ([^)]+)/.match(stdout)
-+  if output
-     php[:version] = output[1]
--    php[:builddate] = "%s %s %s" % [output[4],output[5],output[6]]
-+    php[:builddate] = output[2]
-   end
-   languages[:php] = php if php[:version]
- end
diff --git a/virtualization-vserver.patch b/virtualization-vserver.patch
index 54b9080..d9c0eb3 100644
--- a/virtualization-vserver.patch
+++ b/virtualization-vserver.patch
@@ -1,41 +1,47 @@
---- ohai-6.16.0/lib/ohai/plugins/linux/virtualization.rb~	2013-01-17 21:03:16.000000000 +0200
-+++ ohai-6.16.0/lib/ohai/plugins/linux/virtualization.rb	2013-05-25 20:52:31.871480338 +0300
-@@ -23,6 +23,20 @@
- # if it is possible to detect paravirt vs hardware virt, it should be put in
- # virtualization[:mechanism]
+detect vserver before vbox, allowing "vbox-guest" status to overwrite "vserver-host" detection
+
+https://tickets.opscode.com/browse/OHAI-479
+
+--- ruby-ohai-7.0.0.alpha.0/lib/ohai/plugins/linux/virtualization.rb~	2013-11-25 21:34:08.000000000 +0200
++++ ruby-ohai-7.0.0.alpha.0/lib/ohai/plugins/linux/virtualization.rb	2013-11-25 22:36:18.108064611 +0200
+@@ -81,6 +81,20 @@
+       virtualization[:role] = "guest"
+     end
  
-+# Detect Linux-VServer
-+if File.exists?("/proc/self/status")
-+  proc_self_status = File.read("/proc/self/status")
-+  vxid = proc_self_status.match(/^(s_context|VxID): (\d+)$/)
-+  if vxid and vxid[2]
-+    virtualization[:system] = "linux-vserver"
-+    if vxid[2] == "0"
-+      virtualization[:role] = "host"
-+    else
-+      virtualization[:role] = "guest"
-+     end
-+  end
-+end
++    # Detect Linux-VServer
++    if File.exists?("/proc/self/status")
++      proc_self_status = File.read("/proc/self/status")
++      vxid = proc_self_status.match(/^(s_context|VxID): (\d+)$/)
++      if vxid and vxid[2]
++        virtualization[:system] = "linux-vserver"
++        if vxid[2] == "0"
++          virtualization[:role] = "host"
++        else
++          virtualization[:role] = "guest"
++        end
++      end
++    end
 +
- ## Xen
- # /proc/xen is an empty dir for EL6 + Linode Guests
- if File.exists?("/proc/xen")
-@@ -109,17 +123,3 @@
- 
+     # http://www.dmo.ca/blog/detecting-virtualization-on-linux
+     if File.exists?("/usr/sbin/dmidecode")
+       so = shell_out("dmidecode")
+@@ -109,19 +123,5 @@
+         nil
+       end
+     end
+-
+-    # Detect Linux-VServer
+-    if File.exists?("/proc/self/status")
+-      proc_self_status = File.read("/proc/self/status")
+-      vxid = proc_self_status.match(/^(s_context|VxID): (\d+)$/)
+-      if vxid and vxid[2]
+-        virtualization[:system] = "linux-vserver"
+-        if vxid[2] == "0"
+-          virtualization[:role] = "host"
+-        else
+-          virtualization[:role] = "guest"
+-        end
+-      end
+-    end
    end
  end
--
--# Detect Linux-VServer
--if File.exists?("/proc/self/status")
--  proc_self_status = File.read("/proc/self/status")
--  vxid = proc_self_status.match(/^(s_context|VxID): (\d+)$/)
--  if vxid and vxid[2]
--    virtualization[:system] = "linux-vserver"
--    if vxid[2] == "0"
--      virtualization[:role] = "host"
--    else
--      virtualization[:role] = "guest"
--     end
--  end
--end
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby-ohai.git/commitdiff/3b794a9f2ecab8f9709ec3919e00d0baccb8353a



More information about the pld-cvs-commit mailing list