Update the build-essential cookbook

This removes deprecation warnings on Chef 14, which ships with the
build_essential resource
This commit is contained in:
Greg Karékinian 2019-04-03 15:29:22 +02:00
parent 374d6bc975
commit adc417282d
7 changed files with 22 additions and 12 deletions

View File

@ -31,7 +31,9 @@ cookbook 'users', '~> 5.3.1'
cookbook 'hostname', '= 0.4.2'
cookbook 'firewall', '~> 2.6.3'
cookbook 'nginx', '= 9.0.0'
cookbook 'build-essential', '~> 8.1.1'
# Remove when cookbooks stop depending on it, the build_essential resource is
# part of Chef 14 (https://docs.chef.io/resource_build_essential.html)
cookbook 'build-essential', '~> 8.2.1'
cookbook 'mysql', '= 6.1.3'
cookbook 'postgresql', '= 7.1.4'
cookbook 'apt', '~> 7.0.0'

View File

@ -6,7 +6,7 @@ DEPENDENCIES
application_ruby (= 4.1.0)
apt (~> 7.0.0)
ark (= 3.1.0)
build-essential (~> 8.1.1)
build-essential (~> 8.2.1)
chef-sugar (= 3.3.0)
chef_client_updater (= 1.1.1)
compat_resource (= 12.19.0)
@ -87,7 +87,7 @@ GRAPH
build-essential (>= 0.0.0)
seven_zip (>= 0.0.0)
windows (>= 0.0.0)
build-essential (8.1.1)
build-essential (8.2.1)
mingw (>= 1.1)
seven_zip (>= 0.0.0)
chef-sugar (3.3.0)

View File

@ -2,6 +2,17 @@
This file is used to list changes made in each version of the build-essential cookbook.
## 8.2.1 (2018-09-04)
- Add a note that this cookbook is no longer maintained as the build_essential resource was moved directly into the chef-client making this cookbook no longer necessary.
## 8.2.0 (2018-08-28)
- Simplify the if installed logic for macos
- Remove support for FreeBSD < 10 which is VERY much EOL
- Avoid ChefSpec deprecation warnings
- Avoid deprecation warnings in Chef 14.3+ by not loading resources already in Chef
## 8.1.1 (2018-03-17)
- Make sure we install the last available xcode command line tool package so we get the latest version

View File

@ -4,6 +4,8 @@
Installs packages required for compiling C software from source. Use this cookbook if you wish to compile C programs, or install RubyGems with native extensions. Contains a resource, 'build_essential', as as well as a default recipe that simply calls that same resource.
Note: The functionality of this cookbook is now built into Chef 14+ in the [build_essential resource](https://docs.chef.io/resource_build_essential.html). This cookbook is no longer being maintained and all future changes will be done directly in the chef-client. We highly recommend you update your chef-client to the latest release and if possible migrate to using the build_essential resources instead of the recipe in this cookbook.
## Requirements
### Platforms

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
# Cookbook:: build-essential
# resource:: build_essential
#
# Copyright:: 2008-2018, Chef Software, Inc.
# Copyright:: 2008-2018, Chef Software Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -17,6 +17,7 @@
# limitations under the License.
#
chef_version_for_provides '< 14.0' if respond_to?(:chef_version_for_provides)
provides :build_essential
resource_name :build_essential
@ -36,8 +37,6 @@ action :install do
package 'devel/autoconf'
package 'devel/m4'
package 'devel/gettext'
# Only install gcc on freebsd 9.x - 10 uses clang
package 'lang/gcc49' if node['platform_version'].to_i <= 9
when 'mac_os_x'
xcode_command_line_tools 'install'
when 'omnios'

View File

@ -38,7 +38,6 @@ action :install do
# Remove the placeholder to prevent perpetual appearance in the update utility
rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
EOH
# rubocop:enable Metrics/LineLength
end
end
end
@ -53,9 +52,6 @@ action_class do
def installed?
cmd = Mixlib::ShellOut.new('pkgutil --pkgs=com.apple.pkg.CLTools_Executables')
cmd.run_command
cmd.error!
true
rescue Mixlib::ShellOut::ShellCommandFailed
false
cmd.error? ? false : true
end
end