Skip to content
This repository has been archived by the owner on Nov 23, 2017. It is now read-only.

Commit

Permalink
thrift v0.99.0
Browse files Browse the repository at this point in the history
* use source install not subversion install
* install python bindings (autodetected)
* use attributes for mirror url, version, checksum and config opts
  • Loading branch information
jtimberman committed May 22, 2011
1 parent e4d53b8 commit 7b3a0f6
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 23 deletions.
21 changes: 12 additions & 9 deletions thrift/README.rdoc → thrift/README.md
@@ -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:

Expand All @@ -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.
Expand Down
23 changes: 23 additions & 0 deletions thrift/attributes/default.rb
@@ -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'] = []
8 changes: 4 additions & 4 deletions thrift/metadata.rb
@@ -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
23 changes: 13 additions & 10 deletions thrift/recipes/default.rb
Expand Up @@ -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 7b3a0f6

Please sign in to comment.