2010-11-24 09:38:09 +00:00
|
|
|
# Builds binary brew package
|
|
|
|
brew_install
|
|
|
|
|
|
|
|
destination = HOMEBREW_PREFIX + "Bottles"
|
|
|
|
if not File.directory?(destination)
|
2010-12-01 23:01:54 +00:00
|
|
|
Dir.mkdir destination
|
2010-11-24 09:38:09 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
ARGV.each do|formula|
|
2010-12-01 23:01:54 +00:00
|
|
|
# Get the latest version
|
|
|
|
version = `brew list --versions #{formula}`.split.last
|
2010-11-24 09:38:09 +00:00
|
|
|
source = HOMEBREW_CELLAR + formula + version
|
2010-12-01 23:07:26 +00:00
|
|
|
filename = formula + '-' + version + '-bottle.tar.gz'
|
2010-12-01 23:01:54 +00:00
|
|
|
ohai "Bottling #{formula} #{version}..."
|
|
|
|
HOMEBREW_CELLAR.cd do
|
2010-12-01 23:05:56 +00:00
|
|
|
# Use gzip, faster to compress than bzip2, faster to uncompress than bzip2
|
|
|
|
# or an uncompressed tarball (and more bandwidth friendly).
|
2010-12-01 23:04:33 +00:00
|
|
|
safe_system 'tar', 'czf', "#{destination}/#{filename}", "#{formula}/#{version}"
|
2010-12-01 23:01:54 +00:00
|
|
|
end
|
|
|
|
ohai "Bottled #{filename}"
|
2010-12-02 01:13:41 +00:00
|
|
|
end
|