This repository has been archived on 2022-01-17. You can view files and clone it, but cannot push or open issues/pull-requests.
packaging/src/backends/install.cr

39 lines
763 B
Crystal

# Installation process
# Files to package are put in recipe.fake_root_directory
#
# Backends:
# - make
# pass if no Makefile
class Package::Backend::Install
def self.make : Backend::Building
Backend::Building.new "install", "make" do |context, recipe|
unless Dir.exists? recipe.dirname
Baguette::Log.detail "no '#{recipe.dirname}' directory: pass"
next BuildStatus::Pass
end
Do.cd recipe.dirname
unless File.exists? "Makefile"
next BuildStatus::Pass
end
options = [
"'DESTDIR=#{recipe.fake_root_directory}'",
recipe.options["make install"]? || ""
]
child = Do.sh "make install #{options.join " "}"
if child.exit_status == 0
BuildStatus::Success
else
BuildStatus::Failed
end
end
end
end