<commit_before>#
# Cookbook Name:: mesos
# Recipe:: install
#

%w(
  python
  build-essential
  maven
).each do |r|
  include_recipe r
end

case node["platform"]
when "centos"
  repo_url = value_for_platform(
    'centos' => {
      'default' => 'http://opensource.wandisco.com/centos/6/svn-1.8/RPMS/$basearch/',
      '~> 7.0' => 'http://opensource.wandisco.com/centos/7/svn-1.9/RPMS/$basearch/'
    }
  )

  yum_repository 'WANdiscoSVN' do
    description 'WANdiscoSVN Repo'
    baseurl repo_url
    gpgkey 'http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco'
  end

  pkgs = %w(
    zlib-devel
    libcurl-devel
    openssl-devel
    cyrus-sasl-devel
    cyrus-sasl-md5
    apr-devel
    subversion-devel
    apr-util-devel
  )
when "ubuntu"
  pkgs = %w(
    unzip
    libtool
    python-boto
    libcurl4-nss-dev
    libsasl2-dev
    libapr1-dev
    libsvn-dev
  )
end

pkgs.each do |pkg|
  package pkg
end

mesos_version = node[:mesos][:version]
prefix = node[:mesos][:prefix]
cmd = "#{prefix}/mesos-master --version |cut -f 2 -d ' '"

unless File.exist?("#{prefix}/mesos-master") && (`#{cmd}`.chop == mesos_version)
  remote_file "#{Chef::Config[:file_cache_path]}/mesos-#{mesos_version}.zip" do
    source "https://github.com/apache/mesos/archive/#{mesos_version}.zip"
  end

  execute "extract mesos to #{node[:mesos][:home]}" do
    cwd    "#{node[:mesos][:home]}"
    command "unzip -o #{Chef::Config[:file_cache_path]}/mesos-#{mesos_version}.zip -d ./" \
             " && mv mesos-#{mesos_version} mesos"
  end

  execute 'build mesos from source' do
    cwd     "#{node[:mesos][:home]}/mesos"
    command "./bootstrap && mkdir -p build && cd build && ../configure --prefix=#{prefix} && make"
  end
<commit_msg>Fix “installed” check for mesos::source<commit_after>#
# Cookbook Name:: mesos
# Recipe:: install
#

%w(
  python
  build-essential
  maven
).each do |r|
  include_recipe r
end

case node["platform"]
when "centos"
  repo_url = value_for_platform(
    'centos' => {
      'default' => 'http://opensource.wandisco.com/centos/6/svn-1.8/RPMS/$basearch/',
      '~> 7.0' => 'http://opensource.wandisco.com/centos/7/svn-1.9/RPMS/$basearch/'
    }
  )

  yum_repository 'WANdiscoSVN' do
    description 'WANdiscoSVN Repo'
    baseurl repo_url
    gpgkey 'http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco'
  end

  pkgs = %w(
    zlib-devel
    libcurl-devel
    openssl-devel
    cyrus-sasl-devel
    cyrus-sasl-md5
    apr-devel
    subversion-devel
    apr-util-devel
  )
when "ubuntu"
  pkgs = %w(
    unzip
    libtool
    python-boto
    libcurl4-nss-dev
    libsasl2-dev
    libapr1-dev
    libsvn-dev
  )
end

pkgs.each do |pkg|
  package pkg
end

mesos_version = node[:mesos][:version]
prefix = node[:mesos][:prefix]
bin = "#{prefix}/sbin/mesos-master"
cmd = "#{bin} --version |cut -f 2 -d ' '"

unless File.exist?(bin) && (`#{cmd}`.chop == mesos_version)
  remote_file "#{Chef::Config[:file_cache_path]}/mesos-#{mesos_version}.zip" do
    source "https://github.com/apache/mesos/archive/#{mesos_version}.zip"
  end

  execute "extract mesos to #{node[:mesos][:home]}" do
    cwd    "#{node[:mesos][:home]}"
    command "unzip -o #{Chef::Config[:file_cache_path]}/mesos-#{mesos_version}.zip -d ./" \
             " && mv mesos-#{mesos_version} mesos"
  end

  execute 'build mesos from source' do
    cwd     "#{node[:mesos][:home]}/mesos"
    command "./bootstrap && mkdir -p build && cd build && ../configure --prefix=#{prefix} && make"
  end

{'fraction_non_alphanumeric': 0.16873020443420675, 'fraction_numerical': 0.007486323063633746, 'mean_word_length': 3.0631578947368423, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4073158', 'n_tokens_mistral': 1423, 'n_tokens_neox': 1388, 'n_words': 252}