UncompressedScriptFormula
This commit is contained in:
parent
def522a5cf
commit
f32d0e6af9
@ -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('/', '\/')
|
||||||
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user