UncompressedScriptFormula

This commit is contained in:
Max Howell 2009-05-23 12:31:32 +01:00
parent def522a5cf
commit f32d0e6af9
2 changed files with 20 additions and 11 deletions

View File

@ -159,6 +159,18 @@ private
end end
end end
# you have to reimplement initialize to set the version, for example usage
# see the ack script
class UncompressedScriptFormula < Formula
def initialize(url)
@url=url
@name=File.basename url
end
def uncompress path
path.dirname
end
end
def inreplace(path, before, after) def inreplace(path, before, after)
before=before.to_s.gsub('"', '\"').gsub('/', '\/') before=before.to_s.gsub('"', '\"').gsub('/', '\/')
after=after.to_s.gsub('"', '\"').gsub('/', '\/') after=after.to_s.gsub('"', '\"').gsub('/', '\/')

View File

@ -4,22 +4,19 @@ require 'fileutils'
homepage='http://betterthangrep.com/' homepage='http://betterthangrep.com/'
class UncompressedFormula < Formula class AckFormula < UncompressedScriptFormula
def initialize def initialize
@name='ack' super('http://ack.googlecode.com/svn/tags/1.88/ack')
@version='1.88' @version='1.88'
@url='http://ack.googlecode.com/svn/tags/1.88/ack'
@md5='8009a13ab0fc66047bea0ea2ad89419c' @md5='8009a13ab0fc66047bea0ea2ad89419c'
end end
def uncompress path
path.dirname
end
end end
UncompressedFormula.new.brew do |prefix| ack=AckFormula.new
ack.brew do |prefix|
bin=prefix+'bin' bin=prefix+'bin'
FileUtils.mkpath bin bin.mkpath
FileUtils.cp 'ack', bin FileUtils.cp ack.name, bin
`chmod u+x #{bin}/ack` (bin+ack.name).chmod 0544
nil
end end