UncompressedScriptFormula
This commit is contained in:
parent
def522a5cf
commit
f32d0e6af9
@ -159,6 +159,18 @@ private
|
||||
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)
|
||||
before=before.to_s.gsub('"', '\"').gsub('/', '\/')
|
||||
after=after.to_s.gsub('"', '\"').gsub('/', '\/')
|
||||
|
@ -4,22 +4,19 @@ require 'fileutils'
|
||||
|
||||
homepage='http://betterthangrep.com/'
|
||||
|
||||
class UncompressedFormula < Formula
|
||||
class AckFormula < UncompressedScriptFormula
|
||||
def initialize
|
||||
@name='ack'
|
||||
super('http://ack.googlecode.com/svn/tags/1.88/ack')
|
||||
@version='1.88'
|
||||
@url='http://ack.googlecode.com/svn/tags/1.88/ack'
|
||||
@md5='8009a13ab0fc66047bea0ea2ad89419c'
|
||||
end
|
||||
|
||||
def uncompress path
|
||||
path.dirname
|
||||
end
|
||||
end
|
||||
|
||||
UncompressedFormula.new.brew do |prefix|
|
||||
ack=AckFormula.new
|
||||
ack.brew do |prefix|
|
||||
bin=prefix+'bin'
|
||||
FileUtils.mkpath bin
|
||||
FileUtils.cp 'ack', bin
|
||||
`chmod u+x #{bin}/ack`
|
||||
bin.mkpath
|
||||
FileUtils.cp ack.name, bin
|
||||
(bin+ack.name).chmod 0544
|
||||
nil
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user