2010-11-24 09:38:09 +00:00
|
|
|
# Builds binary brew package
|
2011-03-29 10:26:03 +01:00
|
|
|
require 'cmd/install'
|
|
|
|
|
2010-11-24 09:38:09 +00:00
|
|
|
destination = HOMEBREW_PREFIX + "Bottles"
|
2011-07-29 11:41:51 +01:00
|
|
|
Dir.mkdir destination unless File.directory? destination
|
2010-11-24 09:38:09 +00:00
|
|
|
|
|
|
|
ARGV.each do|formula|
|
2010-12-01 23:01:54 +00:00
|
|
|
# Get the latest version
|
|
|
|
version = `brew list --versions #{formula}`.split.last
|
2011-07-29 11:41:51 +01:00
|
|
|
|
|
|
|
if version.nil?
|
|
|
|
onoe "Formula not installed: #{formula}"
|
|
|
|
next
|
|
|
|
end
|
|
|
|
|
2010-11-24 09:38:09 +00:00
|
|
|
source = HOMEBREW_CELLAR + formula + version
|
2011-07-29 11:41:51 +01: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}"
|
2011-06-22 19:11:45 +01:00
|
|
|
sha1 = Pathname.new("#{destination}/#{filename}").sha1
|
|
|
|
ohai "Bottled #{filename}"
|
|
|
|
ohai "SHA1 #{sha1}"
|
2010-12-01 23:01:54 +00:00
|
|
|
end
|
2010-12-02 01:13:41 +00:00
|
|
|
end
|