2010-11-24 09:38:09 +00:00
|
|
|
# Builds binary brew package
|
2012-01-16 19:37:37 +00:00
|
|
|
require 'tab'
|
2011-03-29 10:26:03 +01:00
|
|
|
|
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"
|
2011-08-25 02:32:41 +01:00
|
|
|
destination = Pathname.pwd
|
2012-01-16 19:37:37 +00:00
|
|
|
|
|
|
|
tab = Tab.for_keg source
|
|
|
|
if not tab.built_bottle
|
|
|
|
onoe "Formula not installed with '--build-bottle': #{formula}"
|
|
|
|
next
|
|
|
|
end
|
|
|
|
|
2010-12-01 23:01:54 +00:00
|
|
|
HOMEBREW_CELLAR.cd do
|
2012-01-16 19:37:37 +00:00
|
|
|
ohai "Bottling #{formula} #{version}..."
|
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).
|
2011-08-25 02:32:41 +01:00
|
|
|
safe_system 'tar', 'czf', destination/filename, "#{formula}/#{version}"
|
|
|
|
puts "./#{filename}"
|
|
|
|
puts "bottle 'https://downloads.sf.net/project/machomebrew/Bottles/#{filename}'"
|
|
|
|
puts "bottle_sha1 '#{(destination/filename).sha1}'"
|
2010-12-01 23:01:54 +00:00
|
|
|
end
|
2010-12-02 01:13:41 +00:00
|
|
|
end
|