2 # - check releases here: https://downloads.chef.io/chef-client/debian/
3 # the versions tagged in github are somewhat newer, perhaps dev-releases
6 %bcond_with tests # build without tests
8 Summary: A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure
13 Group: Networking/Admin
14 Source0: https://github.com/chef/chef/archive/v%{version}/%{name}-%{version}.tar.gz
15 # Source0-md5: 2390cdbde7445ccc288992401ed62f08
16 Source2: %{name}.tmpfiles
17 Source3: https://raw.github.com/stevendanna/knife-hacks/master/shell/knife_completion.sh
18 # Source3-md5: a4c1e41370be8088a59ddb3b2e7ea397
19 Patch0: platform-pld.patch
22 Patch3: https://github.com/glensc/chef/compare/pld-knife-boostrap.patch
23 # Patch3-md5: 8ff0fdfde6dc90018698775bf8f13062
24 Patch4: optional-plist.patch
25 URL: https://wiki.opscode.com/display/chef/
26 BuildRequires: rpm-rubyprov
27 BuildRequires: rpmbuild(macros) >= 1.673
28 BuildRequires: sed >= 4.0
30 BuildRequires: ruby-rack
31 BuildRequires: ruby-rake
32 BuildRequires: ruby-rspec-core < 2.15
33 BuildRequires: ruby-rspec-core >= 2.14.0
34 BuildRequires: ruby-rspec-expectations < 2.15
35 BuildRequires: ruby-rspec-expectations >= 2.14.0
36 BuildRequires: ruby-rspec-mocks < 2.15
37 BuildRequires: ruby-rspec-mocks >= 2.14.0
38 BuildRequires: ruby-rspec_junit_formatter
41 Requires: poldek >= 0.30
42 Requires: ruby >= 1:1.9.3.429-4
43 Requires: ruby-chef-config = %{version}-%{release}
44 Requires: ruby-erubis >= 2.7.0-3
45 Requires: ruby-json <= 1.8.1
46 Requires: ruby-json >= 1.4.4
47 Requires: ruby-mime-types < 2
48 Requires: ruby-mime-types >= 1.16
49 Requires: ruby-mixlib-authentication >= 1.3.0-2
50 Requires: ruby-mixlib-config < 3
51 Requires: ruby-mixlib-config >= 2.0
52 Requires: ruby-mixlib-log >= 1.6.0-2
53 Requires: ruby-ohai < 9
54 Requires: ruby-rest-client >= 1.0.4
55 Requires: ruby-rubygems
56 Suggests: chef-zero >= 2.1.4
57 Suggests: ruby-plist >= 3.1.0
59 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
61 # do not generate python dependency, yum support is optional
62 %define _noautoreqfiles %{ruby_vendorlibdir}/chef/provider/package/yum-dump.py
65 A systems integration framework, built to bring the benefits of
66 configuration management to your entire infrastructure.
68 %package -n ruby-chef-config
69 Summary: Chef's default configuration and config loading
70 Group: Development/Languages
72 %description -n ruby-chef-config
73 Chef's default configuration and config loading.
75 %package -n bash-completion-knife
76 Summary: bash-completion for knife
77 Summary(pl.UTF-8): bashowe uzupełnianie nazw dla knifea
78 Group: Applications/Shells
79 Requires: %{name} >= 0.10
80 Requires: bash-completion >= 2.0
82 %description -n bash-completion-knife
83 This package provides bash-completion for knife.
85 %description -n bash-completion-knife -l pl.UTF-8
86 Pakiet ten dostarcza bashowe uzupełnianie nazw dla knifea.
89 Summary: knife - Chef Server API client utility
90 Group: Networking/Admin
91 Requires: %{name} = %{version}-%{release}
94 Knife is a command-line utility used to manage data on a Chef server
95 through the HTTP(S) API. Knife is organized into groups of subcommands
96 centered around the various object types in Chef. Each category of
97 subcommand is documented in its own manual page.
101 #%patch0 -p1 # UPDATE
107 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
110 # those do not match s.executables from .gemspec
111 rm bin/chef-service-manager
112 rm bin/chef-windows-service
115 # cleanup backups after patching
116 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
118 grep --exclude-dir=spec --exclude-dir=distro --exclude=CHANGELOG.md -r /var/chef . && exit 1
121 # make gemspec self-contained
122 %__gem_helper spec-dump %{name}.gemspec
129 # make gemspec self-contained
130 %__gem_helper spec-dump %{name}-config.gemspec
133 rm -rf $RPM_BUILD_ROOT
134 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_bindir},%{_mandir}/man1,%{systemdtmpfilesdir}} \
135 $RPM_BUILD_ROOT%{ruby_vendorlibdir}/chef/reporting \
136 $RPM_BUILD_ROOT%{ruby_specdir} \
137 $RPM_BUILD_ROOT/var/{run/%{name},cache/%{name},lib/%{name}/{roles,data_bags,environments,reports,backup}}
140 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
141 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
142 cp -a distro/common/man/* $RPM_BUILD_ROOT%{_mandir}
143 cp -p chef-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
144 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/README.md
147 cp -a chef-config/lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
148 cp -p chef-config/chef-config-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
150 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
152 install -d $RPM_BUILD_ROOT%{bash_compdir}
153 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{bash_compdir}/knife
156 rm -rf $RPM_BUILD_ROOT
159 %defattr(644,root,root,755)
160 %doc README.md CONTRIBUTING.md
161 %dir %{_sysconfdir}/%{name}
162 %attr(755,root,root) %{_bindir}/chef-apply
163 %attr(755,root,root) %{_bindir}/chef-client
164 %attr(755,root,root) %{_bindir}/chef-shell
165 %attr(755,root,root) %{_bindir}/chef-solo
166 %{_mandir}/man1/chef-shell.1*
167 %{_mandir}/man8/chef-apply.8*
168 %{_mandir}/man8/chef-client.8*
169 %{_mandir}/man8/chef-solo.8*
170 %{ruby_vendorlibdir}/chef.rb
171 %{ruby_vendorlibdir}/chef
172 %{ruby_specdir}/chef-%{version}.gemspec
173 %exclude %{ruby_vendorlibdir}/chef/knife
174 %exclude %{ruby_vendorlibdir}/chef/application/knife.rb
175 %exclude %{ruby_vendorlibdir}/chef/chef_fs/knife.rb
176 %exclude %{ruby_vendorlibdir}/chef/knife.rb
177 %{systemdtmpfilesdir}/chef.conf
179 %dir /var/lib/%{name}
180 %dir /var/lib/%{name}/roles
181 %dir /var/lib/%{name}/data_bags
182 %dir /var/lib/%{name}/environments
183 %dir /var/lib/%{name}/reports
184 %dir %attr(750,root,root) /var/lib/%{name}/backup
186 %dir /var/cache/%{name}
187 %dir /var/run/%{name}
189 %files -n ruby-chef-config
190 %defattr(644,root,root,755)
191 %{ruby_vendorlibdir}/chef-config.rb
192 %{ruby_vendorlibdir}/chef-config
193 %{ruby_specdir}/chef-config-%{version}.gemspec
196 %defattr(644,root,root,755)
197 %attr(755,root,root) %{_bindir}/knife
198 %{ruby_vendorlibdir}/chef/knife.rb
199 %{ruby_vendorlibdir}/chef/knife
200 %{ruby_vendorlibdir}/chef/application/knife.rb
201 %{ruby_vendorlibdir}/chef/chef_fs/knife.rb
202 %{_mandir}/man1/knife-bootstrap.1*
203 %{_mandir}/man1/knife-client.1*
204 %{_mandir}/man1/knife-configure.1*
205 %{_mandir}/man1/knife-cookbook-site.1*
206 %{_mandir}/man1/knife-cookbook.1*
207 %{_mandir}/man1/knife-data-bag.1*
208 %{_mandir}/man1/knife-delete.1*
209 %{_mandir}/man1/knife-deps.1*
210 %{_mandir}/man1/knife-diff.1*
211 %{_mandir}/man1/knife-download.1*
212 %{_mandir}/man1/knife-edit.1*
213 %{_mandir}/man1/knife-environment.1*
214 %{_mandir}/man1/knife-exec.1*
215 %{_mandir}/man1/knife-index-rebuild.1*
216 %{_mandir}/man1/knife-list.1*
217 %{_mandir}/man1/knife-node.1*
218 %{_mandir}/man1/knife-raw.1*
219 %{_mandir}/man1/knife-recipe-list.1*
220 %{_mandir}/man1/knife-role.1*
221 %{_mandir}/man1/knife-search.1*
222 %{_mandir}/man1/knife-serve.1*
223 %{_mandir}/man1/knife-show.1*
224 %{_mandir}/man1/knife-ssh.1*
225 %{_mandir}/man1/knife-ssl-check.1*
226 %{_mandir}/man1/knife-ssl-fetch.1*
227 %{_mandir}/man1/knife-status.1*
228 %{_mandir}/man1/knife-tag.1*
229 %{_mandir}/man1/knife-upload.1*
230 %{_mandir}/man1/knife-user.1*
231 %{_mandir}/man1/knife-xargs.1*
232 %{_mandir}/man1/knife.1*
234 %files -n bash-completion-knife
235 %defattr(644,root,root,755)
236 %{bash_compdir}/knife