-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #102258. Signed-off-by: Sean Molenaar <1484494+SMillerDev@users.noreply.github.com> Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
- Loading branch information
1 parent
043074e
commit 7afa69f
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
class RedisAT62 < Formula | ||
desc "Persistent key-value database, with built-in net interface" | ||
homepage "https://redis.io/" | ||
url "https://download.redis.io/releases/redis-6.2.7.tar.gz" | ||
sha256 "b7a79cc3b46d3c6eb52fa37dde34a4a60824079ebdfb3abfbbfa035947c55319" | ||
license "BSD-3-Clause" | ||
|
||
livecheck do | ||
url "https://download.redis.io/releases/" | ||
regex(/href=.*?redis[._-]v?(6\.2(?:\.\d+)+)\.t/i) | ||
end | ||
|
||
keg_only :versioned_formula | ||
|
||
disable! date: "2023-05-27", because: :deprecated_upstream | ||
|
||
depends_on "openssl@3" | ||
|
||
def install | ||
system "make", "install", "PREFIX=#{prefix}", "CC=#{ENV.cc}", "BUILD_TLS=yes" | ||
|
||
%w[run db/redis log].each { |p| (var/p).mkpath } | ||
|
||
# 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/" | ||
s.sub!(/^bind .*$/, "bind 127.0.0.1 ::1") | ||
end | ||
|
||
etc.install "redis.conf" | ||
etc.install "sentinel.conf" => "redis-sentinel.conf" | ||
end | ||
|
||
service do | ||
run [opt_bin/"redis-server", etc/"redis.conf"] | ||
keep_alive true | ||
error_log_path var/"log/redis.log" | ||
log_path var/"log/redis.log" | ||
working_dir var | ||
end | ||
|
||
test do | ||
system bin/"redis-server", "--test-memory", "2" | ||
%w[run db/redis log].each { |p| assert_predicate var/p, :exist?, "#{var/p} doesn't exist!" } | ||
end | ||
end |