#
# Cookbook:: kosmos-bitcoin
# Recipe:: dotnet
#

build_essential

apt_repository 'universe' do
  uri 'http://archive.ubuntu.com/ubuntu/'
  distribution 'focal'
  components ['universe']
end

apt_package 'apt-transport-https'

remote_file '/opt/packages-microsoft-prod.deb' do
  source node['dotnet']['ms_packages_src_url']
  checksum node['dotnet']['ms_packages_src_checksum']
  action :create_if_missing
end

dpkg_package 'packages-microsoft-prod' do
  source '/opt/packages-microsoft-prod.deb'
  action :install
  notifies :run, 'execute[apt_update]'
end

execute 'apt_update' do
  command 'apt update'
  action :nothing
end

apt_package 'dotnet-sdk-3.1'
