Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ase node[:platform]
when "debian", "ubuntu"
%w{automake autoconf libtool subversion-tools help2man build-essential erlang libicu38 libicu-dev libreadline5-dev checkinstall libmozjs-dev wget libcurl4-gnutls-dev}.each {|pkg| package(pkg) }
end
execute "download_couchdb" do
user "root"
cwd "/tmp"
command "wget http://mirror.public-internet.co.uk/ftp/apache/couchdb/0.9.1/apache-couchdb-0.9.1.tar.gz"
creates "/tmp/apache-couchdb-0.9.1.tar.gz"
end
group "couchdb" do
end
user "couchdb" do
comment "CouchDB user"
gid "couchdb"
supports :manage_home => false
shell "/bin/bash"
end
# http://github.com/jamescarr/cookbooks/
# http://www.isolani.co.uk/blog/web/InstallingCouchdbOnJeos804
script "install_couchdb" do
interpreter "bash"
user "root"
cwd "/tmp"
code <<-EOH
tar zxvf apache-couchdb-0.9.1.tar.gz
cd apache-couchdb-0.9.1
./configure && make && make install
mkdir -p /usr/local/var/lib/couchdb
chown -R couchdb /usr/local/var/lib/couchdb
mkdir -p /usr/local/var/log/couchdb
chown -R couchdb /usr/local/var/log/couchdb
mkdir -p /usr/local/var/run
chown -R couchdb /usr/local/var/run
cp /usr/local/etc/init.d/couchdb /etc/init.d/
update-rc.d couchdb defaults
EOH
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment