diff --git a/lib/omnibus/builder.rb b/lib/omnibus/builder.rb index 5c0135f24..1b21b1137 100644 --- a/lib/omnibus/builder.rb +++ b/lib/omnibus/builder.rb @@ -693,7 +693,7 @@ def sync(source, destination, options = {}) # Default: [:config_guess, :config_sub] def update_config_guess(target: ".", install: [:config_guess, :config_sub]) build_commands << BuildCommand.new("update_config_guess `target: #{target} install: #{install.inspect}'") do - config_guess_dir = "/tmp/build/embedded/lib/config_guess" + config_guess_dir = "#{install_dir}/embedded/lib/config_guess" %w{config.guess config.sub}.each do |c| unless File.exist?(File.join(config_guess_dir, c)) raise "Can not find #{c}. Make sure you add a dependency on 'config_guess' in your software definition" diff --git a/lib/omnibus/health_check.rb b/lib/omnibus/health_check.rb index ea2d02ef3..861637593 100644 --- a/lib/omnibus/health_check.rb +++ b/lib/omnibus/health_check.rb @@ -557,7 +557,8 @@ def health_check_aix current_library = nil bad_libs = {} - yield_shellout_results("find #{project.install_dir}/ -type f | xargs file | grep \"RISC System\" | awk -F: '{print $1}' | xargs -n 1 ldd") do |line| + # Executables, .so, .a and .o + yield_shellout_results("find #{project.install_dir}/ -type f -perm -u=x -o -perm -g=x -o -name \"*.so*\" -o -name \"*.a\" -o -name \"*.o\" | xargs file | grep -E \"RISC System|XCOFF\" | awk -F: '{print $1}' | xargs -n 1 ldd") do |line| case line when /^(.+) needs:$/ current_library = Regexp.last_match[1] diff --git a/lib/omnibus/packagers/base.rb b/lib/omnibus/packagers/base.rb index 512688eb6..e536f73ce 100644 --- a/lib/omnibus/packagers/base.rb +++ b/lib/omnibus/packagers/base.rb @@ -218,7 +218,7 @@ def package_path # @return [String] # def staging_dir - @staging_dir ||= Dir.mktmpdir(project.package_name) + @staging_dir ||= Dir.mktmpdir(project.package_name, ENV['OMNIBUS_STAGING_DIR']) end # diff --git a/lib/omnibus/packagers/bff.rb b/lib/omnibus/packagers/bff.rb index 7ab41b25b..72831516d 100644 --- a/lib/omnibus/packagers/bff.rb +++ b/lib/omnibus/packagers/bff.rb @@ -37,6 +37,27 @@ class Packager::BFF < Packager::Base destination = File.join(staging_dir, project.install_dir) FileSyncer.sync(project.install_dir, destination, exclude: exclusions) + # Copy over any user-specified extra package files. + # + # Files retain their relative paths inside the scratch directory, so + # we need to grab the dirname of the file, create that directory, and + # then copy the file into that directory. + # + # extra_package_file '/path/to/foo.txt' #=> /tmp/BUILD/path/to/foo.txt + project.extra_package_files.each do |file| + parent = File.dirname(file) + + if File.directory?(file) + destination = File.join("#{staging_dir}", file) + create_directory(destination) + FileSyncer.sync(file, destination) + else + destination = File.join("#{staging_dir}", parent) + create_directory(destination) + copy_file(file, destination) + end + end + # Create the scripts staging directory create_directory(scripts_staging_dir) end