diff --git a/crew b/crew index 15197824f..223d11996 100755 --- a/crew +++ b/crew @@ -424,6 +424,13 @@ def build_and_preconfigure (target_dir) end end +def post_install (target_dir) + Dir.chdir target_dir do + puts "Performing post-install..." + @pkg.postinstall + end +end + def compress_doc (dir) # check whether crew should compress return if CREW_NOT_COMPRESS || !File.exist?("#{CREW_PREFIX}/bin/compressdoc") @@ -610,6 +617,9 @@ def install install_package dest_dir end + # perform post-install process + post_install target_dir + #add to installed packages @device[:installed_packages].push(name: @pkg.name, version: @pkg.version) File.open(CREW_CONFIG_PATH + 'device.json', 'w') do |file| diff --git a/lib/package.rb b/lib/package.rb index 65c8d65b0..d9c401982 100644 --- a/lib/package.rb +++ b/lib/package.rb @@ -69,10 +69,23 @@ class Package @is_fake end + # Function to perform build from source. def self.build end + # Function to perform install from source build. + def self.install + + end + + # Function to perform post-install for all even if it is a fake package. + def self.postinstall + + end + + # Function to perform check from source build. + # This is execute if and only if `crew build`. def self.check end