LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File rubygem-chef.spec of Package rubygem-chef (Project systemsmanagement:chef:master)

# spec file for package rubygem-chef
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/

Name:           rubygem-chef
Version:        11.4.0
Release:        0
%define mod_name chef
%define mod_full_name %{mod_name}-%{version}

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Requires(pre):  pwdutils
BuildRequires:  ruby-macros >= 1
BuildRequires:  rubygem-rspec
BuildRequires:  rubygem-ipaddress
BuildRequires:  rubygem-mixlib-config
BuildRequires:  rubygem-mixlib-log
BuildRequires:  rubygem-mixlib-shellout
BuildRequires:  rubygem-mixlib-authentication
BuildRequires:  rubygem-ohai
BuildRequires:  rubygem-bunny-0_6
BuildRequires:  rubygem-uuidtools
BuildRequires:  rubygem-moneta
BuildRequires:  rubygem-erubis-2_7
BuildRequires:  rubygem-rack-1_4
BuildRequires:  rubygem-thin
BuildRequires:  rubygem-highline
BuildRequires:  rubygem-net-ssh-2_2
BuildRequires:  rubygem-net-ssh-multi
BuildRequires:  rubygem-rest-client
BuildRequires:  rubygem-treetop
BuildRequires:  rubygem-dep_selector
BuildRequires:  rubygem-systemu
BuildRequires:  rubygem-yajl-ruby

Url:            http://wiki.opscode.com/display/chef
Source:         %{mod_full_name}.gem
Source1:        chef-example.rb
Source2:        chef-client.init
Source3:        CHEF-3685-dotfiles.patch
Source4:        patch-create-empty-files
# fix the group provider in openSUSE 12.3
Source5:        CHEF-4015-group.patch
Summary:        A systems integration framework
License:        Apache-2.0
Group:          Development/Languages/Ruby

A systems integration framework, built to bring the benefits of configuration
management to your entire infrastructure.

%package doc
Summary:        RDoc documentation for %{mod_name}
Group:          Development/Languages/Ruby
Requires:       %{name} = %{version}

%description doc
Documentation generated at gem installation time.
Usually in RDoc and RI formats.

%package testsuite
Summary:        Test suite for %{mod_name}
Group:          Development/Languages/Ruby
Requires:       %{name} = %{version}

%description testsuite
Test::Unit or RSpec files, useful for developers.

%gem_install -f
pushd %{buildroot}%{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_name}-%{version}
  patch -p1 < %{S:3}
  sh %{S:4} < %{S:3} # work around SP2 patch not understanding diff --git
  patch -p1 < %{S:5}
  sh %{S:4} < %{S:5} # work around SP2 patch not understanding diff --git

mkdir -p %{buildroot}/etc/chef
mkdir -p %{buildroot}/etc/init.d/
cp %{S:1} %{buildroot}/etc/chef/chef.rb
cp %{S:2} %{buildroot}%{_sysconfdir}/init.d/chef-client
mkdir -p %{buildroot}%{_sbindir}
ln -s %{_sysconfdir}/init.d/chef-client %{buildroot}%{_sbindir}/rcchef-client
mkdir -p %{buildroot}%{_localstatedir}/log/chef
mkdir -p %{buildroot}%{_localstatedir}/lib/chef
mkdir -p %{buildroot}%{_localstatedir}/cache/chef
mkdir -p %{buildroot}%{_localstatedir}/run/chef

getent group chef  >/dev/null || groupadd -r chef
getent passwd chef >/dev/null || useradd  -r -g chef -d %{_localstatedir}/lib/chef -s /sbin/nologin -c "Opscode Chef Daemon" chef
exit 0

%fillup_and_insserv chef-client

%stop_on_removal chef-client

%restart_on_update chef-client

#cd %{buildroot}/%{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_full_name}
#rspec .

%config(noreplace) %attr(0640, root, chef) /etc/chef/chef.rb
%exclude %{_libdir}/ruby/gems/%{rb_ver}/gems/%{mod_full_name}/spec
%dir %attr(0750, root, chef) %{_sysconfdir}/chef
%dir %attr(0750, chef, chef) %{_localstatedir}/log/chef
%dir %attr(0750, chef, chef) %{_localstatedir}/lib/chef
%dir %attr(0750, chef, chef) %{_localstatedir}/cache/chef
%ghost %attr(0750, chef, chef) %{_localstatedir}/run/chef
%config %attr(0755,root,root) %{_sysconfdir}/init.d/chef-*

%files doc
%doc %{_libdir}/ruby/gems/%{rb_ver}/doc/%{mod_full_name}/

%files testsuite