Skip to content
This repository has been archived by the owner on Mar 7, 2020. It is now read-only.

erlang install recipe #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions lib/deprec/recipes/erlang.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Capistrano::Configuration.instance(:must_exist).load do
namespace :deprec do
namespace :erlang do

#you can find md5 sums at: http://www.erlang.org/download/MD5
SRC_PACKAGES[:erlang] = {
:md5sum => "7979e662d11476b97c462feb7c132fb7 otp_src_R14B03.tar.gz",
:url => "http://www.erlang.org/download/otp_src_R14B03.tar.gz"
}

#checking if specific Erlang version is already installed
#versin is ok if erl -version returns string which ends with "emulator version 5.8.4"
VERSION_CHECK = {
:command => "erl -version; true",
:should_return => /emulator version 5.8.4/
}

desc "Install Erlang"
task :install do
if version_ok?
logger.debug "Erlang version ok, nothing to do."
else
install_deps
deprec2.download_src(SRC_PACKAGES[:erlang], src_dir)
deprec2.install_from_src(SRC_PACKAGES[:erlang], src_dir)
end
end

desc "Prints currently installed Erlang version"
task :version do
ok = version_ok?
logger.debug "Erlang version '#{@version}' #{ok ? "Ok" : "NOT ok"}."
end

desc "Install Erlang dependencies"
task :install_deps do
apt.install( {:base => %w(build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwxgtk2.8-dev libglu1-mesa-dev fop xsltproc default-jdk)}, :stable )
end

def version_ok?
@version = capture(VERSION_CHECK[:command]).gsub(/[\r\n]/,'')
(@version =~ VERSION_CHECK[:should_return])
end

end
end
end
3 changes: 3 additions & 0 deletions lib/deprec/recipes_minus_rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
require "#{File.dirname(__FILE__)}/recipes/vnstat"
require "#{File.dirname(__FILE__)}/recipes/utils"


require "#{File.dirname(__FILE__)}/recipes/erlang"

# Retired recipes
#
# require "#{File.dirname(__FILE__)}/recipes/integrity"
Expand Down