BtSync 0.5.1 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.gitignore +1 -0
- data/.travis.yml +1 -0
- data/Vagrantfile +31 -0
- data/cookbooks/apt/.gitignore +14 -0
- data/cookbooks/apt/.kitchen.yml +38 -0
- data/cookbooks/apt/Berksfile +8 -0
- data/cookbooks/apt/CHANGELOG.md +97 -0
- data/cookbooks/apt/CONTRIBUTING +29 -0
- data/cookbooks/apt/LICENSE +201 -0
- data/cookbooks/apt/README.md +243 -0
- data/cookbooks/apt/TESTING.md +25 -0
- data/cookbooks/apt/attributes/default.rb +4 -0
- data/cookbooks/apt/files/default/apt-proxy-v2.conf +50 -0
- data/cookbooks/apt/metadata.json +1 -0
- data/cookbooks/apt/metadata.rb +30 -0
- data/cookbooks/apt/providers/preference.rb +61 -0
- data/cookbooks/apt/providers/repository.rb +132 -0
- data/cookbooks/apt/recipes/cacher-client.rb +59 -0
- data/cookbooks/apt/recipes/cacher-ng.rb +40 -0
- data/cookbooks/apt/recipes/default.rb +68 -0
- data/cookbooks/apt/resources/preference.rb +30 -0
- data/cookbooks/apt/resources/repository.rb +40 -0
- data/cookbooks/apt/templates/debian-6.0/acng.conf.erb +174 -0
- data/cookbooks/apt/templates/default/01proxy.erb +2 -0
- data/cookbooks/apt/templates/default/acng.conf.erb +276 -0
- data/cookbooks/apt/templates/ubuntu-10.04/acng.conf.erb +270 -0
- data/cookbooks/btsync/README.md +2 -0
- data/cookbooks/btsync/metadata.rb +14 -0
- data/cookbooks/btsync/recipes/default.rb +13 -0
- data/cookbooks/build-essential/.gitignore +4 -0
- data/cookbooks/build-essential/.kitchen.yml +42 -0
- data/cookbooks/build-essential/Berksfile +3 -0
- data/cookbooks/build-essential/CHANGELOG.md +42 -0
- data/cookbooks/build-essential/CONTRIBUTING +29 -0
- data/cookbooks/build-essential/LICENSE +201 -0
- data/cookbooks/build-essential/README.md +139 -0
- data/cookbooks/build-essential/TESTING.md +25 -0
- data/cookbooks/build-essential/attributes/default.rb +33 -0
- data/cookbooks/build-essential/metadata.json +44 -0
- data/cookbooks/build-essential/metadata.rb +16 -0
- data/cookbooks/build-essential/recipes/debian.rb +45 -0
- data/cookbooks/build-essential/recipes/default.rb +24 -0
- data/cookbooks/build-essential/recipes/fedora.rb +36 -0
- data/cookbooks/build-essential/recipes/mac_os_x.rb +40 -0
- data/cookbooks/build-essential/recipes/rhel.rb +43 -0
- data/cookbooks/build-essential/recipes/smartos.rb +36 -0
- data/cookbooks/build-essential/recipes/solaris2.rb +42 -0
- data/cookbooks/build-essential/recipes/suse.rb +36 -0
- data/lib/btsync.rb +13 -13
- data/lib/btsync/communicator.rb +14 -4
- data/lib/btsync/directory.rb +12 -12
- data/lib/btsync/version.rb +1 -1
- data/spec/BtSync/bt_sync_spec.rb +13 -9
- data/spec/BtSync/directory_spec.rb +13 -20
- data/spec/fixtures/cassettes/{get-known-hosts.yml → Remove-Default-Host.yml} +5 -5
- data/spec/fixtures/cassettes/Setup-BtSync-Directory.yml +289 -12
- data/spec/fixtures/cassettes/Setup-BtSync.yml +252 -0
- data/spec/fixtures/cassettes/Setup-Directory-Settings.yml +8 -38
- data/spec/fixtures/cassettes/add-folder-list.yml +32 -35
- data/spec/fixtures/cassettes/add-folder.yml +10 -94
- data/spec/fixtures/cassettes/add-known-host.yml +6 -6
- data/spec/fixtures/cassettes/change_download_limit.yml +15 -42
- data/spec/fixtures/cassettes/change_listening_port.yml +15 -42
- data/spec/fixtures/cassettes/change_name.yml +13 -40
- data/spec/fixtures/cassettes/change_upload_limit.yml +15 -42
- data/spec/fixtures/cassettes/get-folders.yml +54 -24
- data/spec/fixtures/cassettes/get-os-type.yml +3 -30
- data/spec/fixtures/cassettes/get-peers.yml +7 -8
- data/spec/fixtures/cassettes/get-preferences.yml +24 -24
- data/spec/fixtures/cassettes/get-settings.yml +6 -33
- data/spec/fixtures/cassettes/get-version.yml +3 -30
- data/spec/fixtures/cassettes/remove-folder-list.yml +18 -20
- data/spec/fixtures/cassettes/remove-folder.yml +35 -38
- data/spec/fixtures/cassettes/remove-known-host.yml +6 -6
- data/spec/fixtures/cassettes/reset_device_name.yml +13 -13
- data/spec/fixtures/cassettes/reset_download_limit.yml +15 -15
- data/spec/fixtures/cassettes/reset_listening_port.yml +15 -15
- data/spec/fixtures/cassettes/reset_upload_limit.yml +15 -15
- data/spec/fixtures/cassettes/set-preferences-delete.yml +11 -11
- data/spec/fixtures/cassettes/set-preferences-dht.yml +11 -11
- data/spec/fixtures/cassettes/set-preferences-hosts.yml +11 -11
- data/spec/fixtures/cassettes/set-preferences-lan.yml +11 -11
- data/spec/fixtures/cassettes/set-preferences-relay.yml +11 -11
- data/spec/fixtures/cassettes/set-preferences-tracker.yml +11 -11
- data/spec/fixtures/cassettes/view-folders.yml +5 -5
- metadata +52 -4
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Description
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
Installs packages required for compiling C software from source. Use
|
|
5
|
+
this cookbook if you wish to compile C programs, or install RubyGems
|
|
6
|
+
with native extensions.
|
|
7
|
+
|
|
8
|
+
Requirements
|
|
9
|
+
============
|
|
10
|
+
|
|
11
|
+
Chef version 0.10.10+ and Ohai 0.6.12+ are required.
|
|
12
|
+
|
|
13
|
+
## Platform
|
|
14
|
+
|
|
15
|
+
Supported platforms by platform family:
|
|
16
|
+
|
|
17
|
+
* debian (debian, ubuntu)
|
|
18
|
+
* fedora
|
|
19
|
+
* mac_os_x (10.6+)
|
|
20
|
+
* rhel (centos, redhat, amazon, scientific)
|
|
21
|
+
* smartos
|
|
22
|
+
* solaris2
|
|
23
|
+
|
|
24
|
+
## Cookbooks
|
|
25
|
+
|
|
26
|
+
This cookbook suggests the following external cookbooks:
|
|
27
|
+
|
|
28
|
+
* [pkgin](http://community.opscode.com/cookbooks/pkgin) (someara) - SmartOS only
|
|
29
|
+
* [pkgutil](http://community.opscode.com/cookbooks/pkgutil) (marthag) - Solaris 2 only
|
|
30
|
+
|
|
31
|
+
Attributes
|
|
32
|
+
==========
|
|
33
|
+
|
|
34
|
+
* `node['build_essential']['compiletime']` - Whether the resources in
|
|
35
|
+
the default recipe should be configured at the "Compile" phase of the
|
|
36
|
+
Chef run. Defaults to false, see __Usage__ for more information.
|
|
37
|
+
* `node['build_essential']['osx']['gcc_installer_url']` - The URL of
|
|
38
|
+
the OS X GCC package installer (.pkg).
|
|
39
|
+
* `node['build_essential']['osx']['gcc_installer_checksum']` - The
|
|
40
|
+
SHA256 checksum of the OS X GCC installer.
|
|
41
|
+
|
|
42
|
+
Recipes
|
|
43
|
+
=======
|
|
44
|
+
|
|
45
|
+
The main entrypoint for this cookbook is the `default` recipe. This
|
|
46
|
+
recipe includes a platform specific recipe based on the node's platform
|
|
47
|
+
family.
|
|
48
|
+
|
|
49
|
+
On Linux platforms (see __Platform__ above for a supported list of
|
|
50
|
+
families), packages required to build C source projects are installed.
|
|
51
|
+
This includes GCC, make, autconf and others. On Debian-family
|
|
52
|
+
distributions, the apt-cache may need to be updated, especially during
|
|
53
|
+
compile time installation. See __Usage__ for further information.
|
|
54
|
+
|
|
55
|
+
On Mac OS X, the GCC standalone installer by Kenneth Reitz is
|
|
56
|
+
installed. Note that this is *not* the Xcode CLI package, as that does
|
|
57
|
+
not include all programs and headers required to build some common
|
|
58
|
+
GNU-style C projects, such as those that are available from projects
|
|
59
|
+
such as MacPorts or Homebrew. Changing the attributes for the GCC
|
|
60
|
+
installer URL and checksum to the Xcode values may work, but this is
|
|
61
|
+
untested.
|
|
62
|
+
|
|
63
|
+
Usage
|
|
64
|
+
=====
|
|
65
|
+
|
|
66
|
+
Simply include the `build-essential` and the required tools will be
|
|
67
|
+
installed to the system, and later recipes will be able to compile
|
|
68
|
+
software from C source code.
|
|
69
|
+
|
|
70
|
+
For RubyGems that include native C extensions you wish to use with
|
|
71
|
+
Chef, you should do two things.
|
|
72
|
+
|
|
73
|
+
0. Ensure that the C libraries, include files and other assorted "dev"
|
|
74
|
+
type packages are installed. You should do this in the compile phase
|
|
75
|
+
after the build-essential recipe.
|
|
76
|
+
1. Use the `chef_gem` resource in your recipes. This requires Chef version 0.10.10+.
|
|
77
|
+
2. Set the `compiletime` attribute in roles where such recipes are
|
|
78
|
+
required. This will ensure that the build tools are available to
|
|
79
|
+
compile the RubyGems' extensions, as `chef_gem` happens during the
|
|
80
|
+
compile phase, too.
|
|
81
|
+
|
|
82
|
+
Example installation of a devel package at compile-time in a recipe:
|
|
83
|
+
|
|
84
|
+
package "mypackage-dev" do
|
|
85
|
+
action :nothing
|
|
86
|
+
end.run_action(:install)
|
|
87
|
+
|
|
88
|
+
Example use of `chef_gem`:
|
|
89
|
+
|
|
90
|
+
chef_gem "mygem"
|
|
91
|
+
|
|
92
|
+
Example role:
|
|
93
|
+
|
|
94
|
+
name "myapp"
|
|
95
|
+
run_list(
|
|
96
|
+
"recipe[build-essential]",
|
|
97
|
+
"recipe[myapp]"
|
|
98
|
+
)
|
|
99
|
+
default_attributes(
|
|
100
|
+
"build_essential" => {
|
|
101
|
+
"compiletime" => true
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
The compile time option (via the attribute) is to ensure that the
|
|
106
|
+
proper packages are available at the right time in the Chef run. It is
|
|
107
|
+
recommended that the build-essential recipe appear early in the run
|
|
108
|
+
list.
|
|
109
|
+
|
|
110
|
+
The Chef wiki has documentation on
|
|
111
|
+
[the anatomy of a chef run](http://wiki.opscode.com/display/chef/Anatomy+of+a+Chef+Run).
|
|
112
|
+
|
|
113
|
+
Limitations
|
|
114
|
+
===========
|
|
115
|
+
|
|
116
|
+
It is not in the scope of this cookbook to handle installing the
|
|
117
|
+
required headers for individual software projects in order to compile
|
|
118
|
+
them, or to compile RubyGems with native C extensions. You should
|
|
119
|
+
create a cookbook for handling that.
|
|
120
|
+
|
|
121
|
+
License and Author
|
|
122
|
+
==================
|
|
123
|
+
|
|
124
|
+
Author:: Joshua Timberman (<joshua@opscode.com>)
|
|
125
|
+
Author:: Seth Chisamore (<schisamo@opscode.com>)
|
|
126
|
+
|
|
127
|
+
Copyright 2009-2011, Opscode, Inc. (<legal@opscode.com>)
|
|
128
|
+
|
|
129
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
130
|
+
you may not use this file except in compliance with the License.
|
|
131
|
+
You may obtain a copy of the License at
|
|
132
|
+
|
|
133
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
134
|
+
|
|
135
|
+
Unless required by applicable law or agreed to in writing, software
|
|
136
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
137
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
138
|
+
See the License for the specific language governing permissions and
|
|
139
|
+
limitations under the License.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
This cookbook includes support for running tests via Test Kitchen (1.0). This has some requirements.
|
|
2
|
+
|
|
3
|
+
1. You must be using the Git repository, rather than the downloaded cookbook from the Chef Community Site.
|
|
4
|
+
2. You must have Vagrant 1.1 installed.
|
|
5
|
+
3. You must have a "sane" Ruby 1.9.3 environment.
|
|
6
|
+
|
|
7
|
+
Once the above requirements are met, install the additional requirements:
|
|
8
|
+
|
|
9
|
+
Install the berkshelf plugin for vagrant, and berkshelf to your local Ruby environment.
|
|
10
|
+
|
|
11
|
+
vagrant plugin install berkshelf-vagrant
|
|
12
|
+
gem install berkshelf
|
|
13
|
+
|
|
14
|
+
Install Test Kitchen 1.0 (unreleased yet, use the alpha / prerelease version).
|
|
15
|
+
|
|
16
|
+
gem install test-kitchen --pre
|
|
17
|
+
|
|
18
|
+
Install the Vagrant driver for Test Kitchen.
|
|
19
|
+
|
|
20
|
+
gem install kitchen-vagrant
|
|
21
|
+
|
|
22
|
+
Once the above are installed, you should be able to run Test Kitchen:
|
|
23
|
+
|
|
24
|
+
kitchen list
|
|
25
|
+
kitchen test
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: build-essential
|
|
3
|
+
# Attributes:: default
|
|
4
|
+
#
|
|
5
|
+
# Copyright 2008-2012, Opscode, Inc.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
|
|
20
|
+
default['build_essential']['compiletime'] = false
|
|
21
|
+
|
|
22
|
+
case node['platform_family']
|
|
23
|
+
when "mac_os_x"
|
|
24
|
+
case
|
|
25
|
+
when Chef::VersionConstraint.new("~> 10.7.0").include?(node['platform_version']),
|
|
26
|
+
Chef::VersionConstraint.new("~> 10.8.0").include?(node['platform_version'])
|
|
27
|
+
default['build_essential']['osx']['gcc_installer_url'] = "https://github.com/downloads/kennethreitz/osx-gcc-installer/GCC-10.7-v2.pkg"
|
|
28
|
+
default['build_essential']['osx']['gcc_installer_checksum'] = "df36aa87606feb99d0db9ac9a492819e"
|
|
29
|
+
when Chef::VersionConstraint.new("~> 10.6.0").include?(node['platform_version'])
|
|
30
|
+
default['build_essential']['osx']['gcc_installer_url'] = "https://github.com/downloads/kennethreitz/osx-gcc-installer/GCC-10.6.pkg"
|
|
31
|
+
default['build_essential']['osx']['gcc_installer_checksum'] = "d1db5bab6a3f6b9f3b5577a130baeefa"
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "build-essential",
|
|
3
|
+
"description": "Installs C compiler / build tools",
|
|
4
|
+
"long_description": "",
|
|
5
|
+
"maintainer": "Opscode, Inc.",
|
|
6
|
+
"maintainer_email": "cookbooks@opscode.com",
|
|
7
|
+
"license": "Apache 2.0",
|
|
8
|
+
"platforms": {
|
|
9
|
+
"fedora": ">= 0.0.0",
|
|
10
|
+
"redhat": ">= 0.0.0",
|
|
11
|
+
"centos": ">= 0.0.0",
|
|
12
|
+
"ubuntu": ">= 0.0.0",
|
|
13
|
+
"debian": ">= 0.0.0",
|
|
14
|
+
"amazon": ">= 0.0.0",
|
|
15
|
+
"suse": ">= 0.0.0",
|
|
16
|
+
"scientific": ">= 0.0.0",
|
|
17
|
+
"oracle": ">= 0.0.0",
|
|
18
|
+
"smartos": ">= 0.0.0",
|
|
19
|
+
"mac_os_x": ">= 10.6.0",
|
|
20
|
+
"mac_os_x_server": ">= 10.6.0"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
},
|
|
24
|
+
"recommendations": {
|
|
25
|
+
},
|
|
26
|
+
"suggestions": {
|
|
27
|
+
"pkgin": ">= 0.0.0",
|
|
28
|
+
"pkgutil": ">= 0.0.0"
|
|
29
|
+
},
|
|
30
|
+
"conflicting": {
|
|
31
|
+
},
|
|
32
|
+
"providing": {
|
|
33
|
+
},
|
|
34
|
+
"replacing": {
|
|
35
|
+
},
|
|
36
|
+
"attributes": {
|
|
37
|
+
},
|
|
38
|
+
"groupings": {
|
|
39
|
+
},
|
|
40
|
+
"recipes": {
|
|
41
|
+
"build-essential": "Installs packages required for compiling C software from source."
|
|
42
|
+
},
|
|
43
|
+
"version": "1.4.0"
|
|
44
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name "build-essential"
|
|
2
|
+
maintainer "Opscode, Inc."
|
|
3
|
+
maintainer_email "cookbooks@opscode.com"
|
|
4
|
+
license "Apache 2.0"
|
|
5
|
+
description "Installs C compiler / build tools"
|
|
6
|
+
version "1.4.0"
|
|
7
|
+
recipe "build-essential", "Installs packages required for compiling C software from source."
|
|
8
|
+
|
|
9
|
+
%w{ fedora redhat centos ubuntu debian amazon suse scientific oracle smartos}.each do |os|
|
|
10
|
+
supports os
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
supports "mac_os_x", ">= 10.6.0"
|
|
14
|
+
supports "mac_os_x_server", ">= 10.6.0"
|
|
15
|
+
suggests "pkgin" # SmartOS
|
|
16
|
+
suggests "pkgutil" # Solaris 2
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: build-essential
|
|
3
|
+
# Recipe:: debian
|
|
4
|
+
#
|
|
5
|
+
# Copyright 2008-2013, Opscode, Inc.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
|
|
20
|
+
# on apt-based platforms when first provisioning we need to force
|
|
21
|
+
# apt-get update at compiletime if we are going to try to install at compiletime
|
|
22
|
+
execute "apt-get-update-build-essentials" do
|
|
23
|
+
command "apt-get update"
|
|
24
|
+
action :nothing
|
|
25
|
+
# tip: to suppress this running every time, just use the apt cookbook
|
|
26
|
+
not_if do
|
|
27
|
+
::File.exists?('/var/lib/apt/periodic/update-success-stamp') &&
|
|
28
|
+
::File.mtime('/var/lib/apt/periodic/update-success-stamp') > Time.now - 86400*2
|
|
29
|
+
end
|
|
30
|
+
end.run_action(:run) if node['build_essential']['compiletime']
|
|
31
|
+
|
|
32
|
+
%w{
|
|
33
|
+
autoconf
|
|
34
|
+
binutils-doc
|
|
35
|
+
bison
|
|
36
|
+
build-essential
|
|
37
|
+
flex
|
|
38
|
+
}.each do |pkg|
|
|
39
|
+
|
|
40
|
+
r = package pkg do
|
|
41
|
+
action( node['build_essential']['compiletime'] ? :nothing : :install )
|
|
42
|
+
end
|
|
43
|
+
r.run_action(:install) if node['build_essential']['compiletime']
|
|
44
|
+
|
|
45
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: build-essential
|
|
3
|
+
# Recipe:: default
|
|
4
|
+
#
|
|
5
|
+
# Copyright 2008-2009, Opscode, Inc.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
|
|
20
|
+
begin
|
|
21
|
+
include_recipe "build-essential::#{node['platform_family']}"
|
|
22
|
+
rescue Chef::Exceptions::RecipeNotFound
|
|
23
|
+
Chef::Log.warn "A build-essential recipe does not exist for the platform_family: #{node['platform_family']}"
|
|
24
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: build-essential
|
|
3
|
+
# Recipe:: fedora
|
|
4
|
+
#
|
|
5
|
+
# Copyright 2008-2013, Opscode, Inc.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
|
|
20
|
+
%w{
|
|
21
|
+
autoconf
|
|
22
|
+
bison
|
|
23
|
+
flex
|
|
24
|
+
gcc
|
|
25
|
+
gcc-c++
|
|
26
|
+
kernel-devel
|
|
27
|
+
make
|
|
28
|
+
m4
|
|
29
|
+
}.each do |pkg|
|
|
30
|
+
|
|
31
|
+
r = package pkg do
|
|
32
|
+
action( node['build_essential']['compiletime'] ? :nothing : :install )
|
|
33
|
+
end
|
|
34
|
+
r.run_action(:install) if node['build_essential']['compiletime']
|
|
35
|
+
|
|
36
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: build-essential
|
|
3
|
+
# Recipe:: mac_os_x
|
|
4
|
+
#
|
|
5
|
+
# Copyright 2008-2013, Opscode, Inc.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
|
|
20
|
+
require 'chef/shell_out'
|
|
21
|
+
|
|
22
|
+
result = Chef::ShellOut.new("pkgutil --pkgs").run_command
|
|
23
|
+
osx_gcc_installer_installed = result.stdout.split("\n").include?("com.apple.pkg.gcc4.2Leo")
|
|
24
|
+
developer_tools_cli_installed = result.stdout.split("\n").include?("com.apple.pkg.DeveloperToolsCLI")
|
|
25
|
+
pkg_filename = ::File.basename(node['build_essential']['osx']['gcc_installer_url'])
|
|
26
|
+
pkg_path = "#{Chef::Config[:file_cache_path]}/#{pkg_filename}"
|
|
27
|
+
|
|
28
|
+
r = remote_file pkg_path do
|
|
29
|
+
source node['build_essential']['osx']['gcc_installer_url']
|
|
30
|
+
checksum node['build_essential']['osx']['gcc_installer_checksum']
|
|
31
|
+
action( node['build_essential']['compiletime'] ? :nothing : :create )
|
|
32
|
+
not_if { osx_gcc_installer_installed or developer_tools_cli_installed }
|
|
33
|
+
end
|
|
34
|
+
r.run_action(:create) if node['build_essential']['compiletime']
|
|
35
|
+
|
|
36
|
+
r = execute "sudo installer -pkg \"#{pkg_path}\" -target /" do
|
|
37
|
+
action( node['build_essential']['compiletime'] ? :nothing : :run )
|
|
38
|
+
not_if { osx_gcc_installer_installed or developer_tools_cli_installed }
|
|
39
|
+
end
|
|
40
|
+
r.run_action(:run) if node['build_essential']['compiletime']
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Cookbook Name:: build-essential
|
|
3
|
+
# Recipe:: rhel
|
|
4
|
+
#
|
|
5
|
+
# Copyright 2008-2013, Opscode, Inc.
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
#
|
|
19
|
+
|
|
20
|
+
pkgs = %w{
|
|
21
|
+
autoconf
|
|
22
|
+
bison
|
|
23
|
+
flex
|
|
24
|
+
gcc
|
|
25
|
+
gcc-c++
|
|
26
|
+
kernel-devel
|
|
27
|
+
make
|
|
28
|
+
m4
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
# ensure GCC 4 is available on older pre-6 EL
|
|
32
|
+
if node['platform_version'].to_i < 6
|
|
33
|
+
pkgs.unshift %w{ gcc44 gcc44-c++ }
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
pkgs.flatten.each do |pkg|
|
|
37
|
+
|
|
38
|
+
r = package pkg do
|
|
39
|
+
action( node['build_essential']['compiletime'] ? :nothing : :install )
|
|
40
|
+
end
|
|
41
|
+
r.run_action(:install) if node['build_essential']['compiletime']
|
|
42
|
+
|
|
43
|
+
end
|