Initial Chef repository

This commit is contained in:
Greg Karékinian
2015-07-21 19:45:23 +02:00
parent 7e5401fc71
commit ee4079fa85
1151 changed files with 185163 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# Force ChefDK's environment
source_env ~/.envrc_chefdk

16
cookbooks/build-essential/.gitignore vendored Normal file
View File

@@ -0,0 +1,16 @@
.vagrant
Berksfile.lock
Gemfile.lock
*~
*#
.#*
\#*#
.*.sw[a-z]
*.un~
.bundle
.cache
.kitchen
.rspec
bin
.kitchen.local.yml
.coverage

View File

@@ -0,0 +1,165 @@
#<% require 'kitchen-sync' %>
---
driver_config:
digitalocean_client_id: <%= ENV['DIGITAL_OCEAN_CLIENT_ID'] %>
google_client_email: <%= ENV['GOOGLE_CLIENT_EMAIL'] %>
google_key_location: <%= ENV['GOOGLE_KEY_LOCATION'] %>
google_project: <%= ENV['GOOGLE_PROJECT'] %>
joyent_username: <%= ENV['SDC_CLI_ACCOUNT'] %>
joyent_keyfile: <%= ENV['SDC_CLI_IDENTITY'] %>
joyent_keyname: <%= ENV['SDC_CLI_KEY_ID'] %>
joyent_url: <%= ENV['SDC_CLI_URL'] %>
aws_access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
aws_secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
aws_ssh_key_id: <%= ENV['AWS_KEYPAIR_NAME'] %>
flavor_id: <%= ENV['EC2_FLAVOR_ID'] %>
availability_zone: <%= ENV['AWS_AVAILABILITY_ZONE'] %>
provisioner:
name: chef_zero
# require_chef_omnibus: 11.16.4
require_chef_omnibus: 12.0.3
platforms:
- name: centos-5.8
driver_plugin: digital_ocean
driver_config:
size: 2gb
image: centos-5-8-x64
region: <%= ENV['DIGITAL_OCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
- name: centos-6.5
driver_plugin: digital_ocean
driver_config:
size: 2gb
image: centos-6-5-x64
region: <%= ENV['DIGITAL_OCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
- name: centos-7.0
driver_plugin: digital_ocean
driver_config:
size: 2gb
image: centos-7-0-x64
region: <%= ENV['DIGITAL_OCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
- name: amazon-2014.09
driver_plugin: ec2
driver_config:
image_id: ami-9a6ed3f2
username: ec2-user
ssh_key: <%= ENV['EC2_SSH_KEY_PATH'] %>
# - name: redhat-6.5
# driver_plugin: ec2
# driver_config:
# image_id: ami-8d756fe4
# username: ec2-user
# ssh_key: <%= ENV['EC2_SSH_KEY_PATH'] %>
# run_list:
# - recipe[selinux::disabled]
- name: redhat-7.0
driver_plugin: ec2
driver_config:
image_id: ami-a8d369c0
username: ec2-user
ssh_key: <%= ENV['EC2_SSH_KEY_PATH'] %>
run_list:
- recipe[selinux::disabled]
- name: fedora-20
driver_plugin: digital_ocean
driver_config:
size: 2gb
image: fedora-20-x64
region: <%= ENV['DIGITAL_OCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
- name: suse-11.3
driver_plugin: ec2
driver_config:
image_id: ami-e8084981
username: root
ssh_key: <%= ENV['EC2_SSH_KEY_PATH'] %>
- name: debian-7.0
driver_plugin: gce
driver_config:
image_name: debian-7-wheezy-v20131120
zone: <%= ENV['GCE_ZONE'] %>
area: <%= ENV['GCE_AREA'] %>
network: <%= ENV['GCE_NETWORK'] %>
username: <%= ENV['GCE_USERNAME'] %>
public_key_path: <%= ENV['GCE_PUBLIC_KEY_PATH'] %>
ssh_key: <%= ENV['GCE_SSH_KEY_PATH'] %>
run_list:
- recipe[apt]
- name: ubuntu-10.04
driver_plugin: digital_ocean
driver_config:
size: 2gb
image: ubuntu-10-04-x64
region: <%= ENV['DIGITAL_OCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
run_list:
- recipe[apt]
- name: ubuntu-12.04
driver_plugin: digital_ocean
driver_config:
size: 2gb
image: ubuntu-12-04-x64
region: <%= ENV['DIGITAL_OCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
run_list:
- recipe[apt]
- name: ubuntu-14.04
driver_plugin: digital_ocean
driver_config:
size: 2gb
image: ubuntu-14-04-x64
region: <%= ENV['DIGITAL_OCEAN_REGION'] %>
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
ssh_key: <%= ENV['DIGITAL_OCEAN_SSH_KEY_PATH'] %>
run_list:
- recipe[apt]
# - name: omnios-151006
# driver_plugin: ec2
# driver_config:
# image_id: ami-35eb835c
# flavor_id: m3.large
# username: root
# ssh_key: <%= ENV['EC2_SSH_KEY_PATH'] %>
# run_list:
# - recipe[ips-omniti]
# - name: smartos-14.3.0
# driver_plugin: joyent
# driver_config:
# joyent_image_id: 62f148f8-6e84-11e4-82c5-efca60348b9f
# joyent_flavor_id: g3-standard-4-smartos
# username: root
# ssh_key: <%= ENV['SDC_CLI_IDENTITY'] %>
# busser:
# ruby_bindir: '/opt/local/bin/'
# provisioner:
# sudo: false
# chef_omnibus_url: https://raw.github.com/test-kitchen/kitchen-joyent/master/scripts/install-smartos.sh
suites:
- name: default
run_list:
- recipe[build-essential::default]
attributes: {}

View File

@@ -0,0 +1,24 @@
driver:
name: vagrant
platforms:
- name: centos-5.10
- name: centos-6.5
- name: fedora-19
- name: freebsd-9.2
run_list: freebsd::portsnap
- name: freebsd-10.0
run_list: freebsd::portsnap
- name: macosx-10.9
- name: debian-7.4
run_list: apt::default
- name: ubuntu-10.04
run_list: apt::default
- name: ubuntu-12.04
run_list: apt::default
- name: ubuntu-13.10
run_list: apt::default
suites:
- name: default
run_list: build-essential::default

View File

@@ -0,0 +1,30 @@
AllCops:
Exclude:
- bin/**/*
- script/**/*
- vendor/**/*
AbcSize:
Max: 50
AlignParameters:
Enabled: false
ClassAndModuleChildren:
Enabled: false
Documentation:
Enabled: false
DoubleNegation:
Enabled: false
Encoding:
Enabled: false
GuardClause:
Enabled: false
LineLength:
Max: 120
MethodLength:
Max: 20
PercentLiteralDelimiters:
Enabled: false
SignalException:
Enabled: false
SingleSpaceBeforeFirstArg:
Enabled: false

View File

@@ -0,0 +1,40 @@
# Use Travis's cointainer based infrastructure
sudo: false
addons:
apt:
sources:
- chef-stable-precise
packages:
- chefdk
# Don't `bundle install`
install: echo "skip bundle install"
branches:
only:
- master
# Ensure we make ChefDK's Ruby the default
before_script:
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
# We have to install chef-sugar for ChefSpec
- /opt/chefdk/embedded/bin/chef gem install chef-sugar
script:
- /opt/chefdk/embedded/bin/chef --version
- /opt/chefdk/embedded/bin/rubocop --version
- /opt/chefdk/embedded/bin/rubocop
- /opt/chefdk/embedded/bin/foodcritic --version
- /opt/chefdk/embedded/bin/foodcritic . --exclude spec
- /opt/chefdk/embedded/bin/rspec spec
notifications:
hipchat:
on_change: true
on_failure: true
on_success: false
on_pull_requests: false
rooms:
# Build Statuses
- secure: fk4NTplcjE097Oan2HgZc+Lxx8X9k2QDolwBKZMDNrreFImBgw6HJBwHUv6Hfay2xh7Y720iNFeTTN3Ep0/M4YgmBrwhry3jSMN8TX7SAOGPCC8zIB0ELGGAyQKxDjwwsA18KTbuDkV5yboiUzvY86G5bWT8vfWEd1ljTEnIazQ=
# Release Engineering
- secure: X35KY6kImjVyYiT9gOlRJd26MKh5KQFwxcQm3fF9Y+pnB1v7uB3w6+jzoxhvPN5O2US3xGQsaJOSAB1uhZh+FZOKfZ/ewyXVUcTXrUTC9Mjofd3n33xD68qoI22mntEQilugvC+OPhq9uWyX0OlRhnnT+J56Vq7feSI4ez9e9Og=

View File

@@ -0,0 +1,8 @@
source 'https://supermarket.chef.io'
metadata
group :integration do
cookbook 'apt'
cookbook 'freebsd'
end

View File

@@ -0,0 +1,125 @@
build-essential Cookbook CHANGELOG
==================================
This file is used to list changes made in each version of the build-essential cookbook.
v2.2.3 (2015-04-15)
-------------------
* Dont install omnibus-build-essential on Solaris 10 - We decided its 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 10s 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)
-------------------
- 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)
-------------------
- 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)
- Created a DSL method for wrapping compile_time vs runtime execution
- Install additional developement tools on some platforms
- Add nicer log and warning messages with helpful information
**Potentially Breaking Changes**
- Dropped support for OSX 10.6
- OSX no longer downloads OSX GCC and uses XCode CLI tools instead
- `build_essential` -> `build-essential` in node attributes
- `compiletime` -> `compile_time` in node attributes
- Cookbook version 2.x no longer supports Chef 10.x
v1.4.4 (2014-02-27)
-------------------
- [COOK-4245] Wrong package name used for developer tools on OS X 10.9
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
------
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
------
- [COOK-2272] - Complete `platform_family` conversion in build-essential
v1.3.2
------
- [COOK-2069] - build-essential will install osx-gcc-installer when XCode is present
v1.3.0
------
- [COOK-1895] - support smartos
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
------
- [COOK-1620] - support OS X 10.8
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
------
- [COOK-1098] - Add Amazon Linux platform support
- [COOK-1149] - Add OS X platform support

View File

@@ -0,0 +1,29 @@
If you would like to contribute, please open a ticket in JIRA:
* http://tickets.chef.io
Create the ticket in the COOK project and use the cookbook name as the
component.
For all code contributions, we ask that contributors sign a
contributor license agreement (CLA). Instructions may be found here:
* http://wiki.chef.io/display/chef/How+to+Contribute
When contributing changes to individual cookbooks, please do not
modify the version number in the metadata.rb. Also please do not
update the CHANGELOG.md for a new version. Not all changes to a
cookbook may be merged and released in the same versions. Chef Software will
handle the version updates during the release process. You are welcome
to correct typos or otherwise make updates to documentation in the
README.
If a contribution adds new platforms or platform versions, indicate
such in the body of the commit message(s), and update the relevant
COOK ticket. When writing commit messages, it is helpful for others if
you indicate the COOK ticket. For example:
git commit -m '[COOK-1041] Updated pool resource to correctly delete.'
In the ticket itself, it is also helpful if you include log output of
a successful Chef run, but this is not absolutely required.

View File

@@ -0,0 +1,38 @@
source 'https://rubygems.org'
group :lint do
gem 'foodcritic', '~> 3.0'
gem 'rubocop', '= 0.26.1'
end
group :unit do
gem 'berkshelf', '~> 3.1'
gem 'chefspec', '~> 4.0'
end
group :kitchen_common do
gem 'test-kitchen', '~> 1.2'
end
group :kitchen_vagrant do
gem 'kitchen-vagrant', '~> 0.15'
end
group :kitchen_cloud do
gem 'kitchen-digitalocean', '~> 0.8'
gem 'kitchen-ec2', '~> 0.8'
gem 'kitchen-joyent', '~> 0.1'
gem 'kitchen-gce', '~> 0.2'
end
group :development do
gem 'ruby_gntp'
gem 'growl'
gem 'rb-fsevent'
gem 'guard', '~> 2.4'
gem 'guard-kitchen'
gem 'guard-foodcritic'
gem 'guard-rspec'
gem 'guard-rubocop'
gem 'rake'
end

View File

@@ -0,0 +1,35 @@
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
# guard 'kitchen' do
# watch(%r{test/.+})
# watch(%r{^recipes/(.+)\.rb$})
# watch(%r{^attributes/(.+)\.rb$})
# watch(%r{^files/(.+)})
# watch(%r{^templates/(.+)})
# watch(%r{^providers/(.+)\.rb})
# watch(%r{^resources/(.+)\.rb})
# end
guard 'foodcritic', cookbook_paths: '.', all_on_start: false do
watch(/attributes\/.+\.rb$/)
watch(/providers\/.+\.rb$/)
watch(/recipes\/.+\.rb$/)
watch(/resources\/.+\.rb$/)
watch('metadata.rb')
end
guard 'rubocop', all_on_start: false do
watch(/attributes\/.+\.rb$/)
watch(/providers\/.+\.rb$/)
watch(/recipes\/.+\.rb$/)
watch(/resources\/.+\.rb$/)
watch('metadata.rb')
end
guard :rspec, cmd: 'bundle exec rspec', all_on_start: false, notification: false do
watch(/^libraries\/(.+)\.rb$/)
watch(/^spec\/(.+)_spec\.rb$/)
watch(/^(recipes)\/(.+)\.rb$/) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { 'spec' }
end

View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.

View File

@@ -0,0 +1,108 @@
Description
===========
[![Cookbook Version](http://img.shields.io/cookbook/v/build-essential.svg)][cookbook]
[![Build Status](http://img.shields.io/travis/chef-cookbooks/build-essential.svg)][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.
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.
Attributes
----------
| Attribute | Default | Description |
|----------------|:-------:|-----------------------------------|
| `compile_time` | `false` | Execute resources at compile time |
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:
```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.
1. Set the `compile_time` attribute to true in your wrapper cookbook or role:
```ruby
# Wrapper attribute
default['build-essential']['compile_time'] = true
```
```ruby
# Role
default_attributes(
'build-essential' => {
'compile_time' => true
}
)
```
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:
```ruby
include_recipe 'build-essential::default'
package('mypackage-devel') { action :nothing }.run_action(:install)
```
1. Use the `chef_gem` resource in your recipe to install the gem with the native
extension:
```ruby
chef_gem 'gem-with-native-extension'
```
License & Authors
-----------------
- Author: Seth Vargo (<sethvargo@gmail.com>)
- Author: Joshua Timberman (<joshua@chef.io>)
- Author: Seth Chisamore (<schisamo@chef.io>)
```text
Copyright 2009-2014, Chef Software, Inc. (<legal@chef.io>)
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.
```

View File

@@ -0,0 +1,65 @@
require 'bundler/setup'
# Style tests. Rubocop and Foodcritic
namespace :style do
require 'rubocop/rake_task'
desc 'Run Ruby style checks'
RuboCop::RakeTask.new(:ruby)
require 'foodcritic'
desc 'Run Chef style checks'
FoodCritic::Rake::LintTask.new(:chef) do |t|
t.options = {
fail_tags: ['any'],
tags: ['~FC005']
}
end
end
desc 'Run all style checks'
task style: ['style:chef', 'style:ruby']
# Rspec and ChefSpec
require 'rspec/core/rake_task'
desc 'Run ChefSpec examples'
RSpec::Core::RakeTask.new(:spec)
# Integration tests. Kitchen.ci
require 'kitchen'
namespace :integration do
desc 'Run Test Kitchen with Vagrant'
task :vagrant do
Kitchen.logger = Kitchen.default_file_logger
Kitchen::Config.new.instances.each do |instance|
instance.test(:always)
end
end
desc 'Run Test Kitchen with cloud plugins'
task :cloud do
run_kitchen = true
if ENV['TRAVIS'] == 'true' && ENV['TRAVIS_PULL_REQUEST'] != 'false'
run_kitchen = false
end
if run_kitchen
Kitchen.logger = Kitchen.default_file_logger
@loader = Kitchen::Loader::YAML.new(project_config: './.kitchen.cloud.yml')
config = Kitchen::Config.new(loader: @loader)
config.instances.each do |instance|
instance.test(:always)
end
end
end
end
namespace :travis do
desc 'Run tests on Travis'
task ci: %w(style spec)
end
# The default rake task should just run it all
task default: %w(travis:ci integration)
# The default rake task should just run it all
task default: ['style', 'spec', 'integration:vagrant']

View File

@@ -0,0 +1,20 @@
#
# Cookbook Name:: build-essential
# Attributes:: default
#
# Copyright 2008-2012, 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.
#
default['build-essential']['compile_time'] = false

View File

@@ -0,0 +1,5 @@
if defined?(ChefSpec)
def install_xcode_command_line_tools(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:xcode_command_line_tools, :install, resource_name)
end
end

View File

@@ -0,0 +1,124 @@
#
# Cookbook Name:: build-essential
# Library:: timing
#
# Copyright 2014, 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.
#
#
# This module is used to clean up the recipe DSL and "potentially" execute
# resources at compile time (depending on the value of an attribute).
#
# This library is only for use within the build-essential cookbook. Resources
# inside the potentially_at_compile_time block will not fire notifications in
# some situations. This is fixable, but since none of the resources in this
# cookbook actually use notifications, it is not worth the added technical debt.
#
# TL;DR Don't use this DSL method outside of this cookbook.
#
module BuildEssential
module Timing
#
# Potentially evaluate the given block at compile time, depending on the
# value of the +node['build-essential']['compile_time']+ attribute.
#
# @example
# potentially_at_compile_time do
# package 'apache2'
# end
#
# @param [Proc] block
# the thing to eval
#
def potentially_at_compile_time(&block)
if compile_time?
CompileTime.new(self).evaluate(&block)
else
instance_eval(&block)
end
end
private
#
# Checks if the DSL should be evaluated at compile time.
#
# @return [true, false]
#
def compile_time?
check_for_old_attributes!
!!node['build-essential']['compile_time']
end
#
# Checks for the presence of the "old" attributes.
#
# @todo Remove in 2.0.0
#
# @return [void]
#
def check_for_old_attributes!
unless node['build_essential'].nil?
Chef::Log.warn <<-EOH
node['build_essential'] has been changed to node['build-essential'] to match the
cookbook name and community standards. I have gracefully converted the attribute
for you, but this warning and conversion will be removed in the next major
release of the build-essential cookbook.
EOH
node.default['build-essential'] = node['build_essential']
end
unless node['build-essential']['compiletime'].nil?
Chef::Log.warn <<-EOH
node['build-essential']['compiletime'] has been deprecated. Please use
node['build-essential']['compile_time'] instead. I have gracefully converted the
attribute for you, but this warning and converstion will be removed in the next
major release of the build-essential cookbook.
EOH
node.default['build-essential']['compile_time'] = node['build-essential']['compiletime']
end
end
#
# A class graciously borrowed from Chef Sugar for evaluating a resource at
# compile time in a block.
#
class CompileTime
def initialize(recipe)
@recipe = recipe
end
def evaluate(&block)
instance_eval(&block)
end
def method_missing(m, *args, &block)
resource = @recipe.send(m, *args, &block)
if resource.is_a?(Chef::Resource)
actions = Array(resource.action)
resource.action(:nothing)
actions.each do |action|
resource.run_action(action)
end
end
resource
end
end
end
end
# Include the timing module into the main recipe DSL
Chef::Recipe.send(:include, BuildEssential::Timing)

View File

@@ -0,0 +1,211 @@
#
# Cookbook Name:: build-essential
# Library:: xcode_command_line_tools
#
# Copyright 2014, 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.
#
class Chef
class Resource::XcodeCommandLineTools < Resource::LWRPBase
def self.resource_name
:xcode_command_line_tools
end
actions :install
default_action :install
def initialize(name, run_context = nil)
super
@provider = case node['platform_version'].to_f
when 10.7, 10.8
Provider::XcodeCommandLineToolsFromDmg
when 10.9, 10.10
Provider::XcodeCommandLineToolsFromSoftwareUpdate
else
Chef::Log.warn <<-EOH
OSX #{node['platform_version']} is not an officially supported platform for the
build-essential cookbook. I am going to try and install the command line tools
from Software Update, but there is a high probability that it will fail...
If you have tested and verified OSX #{node['platform_version']} and you are sick
of seeing this warning in your Chef Client runs, please submit a Pull Request to
https://github.com/chef-cookbooks/build-essential and add this version of OSX
to provider list.
EOH
Provider::XcodeCommandLineToolsFromSoftwareUpdate
end
end
end
end
#
# This is a legacy provider for installing OSX from DMGs. It only supports OSX
# versions 10.7 and 10.8 and will (hopefully) be deprecated in the future. It
# downloads a remote .dmg file, mounts it, installs it, and unmounts it
# automatically. In later versions of OSX, the operating system handles this for
# the end user.
#
class Chef
class Provider::XcodeCommandLineToolsFromDmg < Provider::LWRPBase
action(:install) do
if installed?
Chef::Log.debug("#{new_resource} already installed - skipping")
else
converge_by("Install #{new_resource}") do
download
attach
install
detach
end
end
end
private
#
# Determine if the XCode Command Line Tools are installed
#
# @return [true, false]
#
def installed?
cmd = Mixlib::ShellOut.new('pkgutil --pkgs=com.apple.pkg.DeveloperToolsCLI')
cmd.run_command
cmd.error!
true
rescue Mixlib::ShellOut::ShellCommandFailed
false
end
#
# The path where the dmg should be cached on disk.
#
# @return [String]
#
def dmg_cache_path
::File.join(Chef::Config[:file_cache_path], 'osx-command-line-tools.dmg')
end
#
# The path where the dmg should be downloaded from. This is intentionally
# not a configurable object by the end user. If you do not like where we
# are downloading XCode from - too bad.
#
# @return [String]
#
def dmg_remote_source
case node['platform_version'].to_f
when 10.7
'http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg'
when 10.8
'http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_mountain_lion_march_2014.dmg'
else
raise "Unknown DMG download URL for OSX #{node['platform_version']}"
end
end
#
# The path where the volume should be mounted.
#
# @return [String]
#
def mount_path
::File.join(Chef::Config[:file_cache_path], 'osx-command-line-tools')
end
#
# Action: download the remote dmg.
#
# @return [void]
#
def download
remote_file = Resource::RemoteFile.new(dmg_cache_path, run_context)
remote_file.source(dmg_remote_source)
remote_file.backup(false)
remote_file.run_action(:create)
end
#
# Action: attach the dmg (basically, double-click on it)
#
# @return [void]
#
def attach
execute %|hdiutil attach "#{dmg_cache_path}" -mountpoint "#{mount_path}"|
end
#
# Action: install the package inside the dmg
#
# @return [void]
#
def install
execute %|installer -package "$(find '#{mount_path}' -name *.mpkg)" -target "/"|
end
#
# Action: detach the dmg (basically, drag it to eject on the dock)
#
# @return [void]
#
def detach
execute %|hdiutil detach "#{mount_path}"|
end
end
end
class Chef
class Provider::XcodeCommandLineToolsFromSoftwareUpdate < Provider::LWRPBase
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
# rubocop:disable Metrics/LineLength
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" -v
EOH
# rubocop:enable Metrics/LineLength
end
end
end
end
private
#
# 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
end

View File

@@ -0,0 +1,10 @@
matrix:
- KITCHEN_INSTANCE='default-centos-58
- KITCHEN_INSTANCE='default-centos-64
- KITCHEN_INSTANCE='default-amazon-201309
- KITCHEN_INSTANCE='default-fedora-19
- KITCHEN_INSTANCE='default-debian-70
- KITCHEN_INSTANCE='default-ubuntu-1004
- KITCHEN_INSTANCE='default-ubuntu-1204
- KITCHEN_INSTANCE='default-ubuntu-1310
- KITCHEN_INSTANCE='default-smartos-1330

View File

@@ -0,0 +1,64 @@
{
"name": "build-essential",
"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"
],
"choice": [
],
"calculated": false,
"type": "string",
"required": "optional"
}
},
"groupings": {
},
"recipes": {
"build-essential": "Installs packages required for compiling C software from source."
},
"version": "2.2.3"
}

View File

@@ -0,0 +1,29 @@
name 'build-essential'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache 2.0'
description 'Installs C compiler / build tools'
version '2.2.3'
recipe 'build-essential', 'Installs packages required for compiling C software from source.'
supports 'amazon'
supports 'centos'
supports 'debian'
supports 'fedora'
supports 'freebsd'
supports 'mac_os_x', '>= 10.7.0'
supports 'mac_os_x_server', '>= 10.7.0'
supports 'oracle'
supports 'redhat'
supports 'scientific'
supports 'smartos'
supports 'suse'
supports 'ubuntu'
suggests 'pkgutil' # Solaris 2
attribute 'build-essential/compile_time',
display_name: 'Build Essential Compile Time Execution',
description: 'Execute resources at compile time.',
default: 'false',
recipes: ['build-essential::default']

View File

@@ -0,0 +1,28 @@
#
# Cookbook Name:: build-essential
# Recipe:: debian
#
# Copyright 2008-2013, 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.
#
potentially_at_compile_time do
package 'autoconf'
package 'binutils-doc'
package 'bison'
package 'build-essential'
package 'flex'
package 'gettext'
package 'ncurses-dev'
end

View File

@@ -0,0 +1,31 @@
#
# Cookbook Name:: build-essential
# Recipe:: fedora
#
# Copyright 2008-2013, 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.
#
potentially_at_compile_time do
package 'autoconf'
package 'bison'
package 'flex'
package 'gcc'
package 'gcc-c++'
package 'gettext'
package 'kernel-devel'
package 'make'
package 'm4'
package 'ncurses-devel'
end

View File

@@ -0,0 +1,24 @@
#
# Cookbook Name:: build-essential
# Recipe:: freebsd
#
# Copyright 2014, 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.
#
potentially_at_compile_time do
package 'devel/gmake'
package 'devel/autoconf'
package 'devel/m4'
end

View File

@@ -0,0 +1,22 @@
#
# Cookbook Name:: build-essential
# Recipe:: mac_os_x
#
# Copyright 2008-2013, 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.
#
potentially_at_compile_time do
xcode_command_line_tools 'install'
end

View File

@@ -0,0 +1,33 @@
#
# Cookbook Name:: build-essential
# Recipe:: omnios
#
# Copyright 2013, 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.
#
potentially_at_compile_time do
package 'developer/gcc47'
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'
end
# 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"

View File

@@ -0,0 +1,36 @@
#
# Cookbook Name:: build-essential
# Recipe:: rhel
#
# Copyright 2008-2013, 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.
#
potentially_at_compile_time do
package 'autoconf'
package 'bison'
package 'flex'
package 'gcc'
package 'gcc-c++'
package 'kernel-devel'
package 'make'
package 'm4'
package 'patch'
# Ensure GCC 4 is available on older pre-6 EL
if node['platform_version'].to_i < 6
package 'gcc44'
package 'gcc44-c++'
end
end

View File

@@ -0,0 +1,27 @@
#
# Cookbook Name:: build-essential
# Recipe:: smartos
#
# Copyright 2008-2013, 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.
#
potentially_at_compile_time do
package 'autoconf'
package 'binutils'
package 'build-essential'
package 'gcc47'
package 'gmake'
package 'pkg-config'
end

View File

@@ -0,0 +1,48 @@
#
# Cookbook Name:: build-essential
# Recipe:: solaris2
#
# Copyright 2013, 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.
#
case node['platform_version'].to_f
when 5.10
# You should install the following packages from the Solaris 10 DVD:
#
# SUNWbison
# SUNWgcc
# SUNWggrp
# SUNWgmake
# SUNWgtar
#
when 5.11
potentially_at_compile_time do
package 'autoconf'
package 'automake'
package 'bison'
package 'gnu-coreutils'
package 'flex'
package 'gcc'
package 'gcc-3'
package 'gnu-grep'
package 'gnu-make'
package 'gnu-patch'
package 'gnu-tar'
package 'pkg-config'
package 'ucb'
end
else
raise "Sorry, we don't support Solaris version #{node['platform_version']} at this juncture."
end

View File

@@ -0,0 +1,29 @@
#
# Cookbook Name:: build-essential
# Recipe:: suse
#
# Copyright 2008-2013, 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.
#
potentially_at_compile_time do
package 'autoconf'
package 'bison'
package 'flex'
package 'gcc'
package 'gcc-c++'
package 'kernel-default-devel'
package 'make'
package 'm4'
end

View File

@@ -0,0 +1,29 @@
#
# Cookbook Name:: build-essential
# Recipe:: default
#
# Copyright 2008-2009, 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.
#
begin
include_recipe "build-essential::_#{node['platform_family']}"
rescue Chef::Exceptions::RecipeNotFound
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