Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Working zeromq cookbook

  • Loading branch information...
commit ddf4fe1dc74c6cc67a2488fb7c4c011dfb990c50 0 parents
@pyronicide authored
52 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 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 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 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 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
Please sign in to comment.
Something went wrong with that request. Please try again.