Skip to content

Commit

Permalink
Merge pull request Homebrew#200447 from Homebrew/cfssl-build
Browse files Browse the repository at this point in the history
cfssl: update go build
  • Loading branch information
BrewTestBot authored Dec 8, 2024
2 parents 01ac193 + 0c6bc9c commit cce9904
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Formula/c/cfssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class Cfssl < Formula
def install
ldflags = "-s -w -X github.com/cloudflare/cfssl/cli/version.version=#{version}"

system "go", "build", *std_go_args(output: bin/"cfssl", ldflags:), "cmd/cfssl/cfssl.go"
system "go", "build", *std_go_args(output: bin/"cfssljson", ldflags:), "cmd/cfssljson/cfssljson.go"
system "go", "build", "-o", "#{bin}/cfsslmkbundle", "cmd/mkbundle/mkbundle.go"
system "go", "build", *std_go_args(ldflags:, output: bin/"cfssl"), "./cmd/cfssl"
system "go", "build", *std_go_args(ldflags:, output: bin/"cfssljson"), "./cmd/cfssljson"
system "go", "build", *std_go_args(ldflags: "-s -w", output: bin/"mkbundle"), "./cmd/mkbundle"
end

def caveats
Expand All @@ -36,6 +36,9 @@ def caveats
end

test do
assert_match version.to_s, shell_output("#{bin}/cfssl version")
assert_match version.to_s, shell_output("#{bin}/cfssljson --version")

(testpath/"request.json").write <<~JSON
{
"CN" : "Your Certificate Authority",
Expand All @@ -61,7 +64,5 @@ def caveats
assert_match(/.*-----END CERTIFICATE-----$/, response["cert"])
assert_match(/^-----BEGIN RSA PRIVATE KEY-----.*/, response["key"])
assert_match(/.*-----END RSA PRIVATE KEY-----$/, response["key"])

assert_match(/^Version:\s+#{version}/, shell_output("#{bin}/cfssl version"))
end
end

0 comments on commit cce9904

Please sign in to comment.