]> git.pld-linux.org Git - packages/chef.git/blobdiff - chef.spec
use poldek as package manager :)
[packages/chef.git] / chef.spec
index e8a6017a37589560b0a6d890f003654b7c824f7c..d6a1ae5551003eb727ecb90c488eafc4d461d7e2 100644 (file)
--- a/chef.spec
+++ b/chef.spec
@@ -1,29 +1,40 @@
-# TODO
-# - try not to use /var/chef
+#
+# Conditional build:
+%bcond_with    tests           # build without tests
+
 Summary:       A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure
 Name:          chef
 Version:       11.4.4
-Release:       0.11
+Release:       2
 License:       Apache v2.0
 Group:         Development/Languages
 Source0:       http://rubygems.org/downloads/%{name}-%{version}.gem
 # Source0-md5: dc50aa6a4a7d4785a4c82fcaab3f9436
+Source1:       %{name}.rb
 Patch0:                platform-pld.patch
+Patch1:                FHS.patch
+Patch2:                https://github.com/glensc/chef/compare/poldek.patch
+# Patch2-md5:  df7d8380da401ba9c37faeeb9250ae36
 URL:           http://wiki.opscode.com/display/chef
 BuildRequires: rpm-rubyprov
 BuildRequires: rpmbuild(macros) >= 1.656
 BuildRequires: sed >= 4.0
 %if %{with tests}
+BuildRequires: ruby-abstract
+BuildRequires: ruby-mixlib-authentication >= 1.3.0
+BuildRequires: ruby-net-ssh-multi >= 1.1.0
 BuildRequires: ruby-rack
 BuildRequires: ruby-rake
-BuildRequires: ruby-rdoc
+#BuildRequires:        ruby-rdoc
+BuildRequires: ruby-rest-client >= 1.0.4
 BuildRequires: ruby-rspec-core >= 2.12.0
 BuildRequires: ruby-rspec-expectations >= 2.12.0
 BuildRequires: ruby-rspec-mocks >= 2.12.0
-BuildRequires: ruby-rspec_junit_formatter
-BuildRequires: ruby-sdoc
+#BuildRequires:        ruby-rspec_junit_formatter
+#BuildRequires:        ruby-sdoc
 %endif
 Requires:      lsb-release
+Requires:      poldek >= 0.30
 Requires:      ruby-erubis
 Requires:      ruby-highline >= 1.6.9
 Requires:      ruby-json >= 1.4.4
@@ -38,7 +49,6 @@ Requires:     ruby-ohai >= 0.6.0
 Requires:      ruby-rest-client >= 1.0.4
 Requires:      ruby-rubygems
 Requires:      ruby-yajl >= 1.1
-Requires:      yum >= 3.4.3-7
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -49,16 +59,24 @@ configuration management to your entire infrastructure.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
 
+%build
+%if %{with tests}
+rspec spec
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}}
+install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}} \
+       $RPM_BUILD_ROOT{%{_sysconfdir},/var/{cache,lib}}/%{name}
 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
 
-install -d $RPM_BUILD_ROOT{%{_sysconfdir},/var}/%{name}
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/chef.rb
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -67,6 +85,7 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %doc README.md CONTRIBUTING.md
 %dir %{_sysconfdir}/%{name}
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/chef.rb
 %attr(755,root,root) %{_bindir}/chef-apply
 %attr(755,root,root) %{_bindir}/chef-client
 %attr(755,root,root) %{_bindir}/chef-shell
@@ -76,5 +95,5 @@ rm -rf $RPM_BUILD_ROOT
 %{ruby_vendorlibdir}/chef.rb
 %{ruby_vendorlibdir}/chef
 
-# FIXME: FHS
-%dir /var/%{name}
+%dir /var/lib/%{name}
+%dir /var/cache/%{name}
This page took 0.067761 seconds and 4 git commands to generate.