Permalink
Browse files

thrift v0.99.0

* use source install not subversion install
* install python bindings (autodetected)
* use attributes for mirror url, version, checksum and config opts
  • Loading branch information...
1 parent 5eac6f8 commit 5ef7fc589c08557c1ccb8b5d36f09dd528f63d22 @jtimberman jtimberman committed May 22, 2011
Showing with 52 additions and 23 deletions.
  1. +12 −9 thrift/{README.rdoc → README.md}
  2. +23 −0 thrift/attributes/default.rb
  3. +4 −4 thrift/metadata.rb
  4. +13 −10 thrift/recipes/default.rb
@@ -1,14 +1,16 @@
-= DESCRIPTION:
+Description
+====
Installs Thrift from source.
-= REQUIREMENTS:
+Requirements
+====
-== Platform:
+## Platform
-Only tested on Ubuntu 9.04.
+Only tested on Ubuntu 10.04.
-== Cookbooks:
+## Cookbooks
Opscode cookbooks:
@@ -17,17 +19,18 @@ Opscode cookbooks:
* subversion
* boost
-= USAGE:
+Usage
+====
Include the Thrift recipe to install Thrift from source on your systems.
include_recipe "thrift"
-= LICENSE and AUTHOR:
-
+License and Author
+====
Author:: Joshua Timberman (<joshua@opscode.com>)
-Copyright:: 2009, Opscode, Inc.
+Copyright:: 2009-2011, Opscode, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -0,0 +1,23 @@
+#
+# Cookbook Name:: thrift
+# Attributes:: default
+#
+# Copyright 2011, Opscode, 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['thrift']['version'] = '0.6.0'
+default['thrift']['mirror'] = 'http://apache.mirrors.tds.net'
+default['thrift']['checksum'] = 'c1a282de4d24c772cdf62ab110cf24937fd3c42d807e9cfd49d77c1488c0b7c5'
+default['thrift']['configure_options'] = []
View
@@ -1,14 +1,14 @@
maintainer "Opscode, Inc."
maintainer_email "cookbooks@opscode.com"
license "Apache 2.0"
-description "Installs/Configures thrift"
-long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
-version "0.1.1"
+description "Installs thrift from source"
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
+version "0.99.0"
recipe "thrift", "Installs thrift from source"
supports "ubuntu"
-%w{ build-essential boost java subversion }.each do |cb|
+%w{ build-essential boost python }.each do |cb|
depends cb
end
View
@@ -16,25 +16,28 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+
+version = node['thrift']['version']
+
include_recipe "build-essential"
include_recipe "boost"
-include_recipe "java"
-include_recipe "subversion"
+include_recipe "python"
%w{ flex bison libtool autoconf pkg-config }.each do |pkg|
package pkg
end
+remote_file "#{Chef::Config[:file_cache_path]}/thrift-0.6.0.tar.gz" do
+ source "#{node['thrift']['mirror']}/thrift/#{version}/thrift-#{version}.tar.gz"
+ checksum node['thrift']['checksum']
+end
+
bash "install_thrift" do
- user "root"
- cwd "/tmp"
+ cwd Chef::Config[:file_cache_path]
code <<-EOH
- svn co http://svn.apache.org/repos/asf/incubator/thrift thrift
- cd thrift/trunk;
- cp /usr/share/aclocal/pkg.m4 ./aclocal
- sh bootstrap.sh
- ./configure --with-boost=/usr/local --with-libevent=/usr/local --prefix=/usr/local
- make install
+ (tar -zxvf thrift-#{version}.tar.gz)
+ (cd thrift-#{version} && ./configure #{node['thrift']['configure_options'].join(' ')})
+ (cd thrift-#{version} && make install)
EOH
not_if { FileTest.exists?("/usr/local/bin/thrift") }
end

0 comments on commit 5ef7fc5

Please sign in to comment.