Skip to content

Commit

Permalink
Add package:osx to create .pkgs
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Phoenix committed Dec 22, 2009
1 parent 405489c commit fed666f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
28 changes: 9 additions & 19 deletions rakelib/install.rake
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,13 @@ def install_dir(lib)
lib
end

if fr = ENV['FAKEROOT']
install_dirs = [
File.join(fr, BUILD_CONFIG[:bindir]),
File.join(fr, BUILD_CONFIG[:libdir]),
File.join(fr, BUILD_CONFIG[:includedir]),
File.join(fr, BUILD_CONFIG[:mandir]),
File.join(fr, BUILD_CONFIG[:gemsdir])
]
else
install_dirs = [
BUILD_CONFIG[:bindir],
BUILD_CONFIG[:libdir],
BUILD_CONFIG[:includedir],
BUILD_CONFIG[:mandir],
BUILD_CONFIG[:gemsdir]
]
end
install_dirs = [
BUILD_CONFIG[:bindir],
BUILD_CONFIG[:libdir],
BUILD_CONFIG[:includedir],
BUILD_CONFIG[:mandir],
BUILD_CONFIG[:gemsdir]
]

# What the hell does this code do? We want to avoid sudo whenever
# possible. This code is based on the assumption that if A is a
Expand All @@ -40,7 +30,7 @@ end
# create A. Otherwise, we can't create A and sudo is required.
def need_sudo?(dirs)
dirs.each do |name|
dir = File.expand_path name
dir = install_dir(File.expand_path(name))

until dir == "/"
if File.directory? dir
Expand Down Expand Up @@ -95,7 +85,7 @@ namespace :install do
elsif !need_install?
puts "Install directory is the same as build directory, nothing to install"
else
install_dirs.each { |name| mkdir_p name, :verbose => $verbose }
install_dirs.each { |name| mkdir_p install_dir(name), :verbose => $verbose }

FileList["vm/capi/*.h"].each do |name|
install_file name, %r[^vm/capi], BUILD_CONFIG[:includedir]
Expand Down
14 changes: 14 additions & 0 deletions rakelib/package.rake
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,18 @@ namespace :package do
task :llvm do
sh "tar -c -C vm/external_libs/llvm --exclude .svn --exclude \"*.dylib\" --exclude \"*.so\" -f - Release/lib Release/bin/llvm-config include | bzip2 -9 > llvm-#{host_triple}.tar.bz2"
end

desc "Build and package the result as an OS X .pkg"
task :osx => "build" do
Dir.mkdir "pkgtmp"

ENV['FAKEROOT'] = "pkgtmp"

Rake::Task['install'].invoke

sh "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker --root pkgtmp --id com.engineyard.rubinius -o rubinius-#{Rubinius::BUILD_CONFIG[:version]}.pkg -t Rubinius -v"

rm_rf "pkgtmp"

end
end

0 comments on commit fed666f

Please sign in to comment.