Update upstream cookbooks
This commit is contained in:
2
cookbooks/build-essential/.foodcritic
Normal file
2
cookbooks/build-essential/.foodcritic
Normal file
@@ -0,0 +1,2 @@
|
||||
~FC052
|
||||
~FC057
|
||||
@@ -1,70 +1,82 @@
|
||||
build-essential Cookbook CHANGELOG
|
||||
==================================
|
||||
# build-essential Cookbook CHANGELOG
|
||||
|
||||
This file is used to list changes made in each version of the build-essential cookbook.
|
||||
|
||||
v2.2.4 (2015-10-06)
|
||||
-------------------
|
||||
* Add patch package on Fedora systems
|
||||
* Add additional platforms to Kitchen CI
|
||||
* Use Chef standard Rubocop file and resolve several issues
|
||||
* Update contributing and testing docs
|
||||
* Update Gemfile with the latest testing and development deps
|
||||
* Add maintainers.md and maintainers.toml files
|
||||
* Add chefignore file to limit the files uploaded to the Chef server
|
||||
* Add source_url and issues_url metadata for Supermarket
|
||||
## v2.4.0 (2016-03-21)
|
||||
|
||||
v2.2.3 (2015-04-15)
|
||||
-------------------
|
||||
* Don’t install omnibus-build-essential on Solaris 10 - We decided it’s easier to use the old GCC that ships with Solaris 10.
|
||||
* Use ChefDK for all Travis testing.
|
||||
- Add gettext package to RHEL / FreeBSD to match other platforms
|
||||
- Fix OS X version detection logic to properly detect OS X 10.10 and 10.11
|
||||
|
||||
v2.2.2 (2015-03-27)
|
||||
-------------------
|
||||
* Update Solar 10’s omnibus-build-essential to 0.0.5
|
||||
## v2.3.1 (2016-02-18)
|
||||
|
||||
v2.2.1 (2015-03-23)
|
||||
-------------------
|
||||
* Install GNU Patch on Solaris 11
|
||||
- Restore Chef 11 compatibility and add Travis / Test Kitchen testing for Chef 11
|
||||
|
||||
v2.2.0 (2015-03-18)
|
||||
-------------------
|
||||
* [solaris] Differentiate between Solaris 10 and 11
|
||||
* [solaris] Add ucb compat package
|
||||
* [solaris] Solaris 10 build essential setup
|
||||
* Fix metadata to use a string instead of a bool (see #56, #57)
|
||||
## v2.3.0 (2016-02-17)
|
||||
|
||||
v2.1.3 (2014-11-18)
|
||||
-------------------
|
||||
* Update metadata for supported versions of OS X (10.7+) as noted from
|
||||
v2.0.0 previously (#38)
|
||||
* Clarify requirement to have apt package cache updated in README. (#41)
|
||||
* Fix Xcode CLI installation on OS X (#50)
|
||||
- Add mingw/msys based build tools for Windows
|
||||
|
||||
v2.1.2 (2014-10-14)
|
||||
-------------------
|
||||
* Mac OS X 10.10 Yosemite support
|
||||
## v2.2.4 (2015-10-06)
|
||||
|
||||
v2.1.0 (2014-10-14)
|
||||
-------------------
|
||||
* Use fully-qualified names when installing FreeBSD package
|
||||
- Add patch package on Fedora systems
|
||||
- Add additional platforms to Kitchen CI
|
||||
- Use Chef standard Rubocop file and resolve several issues
|
||||
- Update contributing and testing docs
|
||||
- Update Gemfile with the latest testing and development deps
|
||||
- Add maintainers.md and maintainers.toml files
|
||||
- Add chefignore file to limit the files uploaded to the Chef server
|
||||
- Add source_url and issues_url metadata for Supermarket
|
||||
|
||||
v2.0.6 (2014-08-11)
|
||||
-------------------
|
||||
* Use the resource form of `remote_file` to prevent context issues
|
||||
## v2.2.3 (2015-04-15)
|
||||
|
||||
v2.0.4 (2014-06-06)
|
||||
-------------------
|
||||
* [COOK-4661] added patch package to _rhel recipe
|
||||
- Don't install omnibus-build-essential on Solaris 10 - We decided it's easier to use the old GCC that ships with Solaris 10.
|
||||
- Use ChefDK for all Travis testing.
|
||||
|
||||
## v2.2.2 (2015-03-27)
|
||||
|
||||
- Update Solar 10's omnibus-build-essential to 0.0.5
|
||||
|
||||
## v2.2.1 (2015-03-23)
|
||||
|
||||
- Install GNU Patch on Solaris 11
|
||||
|
||||
## v2.2.0 (2015-03-18)
|
||||
|
||||
- [solaris] Differentiate between Solaris 10 and 11
|
||||
- [solaris] Add ucb compat package
|
||||
- [solaris] Solaris 10 build essential setup
|
||||
- Fix metadata to use a string instead of a bool (see #56, #57)
|
||||
|
||||
## v2.1.3 (2014-11-18)
|
||||
|
||||
- Update metadata for supported versions of OS X (10.7+) as noted from
|
||||
- v2.0.0 previously (#38)
|
||||
- Clarify requirement to have apt package cache updated in README. (#41)
|
||||
- Fix Xcode CLI installation on OS X (#50)
|
||||
|
||||
## v2.1.2 (2014-10-14)
|
||||
|
||||
- Mac OS X 10.10 Yosemite support
|
||||
|
||||
## v2.1.0 (2014-10-14)
|
||||
|
||||
- Use fully-qualified names when installing FreeBSD package
|
||||
|
||||
## v2.0.6 (2014-08-11)
|
||||
|
||||
- Use the resource form of `remote_file` to prevent context issues
|
||||
|
||||
## v2.0.4 (2014-06-06)
|
||||
|
||||
- [COOK-4661] added patch package to _rhel recipe
|
||||
|
||||
## v2.0.2 (2014-05-02)
|
||||
|
||||
v2.0.2 (2014-05-02)
|
||||
-------------------
|
||||
- Updated documentation about older Chef versions
|
||||
- Added new SVG badges to the README
|
||||
- Fix a bug where `potentially_at_compile_time` fails on non-resources
|
||||
|
||||
v2.0.0 (2014-03-13)
|
||||
-------------------
|
||||
## v2.0.0 (2014-03-13)
|
||||
|
||||
- Updated tested harnesses to use latest ecosystem tools
|
||||
- Added support for FreeBSD
|
||||
- Added support for installing XCode Command Line Tools on OSX (10.7, 10.8, 10.9)
|
||||
@@ -80,57 +92,60 @@ v2.0.0 (2014-03-13)
|
||||
- `compiletime` -> `compile_time` in node attributes
|
||||
- Cookbook version 2.x no longer supports Chef 10.x
|
||||
|
||||
v1.4.4 (2014-02-27)
|
||||
-------------------
|
||||
## v1.4.4 (2014-02-27)
|
||||
|
||||
- [COOK-4245] Wrong package name used for developer tools on OS X 10.9
|
||||
|
||||
v1.4.2
|
||||
------
|
||||
## v1.4.2
|
||||
|
||||
### Bug
|
||||
|
||||
- **[COOK-3318](https://tickets.chef.io/browse/COOK-3318)** - Use Mixlib::ShellOut instead of Chef::ShellOut
|
||||
|
||||
### New Feature
|
||||
|
||||
- **[COOK-3093](https://tickets.chef.io/browse/COOK-3093)** - Add OmniOS support
|
||||
|
||||
### Improvement
|
||||
|
||||
- **[COOK-3024](https://tickets.chef.io/browse/COOK-3024)** - Use newer package on SmartOS
|
||||
|
||||
v1.4.0
|
||||
------
|
||||
## v1.4.0
|
||||
|
||||
This version splits up the default recipe into recipes included based on the node's platform_family.
|
||||
|
||||
- [COOK-2505] - backport omnibus builder improvements
|
||||
|
||||
v1.3.4
|
||||
------
|
||||
## v1.3.4
|
||||
|
||||
- [COOK-2272] - Complete `platform_family` conversion in build-essential
|
||||
|
||||
v1.3.2
|
||||
------
|
||||
## v1.3.2
|
||||
|
||||
- [COOK-2069] - build-essential will install osx-gcc-installer when XCode is present
|
||||
|
||||
v1.3.0
|
||||
------
|
||||
## v1.3.0
|
||||
|
||||
- [COOK-1895] - support smartos
|
||||
|
||||
v1.2.0
|
||||
------
|
||||
## v1.2.0
|
||||
|
||||
- Add test-kitchen support (source repo only)
|
||||
- [COOK-1677] - build-essential cookbook support for OpenSuse and SLES
|
||||
- [COOK-1718] - build-essential cookbook metadata should include scientific
|
||||
- [COOK-1768] - The apt-get update in build-essentials needs to be renamed
|
||||
|
||||
v1.1.2
|
||||
------
|
||||
## v1.1.2
|
||||
|
||||
- [COOK-1620] - support OS X 10.8
|
||||
|
||||
v1.1.0
|
||||
------
|
||||
## v1.1.0
|
||||
|
||||
- [COOK-1098] - support amazon linux
|
||||
- [COOK-1149] - support Mac OS X
|
||||
- [COOK-1296] - allow for compile-time installation of packages through an attribute (see README)
|
||||
|
||||
v1.0.2
|
||||
------
|
||||
## v1.0.2
|
||||
|
||||
- [COOK-1098] - Add Amazon Linux platform support
|
||||
- [COOK-1149] - Add OS X platform support
|
||||
|
||||
2
cookbooks/build-essential/CONTRIBUTING.md
Normal file
2
cookbooks/build-essential/CONTRIBUTING.md
Normal file
@@ -0,0 +1,2 @@
|
||||
Please refer to
|
||||
https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD
|
||||
18
cookbooks/build-essential/MAINTAINERS.md
Normal file
18
cookbooks/build-essential/MAINTAINERS.md
Normal file
@@ -0,0 +1,18 @@
|
||||
<!-- This is a generated file. Please do not edit directly -->
|
||||
|
||||
# Maintainers
|
||||
This file lists how this cookbook project is maintained. When making changes to the system, this
|
||||
file tells you who needs to review your patch - you need a simple majority of maintainers
|
||||
for the relevant subsystems to provide a :+1: on your pull request. Additionally, you need
|
||||
to not receive a veto from a Lieutenant or the Project Lead.
|
||||
|
||||
Check out [How Cookbooks are Maintained](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD)
|
||||
for details on the process and how to become a maintainer or the project lead.
|
||||
|
||||
# Project Maintainer
|
||||
* [Jennifer Davis](https://github.com/sigje)
|
||||
|
||||
# Maintainers
|
||||
* [Jennifer Davis](https://github.com/sigje)
|
||||
* [Tim Smith](https://github.com/tas50)
|
||||
* [Thom May](https://github.com/thommay)
|
||||
@@ -1,98 +1,93 @@
|
||||
Description
|
||||
===========
|
||||
[][cookbook]
|
||||
[][travis]
|
||||
# build-essential Cookbook
|
||||
[][cookbook] [][travis]
|
||||
|
||||
[cookbook]: https://community.chef.io/cookbooks/build-essential
|
||||
[travis]: http://travis-ci.org/chef-cookbooks/build-essential
|
||||
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.
|
||||
|
||||
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.
|
||||
## Requirements
|
||||
### Platforms
|
||||
- Debian/Ubuntu
|
||||
- RHEL/CentOS/Scientific/Amazon/Oracle
|
||||
- openSUSE
|
||||
- SmartOS
|
||||
- Fedora
|
||||
- Mac OS X
|
||||
- FreeBSD
|
||||
|
||||
### Chef
|
||||
- Chef 11+
|
||||
|
||||
### Cookbooks
|
||||
- Suggests pkgutil for Solaris based platforms
|
||||
|
||||
Requirements
|
||||
------------
|
||||
Chef 11+ and Ohai 6.14+ are required. For the latest list of supported
|
||||
platforms, please see the `metadata.rb`.
|
||||
|
||||
**Note for Debian platform family:** On Debian platform-family systems, it is recommended that `apt-get update` be run, to ensure that the package cache is updated. It's not in the scope of this cookbook to do that, as it can [create a duplicate resource](https://tickets.chef.io/browse/CHEF-3694). We recommend using the [apt](https://supermarket.chef.io/cookbooks/apt) cookbook to do this.
|
||||
|
||||
**Note for OmniOS**: Currently, OmniOS's Ruby package is built with
|
||||
GCC 4.6.3, and the path is hardcoded, as the gcc binaries are not
|
||||
installed in the default $PATH. This means that in order to install
|
||||
RubyGems into the "system" Ruby, one must install `developer/gcc46`.
|
||||
[An issue](https://github.com/omniti-labs/omnios-build/issues/19) is
|
||||
open upstream w/ OmniOS to rebuild the Ruby package with GCC 4.7.2.
|
||||
**Note for OmniOS**: Currently, OmniOS's Ruby package is built with GCC 4.6.3, and the path is hardcoded, as the gcc binaries are not installed in the default $PATH. This means that in order to install RubyGems into the "system" Ruby, one must install `developer/gcc46`. [An issue](https://github.com/omniti-labs/omnios-build/issues/19) is open upstream w/ OmniOS to rebuild the Ruby package with GCC 4.7.2.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
| Attribute | Default | Description |
|
||||
|----------------|:-------:|-----------------------------------|
|
||||
| `compile_time` | `false` | Execute resources at compile time |
|
||||
## Attributes
|
||||
|
||||
Attribute | Default | Description
|
||||
----------------------------------------- | :--------------------------: | ---------------------------------
|
||||
`node['build-essential']['compile_time']` | `false` | Execute resources at compile time
|
||||
`node['build-essential']['msys']['path']` | `#{ENV['SYSTEMDRIVE']\\msys` | Destination for msys (Windows only)
|
||||
|
||||
Usage
|
||||
-----
|
||||
## Usage
|
||||
Include the build-essential recipe in your run list:
|
||||
|
||||
```sh
|
||||
knife node run_list add NODE "recipe[build-essential::default]"
|
||||
```
|
||||
|
||||
or add the build-essential recipe as a dependency and include it from inside
|
||||
another cookbook:
|
||||
or add the build-essential recipe as a dependency and include it from inside another cookbook:
|
||||
|
||||
```ruby
|
||||
include_recipe 'build-essential::default'
|
||||
```
|
||||
|
||||
### Gems with C extensions
|
||||
For RubyGems that include native C extensions you wish to use with Chef, you
|
||||
should do the following.
|
||||
For RubyGems that include native C extensions you wish to use with Chef, you should do the following.
|
||||
- Set the `compile_time` attribute to true in your wrapper cookbook or role:
|
||||
|
||||
1. Set the `compile_time` attribute to true in your wrapper cookbook or role:
|
||||
```ruby
|
||||
# Wrapper attribute
|
||||
default['build-essential']['compile_time'] = true
|
||||
```
|
||||
|
||||
```ruby
|
||||
# Wrapper attribute
|
||||
default['build-essential']['compile_time'] = true
|
||||
```
|
||||
```ruby
|
||||
# Role
|
||||
default_attributes(
|
||||
'build-essential' => {
|
||||
'compile_time' => true
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
```ruby
|
||||
# Role
|
||||
default_attributes(
|
||||
'build-essential' => {
|
||||
'compile_time' => true
|
||||
}
|
||||
)
|
||||
```
|
||||
- Ensure that the C libraries, which include files and other assorted "dev"
|
||||
|
||||
1. Ensure that the C libraries, which include files and other assorted "dev"
|
||||
type packages, are installed in the compile phase after the build-essential
|
||||
recipe is executed. For example:
|
||||
type packages, are installed in the compile phase after the build-essential
|
||||
|
||||
```ruby
|
||||
include_recipe 'build-essential::default'
|
||||
recipe is executed. For example:
|
||||
|
||||
package('mypackage-devel') { action :nothing }.run_action(:install)
|
||||
```
|
||||
```ruby
|
||||
include_recipe 'build-essential::default'
|
||||
|
||||
1. Use the `chef_gem` resource in your recipe to install the gem with the native
|
||||
extension:
|
||||
package('mypackage-devel') { action :nothing }.run_action(:install)
|
||||
```
|
||||
|
||||
```ruby
|
||||
chef_gem 'gem-with-native-extension'
|
||||
```
|
||||
- Use the `chef_gem` resource in your recipe to install the gem with the native
|
||||
|
||||
extension:
|
||||
|
||||
License & Authors
|
||||
-----------------
|
||||
- Author: Seth Vargo (<sethvargo@gmail.com>)
|
||||
- Author: Joshua Timberman (<joshua@chef.io>)
|
||||
- Author: Seth Chisamore (<schisamo@chef.io>)
|
||||
```ruby
|
||||
chef_gem 'gem-with-native-extension'
|
||||
```
|
||||
|
||||
```text
|
||||
Copyright 2009-2015, Chef Software, Inc. (<legal@chef.io>)
|
||||
## License & Authors
|
||||
**Author:** Cookbook Engineering Team ([cookbooks@chef.io](mailto:cookbooks@chef.io))
|
||||
|
||||
**Copyright:** 2009-2015, 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.
|
||||
You may obtain a copy of the License at
|
||||
@@ -106,3 +101,5 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
```
|
||||
|
||||
[cookbook]: https://supermarket.chef.io/cookbooks/build-essential
|
||||
[travis]: http://travis-ci.org/chef-cookbooks/build-essential
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Cookbook Name:: build-essential
|
||||
# Attributes:: default
|
||||
#
|
||||
# Copyright 2008-2012, Chef Software, Inc.
|
||||
# Copyright 2008-2016, 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.
|
||||
@@ -18,3 +18,4 @@
|
||||
#
|
||||
|
||||
default['build-essential']['compile_time'] = false
|
||||
default['build-essential']['msys']['path'] = "#{ENV['SYSTEMDRIVE']}\\msys"
|
||||
|
||||
15
cookbooks/build-essential/libraries/_msys_helper.rb
Normal file
15
cookbooks/build-essential/libraries/_msys_helper.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
module BuildEssential
|
||||
module MsysHelper
|
||||
#
|
||||
# This function returns a struct representing an
|
||||
# msys package. It has two fields: url and checksum
|
||||
#
|
||||
# @return [OpenStruct]
|
||||
#
|
||||
def msys_p(url, checksum)
|
||||
OpenStruct.new(url: url, checksum: checksum)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Chef::Recipe.send(:include, BuildEssential::MsysHelper)
|
||||
@@ -2,7 +2,7 @@
|
||||
# Cookbook Name:: build-essential
|
||||
# Library:: timing
|
||||
#
|
||||
# Copyright 2014, Chef Software, Inc.
|
||||
# Copyright 2014-2016, 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.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Cookbook Name:: build-essential
|
||||
# Library:: xcode_command_line_tools
|
||||
#
|
||||
# Copyright 2014, Chef Software, Inc.
|
||||
# Copyright 2014-2016, 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.
|
||||
@@ -29,10 +29,12 @@ class Chef
|
||||
def initialize(name, run_context = nil)
|
||||
super
|
||||
|
||||
@provider = case node['platform_version'].to_f
|
||||
when 10.7, 10.8
|
||||
# => Break down SemVer
|
||||
major, minor, _patch = node['platform_version'].split('.').map { |v| String(v) }
|
||||
@provider = case [major, minor].join('.')
|
||||
when '10.7', '10.8'
|
||||
Provider::XcodeCommandLineToolsFromDmg
|
||||
when 10.9, 10.10
|
||||
when '10.9', '10.10', '10.11'
|
||||
Provider::XcodeCommandLineToolsFromSoftwareUpdate
|
||||
else
|
||||
Chef::Log.warn <<-EOH
|
||||
@@ -112,7 +114,7 @@ class Chef
|
||||
when 10.8
|
||||
'http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_mountain_lion_march_2014.dmg'
|
||||
else
|
||||
fail "Unknown DMG download URL for OSX #{node['platform_version']}"
|
||||
raise "Unknown DMG download URL for OSX #{node['platform_version']}"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"name":"build-essential","version":"2.2.4","description":"Installs C compiler / build tools","long_description":"","maintainer":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache 2.0","platforms":{"amazon":">= 0.0.0","centos":">= 0.0.0","debian":">= 0.0.0","fedora":">= 0.0.0","freebsd":">= 0.0.0","mac_os_x":">= 10.7.0","mac_os_x_server":">= 10.7.0","oracle":">= 0.0.0","redhat":">= 0.0.0","scientific":">= 0.0.0","smartos":">= 0.0.0","suse":">= 0.0.0","ubuntu":">= 0.0.0"},"dependencies":{},"recommendations":{},"suggestions":{"pkgutil":">= 0.0.0"},"conflicting":{},"providing":{},"replacing":{},"attributes":{"build-essential/compile_time":{"display_name":"Build Essential Compile Time Execution","description":"Execute resources at compile time.","default":"false","recipes":["build-essential::default"]}},"groupings":{},"recipes":{"build-essential":"Installs packages required for compiling C software from source."},"source_url":"https://github.com/chef-cookbooks/build-essential","issues_url":"https://github.com/chef-cookbooks/build-essential/issues"}
|
||||
{"name":"build-essential","version":"2.4.0","description":"Installs C compiler / build tools","long_description":"# build-essential Cookbook\n[][cookbook] [][travis]\n\nInstalls packages required for compiling C software from source. Use this cookbook if you wish to compile C programs, or install RubyGems with native extensions.\n\n## Requirements\n### Platforms\n- Debian/Ubuntu\n- RHEL/CentOS/Scientific/Amazon/Oracle\n- openSUSE\n- SmartOS\n- Fedora\n- Mac OS X\n- FreeBSD\n\n### Chef\n- Chef 11+\n\n### Cookbooks\n- Suggests pkgutil for Solaris based platforms\n\n\n**Note for Debian platform family:** On Debian platform-family systems, it is recommended that `apt-get update` be run, to ensure that the package cache is updated. It's not in the scope of this cookbook to do that, as it can [create a duplicate resource](https://tickets.chef.io/browse/CHEF-3694). We recommend using the [apt](https://supermarket.chef.io/cookbooks/apt) cookbook to do this.\n\n**Note for OmniOS**: Currently, OmniOS's Ruby package is built with GCC 4.6.3, and the path is hardcoded, as the gcc binaries are not installed in the default $PATH. This means that in order to install RubyGems into the \"system\" Ruby, one must install `developer/gcc46`. [An issue](https://github.com/omniti-labs/omnios-build/issues/19) is open upstream w/ OmniOS to rebuild the Ruby package with GCC 4.7.2.\n\n## Attributes\n\nAttribute | Default | Description\n----------------------------------------- | :--------------------------: | ---------------------------------\n`node['build-essential']['compile_time']` | `false` | Execute resources at compile time\n`node['build-essential']['msys']['path']` | `#{ENV['SYSTEMDRIVE']\\\\msys` | Destination for msys (Windows only)\n\n## Usage\nInclude the build-essential recipe in your run list:\n\n```sh\nknife node run_list add NODE \"recipe[build-essential::default]\"\n```\n\nor add the build-essential recipe as a dependency and include it from inside another cookbook:\n\n```ruby\ninclude_recipe 'build-essential::default'\n```\n\n### Gems with C extensions\nFor RubyGems that include native C extensions you wish to use with Chef, you should do the following.\n- Set the `compile_time` attribute to true in your wrapper cookbook or role:\n\n ```ruby\n # Wrapper attribute\n default['build-essential']['compile_time'] = true\n ```\n\n ```ruby\n # Role\n default_attributes(\n 'build-essential' => {\n 'compile_time' => true\n }\n )\n ```\n\n- Ensure that the C libraries, which include files and other assorted \"dev\"\n\n type packages, are installed in the compile phase after the build-essential\n\n recipe is executed. For example:\n\n ```ruby\n include_recipe 'build-essential::default'\n\n package('mypackage-devel') { action :nothing }.run_action(:install)\n ```\n\n- Use the `chef_gem` resource in your recipe to install the gem with the native\n\n extension:\n\n ```ruby\n chef_gem 'gem-with-native-extension'\n ```\n\n## License & Authors\n**Author:** Cookbook Engineering Team ([cookbooks@chef.io](mailto:cookbooks@chef.io))\n\n**Copyright:** 2009-2015, Chef Software, Inc.\n\n```\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\n[cookbook]: https://supermarket.chef.io/cookbooks/build-essential\n[travis]: http://travis-ci.org/chef-cookbooks/build-essential\n","maintainer":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache 2.0","platforms":{"amazon":">= 0.0.0","centos":">= 0.0.0","debian":">= 0.0.0","fedora":">= 0.0.0","freebsd":">= 0.0.0","mac_os_x":">= 10.7.0","mac_os_x_server":">= 10.7.0","oracle":">= 0.0.0","redhat":">= 0.0.0","scientific":">= 0.0.0","smartos":">= 0.0.0","suse":">= 0.0.0","ubuntu":">= 0.0.0","windows":">= 0.0.0"},"dependencies":{"7-zip":">= 0.0.0"},"recommendations":{},"suggestions":{"pkgutil":">= 0.0.0"},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{"build-essential":"Installs packages required for compiling C software from source."}}
|
||||
102
cookbooks/build-essential/providers/msys_archive.rb
Normal file
102
cookbooks/build-essential/providers/msys_archive.rb
Normal file
@@ -0,0 +1,102 @@
|
||||
#
|
||||
# Cookbook Name:: build-essential
|
||||
# Provider:: msys_archive
|
||||
#
|
||||
# Copyright 2016, 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.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
use_inline_resources
|
||||
|
||||
action :unpack do
|
||||
directory msys_dir do
|
||||
action :create
|
||||
end
|
||||
|
||||
directory "dir-#{mingw_dir}" do
|
||||
action :create
|
||||
path mingw_dir
|
||||
only_if do
|
||||
new_resource.mingw
|
||||
end
|
||||
end
|
||||
|
||||
directory cache_dir do
|
||||
action :create
|
||||
end
|
||||
|
||||
# Unpacking involves downloading the tar.whatever.
|
||||
# Then we unpack the tar.whatever with 7z, which
|
||||
# leaves us with a tar, which can finally be
|
||||
# untarred with 7z.
|
||||
|
||||
remote_file cache_path do
|
||||
source new_resource.source
|
||||
checksum new_resource.checksum
|
||||
notifies :run, "execute[#{archive_name}]", :immediately
|
||||
end
|
||||
|
||||
execute archive_name do
|
||||
command extract_cmd(cache_path, cache_dir)
|
||||
action :nothing
|
||||
notifies :run, "execute[#{tar_name}]", :immediately
|
||||
end
|
||||
|
||||
execute tar_name do
|
||||
command extract_cmd(tar_path, unpack_root_dir)
|
||||
action :nothing
|
||||
end
|
||||
end
|
||||
|
||||
# msys packages will be extracted into the root dir
|
||||
# mingw packages will get extracted into the root/mingw dir
|
||||
def unpack_root_dir
|
||||
if new_resource.mingw
|
||||
mingw_dir
|
||||
else
|
||||
msys_dir
|
||||
end
|
||||
end
|
||||
|
||||
def msys_dir
|
||||
new_resource.root_dir
|
||||
end
|
||||
|
||||
def mingw_dir
|
||||
::File.join(new_resource.root_dir, 'mingw')
|
||||
end
|
||||
|
||||
def archive_name
|
||||
::File.basename(new_resource.source)
|
||||
end
|
||||
|
||||
def cache_dir
|
||||
::File.join(unpack_root_dir, '.cache')
|
||||
end
|
||||
|
||||
def cache_path
|
||||
::File.join(cache_dir, archive_name)
|
||||
end
|
||||
|
||||
def tar_name
|
||||
::File.basename(archive_name, ::File.extname(archive_name))
|
||||
end
|
||||
|
||||
def tar_path
|
||||
::File.join(cache_dir, tar_name)
|
||||
end
|
||||
|
||||
def extract_cmd(source_file, dest_dir)
|
||||
"7z x #{source_file} -o#{dest_dir} -r -y"
|
||||
end
|
||||
@@ -2,7 +2,7 @@
|
||||
# Cookbook Name:: build-essential
|
||||
# Recipe:: debian
|
||||
#
|
||||
# Copyright 2008-2013, Chef Software, Inc.
|
||||
# Copyright 2008-2016, 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.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Cookbook Name:: build-essential
|
||||
# Recipe:: fedora
|
||||
#
|
||||
# Copyright 2008-2015, Chef Software, Inc.
|
||||
# Copyright 2008-2016, 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.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Cookbook Name:: build-essential
|
||||
# Recipe:: freebsd
|
||||
#
|
||||
# Copyright 2014, Chef Software, Inc.
|
||||
# Copyright 2014-2016, 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.
|
||||
@@ -21,4 +21,5 @@ potentially_at_compile_time do
|
||||
package 'devel/gmake'
|
||||
package 'devel/autoconf'
|
||||
package 'devel/m4'
|
||||
package 'devel/gettext'
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Cookbook Name:: build-essential
|
||||
# Recipe:: mac_os_x
|
||||
#
|
||||
# Copyright 2008-2013, Chef Software, Inc.
|
||||
# Copyright 2008-2016, 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.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Cookbook Name:: build-essential
|
||||
# Recipe:: omnios
|
||||
#
|
||||
# Copyright 2013, Chef Software, Inc.
|
||||
# Copyright 2013-2016, 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.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Cookbook Name:: build-essential
|
||||
# Recipe:: rhel
|
||||
#
|
||||
# Copyright 2008-2013, Chef Software, Inc.
|
||||
# Copyright 2008-2016, 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.
|
||||
@@ -27,6 +27,7 @@ potentially_at_compile_time do
|
||||
package 'make'
|
||||
package 'm4'
|
||||
package 'patch'
|
||||
package 'gettext-devel'
|
||||
|
||||
# Ensure GCC 4 is available on older pre-6 EL
|
||||
if node['platform_version'].to_i < 6
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Cookbook Name:: build-essential
|
||||
# Recipe:: smartos
|
||||
#
|
||||
# Copyright 2008-2013, Chef Software, Inc.
|
||||
# Copyright 2008-2016, 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.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Cookbook Name:: build-essential
|
||||
# Recipe:: solaris2
|
||||
#
|
||||
# Copyright 2013, Chef Software, Inc.
|
||||
# Copyright 2013-2016, 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.
|
||||
@@ -44,5 +44,5 @@ when 5.11
|
||||
package 'ucb'
|
||||
end
|
||||
else
|
||||
fail "Sorry, we don't support Solaris version #{node['platform_version']} at this juncture."
|
||||
raise "Sorry, we don't support Solaris version #{node['platform_version']} at this juncture."
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Cookbook Name:: build-essential
|
||||
# Recipe:: suse
|
||||
#
|
||||
# Copyright 2008-2013, Chef Software, Inc.
|
||||
# Copyright 2008-2016, 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.
|
||||
|
||||
112
cookbooks/build-essential/recipes/_windows.rb
Normal file
112
cookbooks/build-essential/recipes/_windows.rb
Normal file
@@ -0,0 +1,112 @@
|
||||
#
|
||||
# Cookbook Name:: build-essential
|
||||
# Recipe:: _mingw
|
||||
#
|
||||
# Copyright 2016, 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.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
require 'ostruct'
|
||||
|
||||
include_recipe '7-zip::default'
|
||||
|
||||
[
|
||||
msys_p('http://downloads.sourceforge.net/mingw/msysCORE-1.0.17-1-msys-1.0.17-bin.tar.lzma',
|
||||
'2d707ae394f5797a0718a1ffd886d4be1a83ed1f68a4ee4a5b19efd3208b037f'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/msysCORE-1.0.17-1-msys-1.0.17-ext.tar.lzma',
|
||||
'2c68f68cb2caa27aa014461133cf578433e62c823cdac3350be62b9c3e6460a0'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/coreutils-5.97-3-msys-1.0.13-bin.tar.lzma',
|
||||
'f8c7990416ea16a74ac336dcfe0f596bc46b8724b2d58cf8a3509414220b2366'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/coreutils-5.97-3-msys-1.0.13-ext.tar.lzma',
|
||||
'3f525aa6c94ff79ffd656ddf0a56d3244f982ea4a0d274674d9875afc1e04579'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/libiconv-1.14-1-msys-1.0.17-dll-2.tar.lzma',
|
||||
'196921e8c232259c8e6a6852b9ee8d9ab2d29a91419f0c8dc27ba6f034231683'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/libintl-0.18.1.1-1-msys-1.0.17-dll-8.tar.lzma',
|
||||
'29db8c969661c511fbe2a341ab25c993c5f9c555842a75d6ddbcfa70dec16910'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/libtermcap-0.20050421_1-2-msys-1.0.13-dll-0.tar.lzma',
|
||||
'62b58fe0880f0972fcc84a819265989b02439c1c5185870227bd25f870f7adb6'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/make-3.81-3-msys-1.0.13-bin.tar.lzma',
|
||||
'847f0cbbf07135801c8e67bf692d29b1821e816ad828753c997fa869a9b89988'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/perl-5.8.8-1-msys-1.0.17-bin.tar.lzma',
|
||||
'987b939ce00172dd034105d2a908cee5704f67027de98f4dcc69a1006a327a99'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/zlib-1.2.3-2-msys-1.0.13-dll.tar.lzma',
|
||||
'4178940828b928b2d5a33042cc83fbb992b4bfb9ffeaef6dc3e555f2a6a8c0d1'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/libgdbm-1.8.3-3-msys-1.0.13-dll-3.tar.lzma',
|
||||
'7412f874487652e70022ab8601655ee359ed537b017b7dba360b69237c9093c6'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/libcrypt-1.1_1-3-msys-1.0.13-dll-0.tar.lzma',
|
||||
'31f157b6993509849407672503b8b89e09e9e37e8833b6678b9cbbcbf597f918'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/bash-3.1.23-1-msys-1.0.18-bin.tar.xz',
|
||||
'38da5419969ab883058a96322bb0f51434dd4e9f71de09cd4f75b96750944533'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/mksh-40.0.0c-1-msys-1.0.17-bin.tar.lzma',
|
||||
'8311342acf0b9f0264fd0d8384a826537973d798ca5904349fea1e0c9d909e54'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/termcap-0.20050421_1-2-msys-1.0.13-bin.tar.lzma',
|
||||
'906e756332b5fd6c10eeb4b6362f5957dd8cafa5679f89d9adbae59dff7f2ff2'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/libregex-1.20090805-2-msys-1.0.13-dll-1.tar.lzma',
|
||||
'85dd8c1e27a90675c5f867be57ba7ae2bb55dde8cd2d19f284c896be134bd3d1'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/crypt-1.1_1-3-msys-1.0.13-bin.tar.lzma',
|
||||
'58369b42c38144d3aa5a337ebf1e182a66e88db30ccc42796f2074f251ee1fed'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/m4-1.4.14-1-msys-1.0.13-bin.tar.lzma',
|
||||
'41058bc9a691ad01fdd979f1a4ac4ee071bd5ce93f660db5c0b3cfad4487e33e'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/bison-2.4.2-1-msys-1.0.13-bin.tar.lzma',
|
||||
'349f3e312bf71f8a2ac68a7bd2f86b03dacc565b0fd27eef5d604e8be402390e'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/flex-2.5.35-2-msys-1.0.13-bin.tar.lzma',
|
||||
'9715511a2eafb7e2402029059d4b9db96bd40d8b72908db2571c009745c47a63'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/findutils-4.4.2-2-msys-1.0.13-bin.tar.lzma',
|
||||
'779e819b7942dc070c45f4cba633e6a9ae4bfe8b506a3541f4ce86ad0595726d'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/sed-4.2.1-2-msys-1.0.13-bin.tar.lzma',
|
||||
'f73059204cecb691e7840108b7c0cbbfcebf50c0e5c6e3a2326e0eedce5d1b94'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/gawk-3.1.7-2-msys-1.0.13-bin.tar.lzma',
|
||||
'eb15478ea76e75b666ad7fc7049de21b9f487e0e1ea0e96d40953a477e91c3dd'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/grep-2.5.4-2-msys-1.0.13-bin.tar.lzma',
|
||||
'4842a1754df98db994622e8ffab3bea7fbce77e05778cd5d3831e76ac90440ba'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/less-436-2-msys-1.0.13-bin.tar.lzma',
|
||||
'1bbd114846026f9ca4fcc4e18ba20f060384f623f1ef22b326df8c55419c0b84'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/diffutils-2.8.7.20071206cvs-3-msys-1.0.13-bin.tar.lzma',
|
||||
'522889b044492dd2337c4752ba6262995a11f352ca5fb8a8660349413ea9b864'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/texinfo-4.13a-2-msys-1.0.13-bin.tar.lzma',
|
||||
'241eb8e376bf69588d0e02aede35771503c5dcb15c440f97e15e30da79fea864'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/libmagic-5.04-1-msys-1.0.13-dll-1.tar.lzma',
|
||||
'65117008598675823b3fb25296d0d6c332ce56b72950e0f90f9063ac098afac3'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/file-5.04-1-msys-1.0.13-bin.tar.lzma',
|
||||
'e9ceffa49629524c84d07da77c1a5f37837f68a09e56cad30bea1df0a21e5fc2'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/mintty-1.0.3-1-msys-1.0.17-bin.tar.lzma',
|
||||
'0b3e7b57c81646eccaff3ca0310abe8367ace69992640be87199ecf5d9443085'),
|
||||
msys_p('http://downloads.sourceforge.net/mingw/patch-2.6.1-1-msys-1.0.13-bin.tar.lzma',
|
||||
'c8b7771304fb5e9fc33d8fca9045402f2e1bca055bf0b28127f3c3e85a254f67')
|
||||
].each do |package|
|
||||
potentially_at_compile_time do
|
||||
build_essential_msys_archive package.url do
|
||||
checksum package.checksum
|
||||
root_dir node['build-essential']['msys']['path']
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
[
|
||||
msys_p('http://iweb.dl.sourceforge.net/project/tdm-gcc/TDM-GCC%205%20series/5.1.0-tdm64-1/gcc-5.1.0-tdm64-1-core.tar.lzma',
|
||||
'29393aac890847089ad1e93f81a28f6744b1609c00b25afca818f3903e42e4bd'),
|
||||
msys_p('http://iweb.dl.sourceforge.net/project/tdm-gcc/MinGW-w64%20runtime/GCC%205%20series/mingw64runtime-v4-git20150618-gcc5-tdm64-1.tar.lzma',
|
||||
'29186e0bb36824b10026d78bdcf238d631d8fc1d90718d2ebbd9ec239b6f94dd'),
|
||||
msys_p('http://sourceforge.net/projects/tdm-gcc/files/GNU%20binutils/binutils-2.25-tdm64-1.tar.lzma',
|
||||
'4722bb7b4d46cef714234109e25e5d1cfd29f4e53365b6d615c8a00735f60e40'),
|
||||
msys_p('http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%205%20series/5.1.0-tdm64-1/gcc-5.1.0-tdm64-1-c++.tar.lzma',
|
||||
'17fd497318d1ac187a113e8665330d746ad9607a0406ab2374db0d8e6f4094d1')
|
||||
].each do |package|
|
||||
potentially_at_compile_time do
|
||||
build_essential_msys_archive package.url do
|
||||
root_dir node['build-essential']['msys']['path']
|
||||
checksum package.checksum
|
||||
mingw true
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2,7 +2,7 @@
|
||||
# Cookbook Name:: build-essential
|
||||
# Recipe:: default
|
||||
#
|
||||
# Copyright 2008-2009, Chef Software, Inc.
|
||||
# Copyright 2008-2016, 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.
|
||||
|
||||
106
cookbooks/build-essential/resources/build_essential.rb
Normal file
106
cookbooks/build-essential/resources/build_essential.rb
Normal file
@@ -0,0 +1,106 @@
|
||||
#
|
||||
# Cookbook:: build-essential
|
||||
# resource:: build_essential
|
||||
#
|
||||
# Copyright:: 2008-2016, 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.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
provides :build_essential
|
||||
resource_name :build_essential
|
||||
|
||||
property :compile_time, [true, false], default: false
|
||||
|
||||
action :install do
|
||||
case node['platform_family']
|
||||
when 'debian'
|
||||
package %w( autoconf binutils-doc bison build-essential flex gettext ncurses-dev )
|
||||
when 'fedora', 'rhel'
|
||||
package %w( autoconf bison flex gcc gcc-c++ gettext kernel-devel make m4 ncurses-devel patch )
|
||||
|
||||
# Ensure GCC 4 is available on older pre-6 EL
|
||||
package %w( gcc44 gcc44-c++ ) if node['platform_version'].to_i < 6
|
||||
when 'freebsd'
|
||||
package 'devel/gmake'
|
||||
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'
|
||||
package 'developer/gcc48'
|
||||
package 'developer/object-file'
|
||||
package 'developer/linker'
|
||||
package 'developer/library/lint'
|
||||
package 'developer/build/gnu-make'
|
||||
package 'system/header'
|
||||
package 'system/library/math/header-math'
|
||||
|
||||
# Per OmniOS documentation, the gcc bin dir isn't in the default
|
||||
# $PATH, so add it to the running process environment
|
||||
# http://omnios.omniti.com/wiki.php/DevEnv
|
||||
ENV['PATH'] = "#{ENV['PATH']}:/opt/gcc-4.7.2/bin"
|
||||
when 'solaris2'
|
||||
if node['platform_version'].to_f == 5.10
|
||||
Chef::Log.warn('build-essential does not support Solaris 10. You will need to install SUNWbison, SUNWgcc, SUNWggrp, SUNWgmake, and SUNWgtar from the Solaris DVD')
|
||||
elsif node['platform_version'].to_f == 5.11
|
||||
package 'autoconf'
|
||||
package 'automake'
|
||||
package 'bison'
|
||||
package 'gnu-coreutils'
|
||||
package 'flex'
|
||||
package 'gcc' do
|
||||
# lock because we don't use 5 yet
|
||||
version '4.8.2'
|
||||
end
|
||||
package 'gcc-3'
|
||||
package 'gnu-grep'
|
||||
package 'gnu-make'
|
||||
package 'gnu-patch'
|
||||
package 'gnu-tar'
|
||||
package 'make'
|
||||
package 'pkg-config'
|
||||
package 'ucb'
|
||||
end
|
||||
when 'smartos'
|
||||
package 'autoconf'
|
||||
package 'binutils'
|
||||
package 'build-essential'
|
||||
package 'gcc47'
|
||||
package 'gmake'
|
||||
package 'pkg-config'
|
||||
when 'suse'
|
||||
package %w( autoconf bison flex gcc gcc-c++ kernel-default-devel make m4 )
|
||||
package %w( gcc48 gcc48-c++ ) if node['platform_version'].to_i < 12
|
||||
when 'windows'
|
||||
include_recipe 'build-essential::_windows'
|
||||
else
|
||||
Chef::Log.warn <<-EOH
|
||||
A build-essential recipe does not exist for '#{node['platform_family']}'. This
|
||||
means the build-essential cookbook does not have support for the
|
||||
#{node['platform_family']} family. If you are not compiling gems with native
|
||||
extensions or building packages from source, this will likely not affect you.
|
||||
EOH
|
||||
end
|
||||
end
|
||||
|
||||
# this resource forces itself to run at compile_time
|
||||
def after_created
|
||||
return unless compile_time
|
||||
Array(action).each do |action|
|
||||
run_action(action)
|
||||
end
|
||||
end
|
||||
7
cookbooks/build-essential/resources/msys_archive.rb
Normal file
7
cookbooks/build-essential/resources/msys_archive.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
actions :unpack
|
||||
default_action :unpack
|
||||
|
||||
attribute :source, kind_of: String, name_attribute: true
|
||||
attribute :root_dir, kind_of: String, required: true
|
||||
attribute :mingw, kind_of: [TrueClass, FalseClass], default: false
|
||||
attribute :checksum, kind_of: String
|
||||
@@ -0,0 +1,61 @@
|
||||
#
|
||||
# Cookbook:: build-essential
|
||||
# Resource:: xcode_command_line_tools
|
||||
#
|
||||
# Copyright:: 2014-2016, 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.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
resource_name :xcode_command_line_tools
|
||||
|
||||
action :install do
|
||||
if installed?
|
||||
Chef::Log.debug("#{new_resource} already installed - skipping")
|
||||
else
|
||||
converge_by("Install #{new_resource}") do
|
||||
# This script was graciously borrowed and modified from Tim Sutton's
|
||||
# osx-vm-templates at https://github.com/timsutton/osx-vm-templates/blob/b001475df54a9808d3d56d06e71b8fa3001fff42/scripts/xcode-cli-tools.sh
|
||||
execute 'install XCode Command Line tools' do
|
||||
command <<-EOH.gsub(/^ {14}/, '')
|
||||
# create the placeholder file that's checked by CLI updates' .dist code
|
||||
# in Apple's SUS catalog
|
||||
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
|
||||
# find the CLI Tools update
|
||||
PROD=$(softwareupdate -l | grep "\*.*Command Line" | head -n 1 | awk -F"*" '{print $2}' | sed -e 's/^ *//' | tr -d '\n')
|
||||
# install it
|
||||
softwareupdate -i "$PROD" --verbose
|
||||
# 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
|
||||
end
|
||||
|
||||
action_class do
|
||||
#
|
||||
# Determine if the XCode Command Line Tools are installed
|
||||
#
|
||||
# @return [true, false]
|
||||
#
|
||||
def installed?
|
||||
cmd = Mixlib::ShellOut.new('pkgutil --pkgs=com.apple.pkg.CLTools_Executables')
|
||||
cmd.run_command
|
||||
cmd.error!
|
||||
true
|
||||
rescue Mixlib::ShellOut::ShellCommandFailed
|
||||
false
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user