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
26 URL: https://wiki.opscode.com/display/chef/
27 BuildRequires: rpm-rubyprov
28 BuildRequires: rpmbuild(macros) >= 1.673
29 BuildRequires: sed >= 4.0
31 BuildRequires: ruby-rack
32 BuildRequires: ruby-rake
33 BuildRequires: ruby-rspec-core < 2.15
34 BuildRequires: ruby-rspec-core >= 2.14.0
35 BuildRequires: ruby-rspec-expectations < 2.15
36 BuildRequires: ruby-rspec-expectations >= 2.14.0
37 BuildRequires: ruby-rspec-mocks < 2.15
38 BuildRequires: ruby-rspec-mocks >= 2.14.0
39 BuildRequires: ruby-rspec_junit_formatter
42 Requires: poldek >= 0.30
43 Requires: ruby >= 1:1.9.3.429-4
44 Requires: ruby-chef-config = %{version}-%{release}
45 Requires: ruby-erubis >= 2.7.0-3
46 Requires: ruby-json <= 1.8.1
47 Requires: ruby-json >= 1.4.4
48 Requires: ruby-mime-types < 2
49 Requires: ruby-mime-types >= 1.16
50 Requires: ruby-mixlib-authentication >= 1.3.0-2
51 Requires: ruby-mixlib-config < 3
52 Requires: ruby-mixlib-config >= 2.0
53 Requires: ruby-mixlib-log >= 1.6.0-2
54 Requires: ruby-ohai < 9
55 Requires: ruby-rest-client >= 1.0.4
56 Requires: ruby-rubygems
57 Suggests: chef-zero >= 2.1.4
58 Suggests: ruby-plist >= 3.1.0
60 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62 # do not generate python dependency, yum support is optional
63 %define _noautoreqfiles %{ruby_vendorlibdir}/chef/provider/package/yum-dump.py
66 A systems integration framework, built to bring the benefits of
67 configuration management to your entire infrastructure.
69 %package -n ruby-chef-config
70 Summary: Chef's default configuration and config loading
71 Group: Development/Languages
73 %description -n ruby-chef-config
74 Chef's default configuration and config loading.
76 %package -n bash-completion-knife
77 Summary: bash-completion for knife
78 Summary(pl.UTF-8): bashowe uzupełnianie nazw dla knifea
79 Group: Applications/Shells
80 Requires: %{name} >= 0.10
81 Requires: bash-completion >= 2.0
83 %description -n bash-completion-knife
84 This package provides bash-completion for knife.
86 %description -n bash-completion-knife -l pl.UTF-8
87 Pakiet ten dostarcza bashowe uzupełnianie nazw dla knifea.
90 Summary: knife - Chef Server API client utility
91 Group: Networking/Admin
92 Requires: %{name} = %{version}-%{release}
95 Knife is a command-line utility used to manage data on a Chef server
96 through the HTTP(S) API. Knife is organized into groups of subcommands
97 centered around the various object types in Chef. Each category of
98 subcommand is documented in its own manual page.
102 #%patch0 -p1 # UPDATE
109 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
112 # those do not match s.executables from .gemspec
113 rm bin/chef-service-manager
114 rm bin/chef-windows-service
117 # don't package this, a maintainer's rake task
118 rm chef-config/lib/chef-config/package_task.rb
120 # cleanup backups after patching
121 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
123 grep --exclude-dir=spec --exclude-dir=distro --exclude=CHANGELOG.md -r /var/chef . && exit 1
126 # make gemspec self-contained
127 %__gem_helper spec-dump %{name}.gemspec
134 # make gemspec self-contained
135 %__gem_helper spec-dump %{name}-config.gemspec
138 rm -rf $RPM_BUILD_ROOT
139 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name},%{_bindir},%{_mandir}/man1,%{systemdtmpfilesdir}} \
140 $RPM_BUILD_ROOT%{ruby_vendorlibdir}/chef/reporting \
141 $RPM_BUILD_ROOT%{ruby_specdir} \
142 $RPM_BUILD_ROOT/var/{run/%{name},cache/%{name},lib/%{name}/{roles,data_bags,environments,reports,backup}}
145 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
146 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
147 cp -a distro/common/man/* $RPM_BUILD_ROOT%{_mandir}
148 cp -p chef-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
149 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/README.md
152 cp -a chef-config/lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
153 cp -p chef-config/chef-config-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
155 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
157 install -d $RPM_BUILD_ROOT%{bash_compdir}
158 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{bash_compdir}/knife
161 rm -rf $RPM_BUILD_ROOT
164 %defattr(644,root,root,755)
165 %doc README.md CONTRIBUTING.md
166 %dir %{_sysconfdir}/%{name}
167 %attr(755,root,root) %{_bindir}/chef-apply
168 %attr(755,root,root) %{_bindir}/chef-client
169 %attr(755,root,root) %{_bindir}/chef-shell
170 %attr(755,root,root) %{_bindir}/chef-solo
171 %{_mandir}/man1/chef-shell.1*
172 %{_mandir}/man8/chef-apply.8*
173 %{_mandir}/man8/chef-client.8*
174 %{_mandir}/man8/chef-solo.8*
175 %{ruby_vendorlibdir}/chef.rb
176 %{ruby_vendorlibdir}/chef
177 %{ruby_specdir}/chef-%{version}.gemspec
178 %exclude %{ruby_vendorlibdir}/chef/knife
179 %exclude %{ruby_vendorlibdir}/chef/application/knife.rb
180 %exclude %{ruby_vendorlibdir}/chef/chef_fs/knife.rb
181 %exclude %{ruby_vendorlibdir}/chef/knife.rb
182 %{systemdtmpfilesdir}/chef.conf
184 %dir /var/lib/%{name}
185 %dir /var/lib/%{name}/roles
186 %dir /var/lib/%{name}/data_bags
187 %dir /var/lib/%{name}/environments
188 %dir /var/lib/%{name}/reports
189 %dir %attr(750,root,root) /var/lib/%{name}/backup
191 %dir /var/cache/%{name}
192 %dir /var/run/%{name}
194 %files -n ruby-chef-config
195 %defattr(644,root,root,755)
196 %{ruby_vendorlibdir}/chef-config.rb
197 %{ruby_vendorlibdir}/chef-config
198 %{ruby_specdir}/chef-config-%{version}.gemspec
201 %defattr(644,root,root,755)
202 %attr(755,root,root) %{_bindir}/knife
203 %{ruby_vendorlibdir}/chef/knife.rb
204 %{ruby_vendorlibdir}/chef/knife
205 %{ruby_vendorlibdir}/chef/application/knife.rb
206 %{ruby_vendorlibdir}/chef/chef_fs/knife.rb
207 %{_mandir}/man1/knife-bootstrap.1*
208 %{_mandir}/man1/knife-client.1*
209 %{_mandir}/man1/knife-configure.1*
210 %{_mandir}/man1/knife-cookbook-site.1*
211 %{_mandir}/man1/knife-cookbook.1*
212 %{_mandir}/man1/knife-data-bag.1*
213 %{_mandir}/man1/knife-delete.1*
214 %{_mandir}/man1/knife-deps.1*
215 %{_mandir}/man1/knife-diff.1*
216 %{_mandir}/man1/knife-download.1*
217 %{_mandir}/man1/knife-edit.1*
218 %{_mandir}/man1/knife-environment.1*
219 %{_mandir}/man1/knife-exec.1*
220 %{_mandir}/man1/knife-index-rebuild.1*
221 %{_mandir}/man1/knife-list.1*
222 %{_mandir}/man1/knife-node.1*
223 %{_mandir}/man1/knife-raw.1*
224 %{_mandir}/man1/knife-recipe-list.1*
225 %{_mandir}/man1/knife-role.1*
226 %{_mandir}/man1/knife-search.1*
227 %{_mandir}/man1/knife-serve.1*
228 %{_mandir}/man1/knife-show.1*
229 %{_mandir}/man1/knife-ssh.1*
230 %{_mandir}/man1/knife-ssl-check.1*
231 %{_mandir}/man1/knife-ssl-fetch.1*
232 %{_mandir}/man1/knife-status.1*
233 %{_mandir}/man1/knife-tag.1*
234 %{_mandir}/man1/knife-upload.1*
235 %{_mandir}/man1/knife-user.1*
236 %{_mandir}/man1/knife-xargs.1*
237 %{_mandir}/man1/knife.1*
239 %files -n bash-completion-knife
240 %defattr(644,root,root,755)
241 %{bash_compdir}/knife