Skip to content

Commit

Permalink
COOK-348, update source recipe to install 1.0.1
Browse files Browse the repository at this point in the history
- need to handle platforms differently
- ubuntu changed the javascript development package to xulrunner for
  lucid
- hardy isn't supported and we should return with a log message (hardy
  doesn't have sufficient library versions to install couchdb 1.0.1)
  • Loading branch information
jtimberman committed Aug 23, 2010
1 parent 74cff4b commit 4f175b9
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 38 deletions.
4 changes: 2 additions & 2 deletions attributes/default.rb
Expand Up @@ -17,6 +17,6 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.


set[:couch_db][:src_checksum] = "b16f3a10b406d01552893d356cdbf7f429209f938ae7d3aa589ee704df8cb4d2" set[:couch_db][:src_checksum] = "b74a5bfe13e3457798107509cb533d0e7df276adad526ccd5a381c1271108b1f"
set[:couch_db][:src_version] = "0.9.1" set[:couch_db][:src_version] = "1.0.1"
set[:couch_db][:src_mirror] = "http://archive.apache.org/dist/couchdb/#{couch_db.src_version}/apache-couchdb-#{couch_db.src_version}.tar.gz" set[:couch_db][:src_mirror] = "http://archive.apache.org/dist/couchdb/#{couch_db.src_version}/apache-couchdb-#{couch_db.src_version}.tar.gz"
66 changes: 33 additions & 33 deletions metadata.json
@@ -1,55 +1,55 @@
{ {
"providing": { "name": "couchdb",
}, "description": "Installs CouchDB package and starts service",
"attributes": { "long_description": "Installs the CouchDB package if it is available from an package repository on\nthe node. If the package repository is not available, CouchDB needs to be \ninstalled via some other method, either a backported package, or compiled \ndirectly from source. CouchDB is available on Red Hat-based systems through\nthe EPEL Yum Repository.\n",
},
"maintainer": "Opscode, Inc.", "maintainer": "Opscode, Inc.",
"replacing": {
},
"dependencies": {
"erlang": [

]
},
"recipes": {
"couchdb": "Installs and configures CouchDB package",
"couchdb::source": "Installs and configures CouchDB from source"
},
"maintainer_email": "cookbooks@opscode.com", "maintainer_email": "cookbooks@opscode.com",
"groupings": { "license": "Apache 2.0",
},
"recommendations": {
},
"platforms": { "platforms": {
"rhel": [ "ubuntu": [

">= 8.10"
],
"debian": [
">= 5.0"
], ],
"openbsd": [ "openbsd": [


], ],
"debian": [ "freebsd": [
">= 5.0"
], ],
"fedora": [ "rhel": [


], ],
"centos": [ "centos": [


], ],
"freebsd": [ "fedora": [


],
"ubuntu": [
">= 8.10"
] ]
}, },
"license": "Apache 2.0", "dependencies": {
"version": "0.13.3", "erlang": [

]
},
"recommendations": {
},
"suggestions": { "suggestions": {
}, },
"name": "couchdb",
"conflicting": { "conflicting": {
}, },
"long_description": "Installs the CouchDB package if it is available from an package repository on\nthe node. If the package repository is not available, CouchDB needs to be \ninstalled via some other method, either a backported package, or compiled \ndirectly from source. CouchDB is available on Red Hat-based systems through\nthe EPEL Yum Repository.\n", "providing": {
"description": "Installs CouchDB package and starts service" },
"replacing": {
},
"attributes": {
},
"groupings": {
},
"recipes": {
"couchdb": "Installs and configures CouchDB package",
"couchdb::source": "Installs and configures CouchDB from source"
},
"version": "0.14.0"
} }
2 changes: 1 addition & 1 deletion metadata.rb
Expand Up @@ -9,7 +9,7 @@
directly from source. CouchDB is available on Red Hat-based systems through directly from source. CouchDB is available on Red Hat-based systems through
the EPEL Yum Repository. the EPEL Yum Repository.
EOH EOH
version "0.13.3" version "0.14.0"
depends "erlang" depends "erlang"
recipe "couchdb", "Installs and configures CouchDB package" recipe "couchdb", "Installs and configures CouchDB package"
recipe "couchdb::source", "Installs and configures CouchDB from source" recipe "couchdb::source", "Installs and configures CouchDB from source"
Expand Down
27 changes: 25 additions & 2 deletions recipes/source.rb
Expand Up @@ -17,15 +17,38 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.


if node[:platform] == "ubuntu" && node[:platform_version].to_f == 8.04
log "Ubuntu 8.04 does not supply sufficient development libraries via APT to install CouchDB #{node[:couch_db][:src_version]} from source."
return
end

include_recipe "erlang" include_recipe "erlang"


couchdb_tar_gz = File.join(Chef::Config[:file_cache_path], "/", "apache-couchdb-#{node[:couch_db][:src_version]}.tar.gz") couchdb_tar_gz = File.join(Chef::Config[:file_cache_path], "/", "apache-couchdb-#{node[:couch_db][:src_version]}.tar.gz")
compile_flags = String.new
dev_pkgs = Array.new


case node[:platform] case node[:platform]
when "debian", "ubuntu" when "debian", "ubuntu"
%w{ libmozjs-dev libicu-dev libcurl4-openssl-dev }.each do |pkg|
dev_pkgs << "libicu-dev"
dev_pkgs << "libcurl4-openssl-dev"
dev_pkgs << value_for_platform(
"debian" => { "default" => "libmozjs-dev" },
"ubuntu" => {
"9.04" => "libmozjs-dev",
"9.10" => "libmozjs-dev",
"default" => "xulrunner-dev"
}
)

dev_pkgs.each do |pkg|
package pkg package pkg
end end

if node[:platform_version].to_f == 10.04
compile_flags = "--with-js-lib=/usr/lib/xulrunner-devel-1.9.2.8/lib --with-js-include=/usr/lib/xulrunner-devel-1.9.2.8/include"
end
end end


remote_file couchdb_tar_gz do remote_file couchdb_tar_gz do
Expand All @@ -37,7 +60,7 @@
cwd Chef::Config[:file_cache_path] cwd Chef::Config[:file_cache_path]
code <<-EOH code <<-EOH
tar -zxf #{couchdb_tar_gz} tar -zxf #{couchdb_tar_gz}
cd apache-couchdb-#{node[:couch_db][:src_version]} && ./configure && make && make install cd apache-couchdb-#{node[:couch_db][:src_version]} && ./configure #{compile_flags} && make && make install
EOH EOH
not_if { ::FileTest.exists?("/usr/local/bin/couchdb") } not_if { ::FileTest.exists?("/usr/local/bin/couchdb") }
end end
Expand Down

0 comments on commit 4f175b9

Please sign in to comment.