Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis@6.2 6.2.7 (new formula) #102258

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions Formula/redis@6.2.rb
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