Skip to content

Commit

Permalink
Merge branch 'COOK-455'
Browse files Browse the repository at this point in the history
  • Loading branch information
schisamo committed Jun 7, 2011
2 parents 4698c6a + e51e3bc commit 6dfcf8a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 14 deletions.
33 changes: 33 additions & 0 deletions mysql/libraries/helpers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Author:: Seth Chisamore (<schisamo@opscode.com>)
# Copyright:: Copyright (c) 2011 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# 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.
#

module Opscode
module Mysql
module Helpers

def debian_before_squeeze?
platform?("debian") && (node.platform_version.to_f < 6.0)
end

def ubuntu_before_lucid?
platform?("ubuntu") && (node.platform_version.to_f < 10.0)
end

end
end
end
26 changes: 12 additions & 14 deletions mysql/recipes/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,22 @@
# limitations under the License.
#

package "mysql-devel" do
package_name value_for_platform(
[ "centos", "redhat", "suse", "fedora"] => { "default" => "mysql-devel" },
["debian", "ubuntu"] => { 5.0 => 'libmysqlclient15-dev', "default" => 'libmysqlclient-dev'},
"default" => 'libmysqlclient-dev'
)
action :install
end
::Chef::Resource::Package.send(:include, Opscode::Mysql::Helpers)

package "mysql-client" do
package_name value_for_platform(
[ "centos", "redhat", "suse", "fedora"] => { "default" => "mysql" },
"default" => "mysql-client"
)
package "mysql-devel" do
package_name begin
if platform?(%w{ centos redhat suse fedora })
"mysql-devel"
elsif debian_before_squeeze? || ubuntu_before_lucid?
"libmysqlclient15-dev"
else
"libmysqlclient-dev"
end
end
action :install
end

if platform?(%w{debian ubuntu redhat centos fedora suse})
if platform?(%w{ debian ubuntu redhat centos fedora suse })

package "mysql-ruby" do
package_name value_for_platform(
Expand Down

0 comments on commit 6dfcf8a

Please sign in to comment.