2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-07 03:54:11 +00:00
|
|
|
|
2009-12-11 05:47:51 +00:00
|
|
|
class Redis <Formula
|
2010-03-12 01:25:37 +00:00
|
|
|
url 'http://redis.googlecode.com/files/redis-1.2.5.tar.gz'
|
2009-12-11 05:47:51 +00:00
|
|
|
homepage 'http://code.google.com/p/redis/'
|
2010-03-12 01:25:37 +00:00
|
|
|
sha1 'f28d840d8100586796cab02ccd8e91545a92179d'
|
2009-12-11 05:47:51 +00:00
|
|
|
|
|
|
|
def install
|
2009-12-11 06:19:35 +00:00
|
|
|
%w( run db/redis log ).each do |path|
|
2010-02-14 01:17:25 +00:00
|
|
|
(var+path).mkpath
|
2009-12-11 06:19:35 +00:00
|
|
|
end
|
|
|
|
|
2010-02-14 01:17:25 +00:00
|
|
|
ENV.gcc_4_2
|
2009-12-11 06:31:14 +00:00
|
|
|
system "make"
|
|
|
|
bin.install %w( redis-benchmark redis-cli redis-server )
|
2010-02-14 01:17:25 +00:00
|
|
|
|
|
|
|
# Fix up default conf file to match our paths
|
|
|
|
inreplace "redis.conf" do |s|
|
|
|
|
s.gsub! "/var/run/redis.pid", "#{var}/run/redis.pid"
|
|
|
|
s.gsub! "dir ./", "dir #{var}/db/redis/"
|
|
|
|
end
|
|
|
|
|
|
|
|
etc.install "redis.conf"
|
2009-09-11 07:45:46 +00:00
|
|
|
end
|
2009-09-07 03:54:11 +00:00
|
|
|
|
2009-09-11 07:45:46 +00:00
|
|
|
def caveats
|
|
|
|
"To start redis: $ redis-server #{etc}/redis.conf"
|
2009-09-07 03:54:11 +00:00
|
|
|
end
|
|
|
|
end
|