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 15226a6 commit 82c1408
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 38 deletions.
4 changes: 2 additions & 2 deletions couchdb/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set[:couch_db][:src_checksum] = "b16f3a10b406d01552893d356cdbf7f429209f938ae7d3aa589ee704df8cb4d2"
set[:couch_db][:src_version] = "0.9.1"
set[:couch_db][:src_checksum] = "b74a5bfe13e3457798107509cb533d0e7df276adad526ccd5a381c1271108b1f"
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"
66 changes: 33 additions & 33 deletions couchdb/metadata.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
{
"providing": {
},
"attributes": {
},
"name": "couchdb",
"description": "Installs CouchDB package and starts service",
"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.",
"replacing": {
},
"dependencies": {
"erlang": [

]
},
"recipes": {
"couchdb": "Installs and configures CouchDB package",
"couchdb::source": "Installs and configures CouchDB from source"
},
"maintainer_email": "[email protected]",
"groupings": {
},
"recommendations": {
},
"license": "Apache 2.0",
"platforms": {
"rhel": [

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

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

],
"fedora": [
"rhel": [

],
"centos": [

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

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

]
},
"recommendations": {
},
"suggestions": {
},
"name": "couchdb",
"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",
"description": "Installs CouchDB package and starts service"
"providing": {
},
"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 couchdb/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
directly from source. CouchDB is available on Red Hat-based systems through
the EPEL Yum Repository.
EOH
version "0.13.3"
version "0.14.0"
depends "erlang"
recipe "couchdb", "Installs and configures CouchDB package"
recipe "couchdb::source", "Installs and configures CouchDB from source"
Expand Down
27 changes: 25 additions & 2 deletions couchdb/recipes/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,38 @@
# See the License for the specific language governing permissions and
# 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"

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]
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
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

remote_file couchdb_tar_gz do
Expand All @@ -37,7 +60,7 @@
cwd Chef::Config[:file_cache_path]
code <<-EOH
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
not_if { ::FileTest.exists?("/usr/local/bin/couchdb") }
end
Expand Down

0 comments on commit 82c1408

Please sign in to comment.