Skip to content

Commit

Permalink
Working zeromq cookbook
Browse files Browse the repository at this point in the history
  • Loading branch information
grampelberg committed Mar 28, 2011
0 parents commit ddf4fe1
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 0 deletions.
52 changes: 52 additions & 0 deletions README.md
@@ -0,0 +1,52 @@
REQUIREMENTS
============

Platform
--------

Currently tested on Ubuntu 10.10. If you get it working on another platform (or
it doesn't work on your platform of choice), open an issue.

Cookbooks
---------

- build-essential

ATTRIBUTES
==========

All attributes are named under the `zeromq` keyspace. The attributes
specified in the cookbook are used to setup the default config file.

* `node[:zeromq][:src_version]` - version of zeromq to install
* `node[:zeromq][:install_dir]` - location to install zeromq to
* `node[:zeromq][:src_mirror]` - full URL to download the source from.

RECIPES
=======

default
-------

Installs zeromq and installs it.

LICENSE AND AUTHOR
==================

Author:: Thomas Rampelberg (<thomas@saunter.org>)

Copyright 2011, Thomas Rampelberg

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.


22 changes: 22 additions & 0 deletions attributes/default.rb
@@ -0,0 +1,22 @@
#
# Author:: Thomas Rampelberg <thomas@saunter.org>
# Cookbook Name:: zeromq
# Attributes:: zeromq
#
# Copyright 2010, Thomas Rampelberg
#
# 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[:zeromq][:src_version] = "2.0.8"
default[:zeromq][:install_dir] = "/opt/zeromq-#{zeromq[:src_version]}"
default[:zeromq][:src_mirror] = "http://www.zeromq.org/local--files/area:download/zeromq-#{zeromq[:src_version]}.tar.gz"
29 changes: 29 additions & 0 deletions metadata.json
@@ -0,0 +1,29 @@
{
"name": "zeromq",
"description": "Installs/Configures zeromq",
"long_description": "= DESCRIPTION:\n\n= REQUIREMENTS:\n\n= ATTRIBUTES:\n\n= USAGE:\n\n",
"maintainer": "Thomas Rampelberg",
"maintainer_email": "thomas@saunter.org",
"license": "Apache2.0",
"platforms": {
},
"dependencies": {
},
"recommendations": {
},
"suggestions": {
},
"conflicting": {
},
"providing": {
},
"replacing": {
},
"attributes": {
},
"groupings": {
},
"recipes": {
},
"version": "2.0.8"
}
6 changes: 6 additions & 0 deletions metadata.rb
@@ -0,0 +1,6 @@
maintainer "Thomas Rampelberg"
maintainer_email "thomas@saunter.org"
license "Apache 2.0"
description "Installs/Configures zeromq"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "2.0.8"
41 changes: 41 additions & 0 deletions recipes/default.rb
@@ -0,0 +1,41 @@
#
# Cookbook Name:: mongrel2
# Recipe:: default
#
# Author:: Thomas Rampelberg (<thomas@saunter.org>)
#
# Copyright 2011, Thomas Rampelberg
#
# 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.
#

include_recipe "build-essential"

zeromq_tar_gz = File.join(Chef::Config[:file_cache_path], "/", "zeromq-#{node[:zeromq][:src_version]}.tar.gz")

remote_file zeromq_tar_gz do
source node[:zeromq][:src_mirror]
end

package "uuid-dev" do
action :upgrade
end

bash "install zeromq #{node[:zeromq][:src_version]}" do
cwd Chef::Config[:file_cache_path]
code <<-EOH
tar -zxf #{zeromq_tar_gz}
cd zeromq-#{node[:zeromq][:src_version]} && ./configure --prefix=#{node[:zeromq][:install_dir]} && make && make install
EOH
not_if { ::FileTest.exists?("#{node[:zeromq][:install_dir]}/lib/libzmq.so") }
end

0 comments on commit ddf4fe1

Please sign in to comment.