From 9a87b8394bbb34072c71d8e087aba8961861fa4c Mon Sep 17 00:00:00 2001 From: Kyle Penfound Date: Wed, 31 Mar 2021 16:25:42 -0400 Subject: [PATCH] Generate multiarch formula with new templater --- Formula/boundary.rb | 25 ++++++++++--- Formula/consul.rb | 83 +++++++++++++++++++++++++------------------ Formula/nomad.rb | 84 +++++++++++++++++++++++++++----------------- Formula/packer.rb | 29 +++++++++++++-- Formula/terraform.rb | 24 +++++++++++-- Formula/vault.rb | 84 +++++++++++++++++++++++++++----------------- Formula/waypoint.rb | 27 +++++++++++--- 7 files changed, 240 insertions(+), 116 deletions(-) diff --git a/Formula/boundary.rb b/Formula/boundary.rb index b897ed54..5177565b 100644 --- a/Formula/boundary.rb +++ b/Formula/boundary.rb @@ -1,14 +1,31 @@ class Boundary < Formula desc "Boundary" homepage "https://www.boundaryproject.io/" + version "0.1.8" - url "https://releases.hashicorp.com/boundary/0.1.8/boundary_0.1.8_darwin_amd64.zip" + if OS.mac? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/boundary/0.1.8/boundary_0.1.8_darwin_amd64.zip" + sha256 "decc37dbaf7723cd9b08b005e0b050a0f34334cf198f9553af5d63e133eea33f" + end + + if OS.linux? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/boundary/0.1.8/boundary_0.1.8_linux_amd64.zip" + sha256 "22afe6070391c9d5a5d14e32a7b438b7ccd200e4d68862c1f10145f1afb09302" + end + + if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit? + url "https://releases.hashicorp.com/boundary/0.1.8/boundary_0.1.8_linux_arm.zip" + sha256 "ee0801e58ca9a082b91fd9328a2623c110d805da2cdc821ccd2c3e17a81d3151" + end + + if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit? + url "https://releases.hashicorp.com/boundary/0.1.8/boundary_0.1.8_linux_arm64.zip" + sha256 "7e6d3820a78468f44f3c78c6f78be22b31d1b3054e15f79d940197efcd28edf2" + end - version "0.1.8" - sha256 "decc37dbaf7723cd9b08b005e0b050a0f34334cf198f9553af5d63e133eea33f" bottle :unneeded - # conflicts_with "boundary" + conflicts_with "boundary" def install bin.install "boundary" diff --git a/Formula/consul.rb b/Formula/consul.rb index 7e86e04b..22a39661 100644 --- a/Formula/consul.rb +++ b/Formula/consul.rb @@ -1,10 +1,23 @@ class Consul < Formula desc "Consul" homepage "https://www.consul.io" - - url "https://releases.hashicorp.com/consul/1.9.4/consul_1.9.4_darwin_amd64.zip" version "1.9.4" - sha256 "c168240d52f67c71b30ef51b3594673cad77d0dbbf38c412b2ee30b39ef30843" + + if OS.mac? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/consul/1.9.4/consul_1.9.4_darwin_amd64.zip" + sha256 "c168240d52f67c71b30ef51b3594673cad77d0dbbf38c412b2ee30b39ef30843" + end + + if OS.linux? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/consul/1.9.4/consul_1.9.4_linux_amd64.zip" + sha256 "da3919197ef33c4205bb7df3cc5992ccaae01d46753a72fe029778d7f52fb610" + end + + if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit? + url "https://releases.hashicorp.com/consul/1.9.4/consul_1.9.4_linux_arm64.zip" + sha256 "012c552aff502f907416c9a119d2dfed88b92e981f9b160eb4fe292676afdaeb" + end + bottle :unneeded conflicts_with "consul" @@ -15,38 +28,38 @@ def install plist_options manual: "consul agent -dev -bind 127.0.0.1" - def plist - <<~EOS - - - - - KeepAlive - - SuccessfulExit - - - Label - #{plist_name} - ProgramArguments - - #{opt_bin}/consul - agent - -dev - -bind - 127.0.0.1 - - RunAtLoad - - WorkingDirectory - #{var} - StandardErrorPath - #{var}/log/consul.log - StandardOutPath - #{var}/log/consul.log - - - EOS + def plist; <<~EOS + + + + + KeepAlive + + SuccessfulExit + + + Label + #{plist_name} + ProgramArguments + + #{opt_bin}/consul + agent + -dev + -bind + 127.0.0.1 + + RunAtLoad + + WorkingDirectory + #{var} + StandardErrorPath + #{var}/log/consul.log + StandardOutPath + #{var}/log/consul.log + + + +EOS end test do diff --git a/Formula/nomad.rb b/Formula/nomad.rb index 625f3784..0c4c31a8 100644 --- a/Formula/nomad.rb +++ b/Formula/nomad.rb @@ -1,10 +1,28 @@ class Nomad < Formula desc "Nomad" homepage "https://www.nomadproject.io/" - - url "https://releases.hashicorp.com/nomad/1.0.4/nomad_1.0.4_darwin_amd64.zip" version "1.0.4" - sha256 "329f9ffca0dc709d04ba465d2dd3b12f54cf2e5f8b1ae169e4313239ada3e5b5" + + if OS.mac? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/nomad/1.0.4/nomad_1.0.4_darwin_amd64.zip" + sha256 "329f9ffca0dc709d04ba465d2dd3b12f54cf2e5f8b1ae169e4313239ada3e5b5" + end + + if OS.linux? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/nomad/1.0.4/nomad_1.0.4_linux_amd64.zip" + sha256 "dbb8b8b1366c8ea9504cc396f2c00a254e043b1fc9f39f39d9ef3398e454e840" + end + + if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit? + url "https://releases.hashicorp.com/nomad/1.0.4/nomad_1.0.4_linux_arm.zip" + sha256 "69cf7a6e5f4bd2c82439bc222f0ede07400701431ecd8754bd80564fa08cbf0a" + end + + if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit? + url "https://releases.hashicorp.com/nomad/1.0.4/nomad_1.0.4_linux_arm64.zip" + sha256 "f7b03c7bca6e631aa72cd8128204636179496a5f29b1e82553a40aa809a4a6c9" + end + bottle :unneeded conflicts_with "nomad" @@ -15,36 +33,36 @@ def install plist_options manual: "nomad agent -dev" - def plist - <<~EOS - - - - - KeepAlive - - SuccessfulExit - - - Label - #{plist_name} - ProgramArguments - - #{opt_bin}/nomad - agent - -dev - - RunAtLoad - - WorkingDirectory - #{var} - StandardErrorPath - #{var}/log/nomad.log - StandardOutPath - #{var}/log/nomad.log - - - EOS + def plist; <<~EOS + + + + + KeepAlive + + SuccessfulExit + + + Label + #{plist_name} + ProgramArguments + + #{opt_bin}/nomad + agent + -dev + + RunAtLoad + + WorkingDirectory + #{var} + StandardErrorPath + #{var}/log/nomad.log + StandardOutPath + #{var}/log/nomad.log + + + +EOS end test do diff --git a/Formula/packer.rb b/Formula/packer.rb index 024b4e7c..783031b3 100644 --- a/Formula/packer.rb +++ b/Formula/packer.rb @@ -1,10 +1,33 @@ class Packer < Formula desc "Packer" homepage "https://www.packer.io/" - - url "https://releases.hashicorp.com/packer/1.7.1/packer_1.7.1_darwin_amd64.zip" version "1.7.1" - sha256 "df4fce2ee7bfc7dbb636d9dc6c7fa1c998e3a526dd6c804998e86a2ee30c800f" + + if OS.mac? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/packer/1.7.1/packer_1.7.1_darwin_amd64.zip" + sha256 "df4fce2ee7bfc7dbb636d9dc6c7fa1c998e3a526dd6c804998e86a2ee30c800f" + end + + if OS.mac? && Hardware::CPU.arm? + url "https://releases.hashicorp.com/packer/1.7.1/packer_1.7.1_darwin_arm64.zip" + sha256 "ea6b46c9fcc668393182192f3ec60162cc41922c49cf1b3db4e8daa097a426e8" + end + + if OS.linux? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/packer/1.7.1/packer_1.7.1_linux_amd64.zip" + sha256 "1afd50d8cd30290d569e07548fecfb4fe8c95994740acbc3a5b2c2246268a026" + end + + if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit? + url "https://releases.hashicorp.com/packer/1.7.1/packer_1.7.1_linux_arm.zip" + sha256 "a92a3c28e1bbc573b6dc0c09a25fa48514c5d7d3c910048a99d4e84905bcd88d" + end + + if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit? + url "https://releases.hashicorp.com/packer/1.7.1/packer_1.7.1_linux_arm64.zip" + sha256 "356edb9f326a9c44a57858d36fa60881fbef109ef52028634e92b73f2464c210" + end + bottle :unneeded conflicts_with "packer" diff --git a/Formula/terraform.rb b/Formula/terraform.rb index b1f2264d..5edb399c 100644 --- a/Formula/terraform.rb +++ b/Formula/terraform.rb @@ -1,10 +1,28 @@ class Terraform < Formula desc "Terraform" homepage "https://www.terraform.io/" - - url "https://releases.hashicorp.com/terraform/0.14.9/terraform_0.14.9_darwin_amd64.zip" version "0.14.9" - sha256 "96d0b1c807415ba295a70e8afed04e233778673103587f321164ebb96be123d8" + + if OS.mac? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/terraform/0.14.9/terraform_0.14.9_darwin_amd64.zip" + sha256 "96d0b1c807415ba295a70e8afed04e233778673103587f321164ebb96be123d8" + end + + if OS.linux? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/terraform/0.14.9/terraform_0.14.9_linux_amd64.zip" + sha256 "47e097cfbfb64e97492934f50e646cb84df952eb76897182557811b45603dbf0" + end + + if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit? + url "https://releases.hashicorp.com/terraform/0.14.9/terraform_0.14.9_linux_arm.zip" + sha256 "a58df5be281c7e2c0627cf15f755634201220f0c55ce30c7b37d3fc088bd3ef2" + end + + if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit? + url "https://releases.hashicorp.com/terraform/0.14.9/terraform_0.14.9_linux_arm64.zip" + sha256 "5bcdaf46927edcc46f063faef02878620b137a84a4523004c70b6ab05b20a15c" + end + bottle :unneeded conflicts_with "terraform" diff --git a/Formula/vault.rb b/Formula/vault.rb index aa40c23b..fce19b1f 100644 --- a/Formula/vault.rb +++ b/Formula/vault.rb @@ -1,10 +1,28 @@ class Vault < Formula desc "Vault" homepage "https://www.vaultproject.io" - - url "https://releases.hashicorp.com/vault/1.7.0/vault_1.7.0_darwin_amd64.zip" version "1.7.0" - sha256 "374fca0c8fcde45d5710e06673d03596371e92e18c33612396484758d2967d07" + + if OS.mac? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/vault/1.7.0/vault_1.7.0_darwin_amd64.zip" + sha256 "374fca0c8fcde45d5710e06673d03596371e92e18c33612396484758d2967d07" + end + + if OS.linux? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/vault/1.7.0/vault_1.7.0_linux_amd64.zip" + sha256 "aad2f50635ef4e3f2495b0b6c855061c4047c795821fda886b326c1a71c71c35" + end + + if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit? + url "https://releases.hashicorp.com/vault/1.7.0/vault_1.7.0_linux_arm.zip" + sha256 "b92f2fe00bdcc7b0046075d6132eca83123c11b286a8ca4897e4fb6008bf063c" + end + + if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit? + url "https://releases.hashicorp.com/vault/1.7.0/vault_1.7.0_linux_arm64.zip" + sha256 "ef5fd091c40452e4cd5c855de6cc85a6c9654790e707b342a0cb9fef48d80d2a" + end + bottle :unneeded conflicts_with "vault" @@ -15,36 +33,36 @@ def install plist_options manual: "vault server -dev" - def plist - <<~EOS - - - - - KeepAlive - - SuccessfulExit - - - Label - #{plist_name} - ProgramArguments - - #{opt_bin}/vault - server - -dev - - RunAtLoad - - WorkingDirectory - #{var} - StandardErrorPath - #{var}/log/vault.log - StandardOutPath - #{var}/log/vault.log - - - EOS + def plist; <<~EOS + + + + + KeepAlive + + SuccessfulExit + + + Label + #{plist_name} + ProgramArguments + + #{opt_bin}/vault + server + -dev + + RunAtLoad + + WorkingDirectory + #{var} + StandardErrorPath + #{var}/log/vault.log + StandardOutPath + #{var}/log/vault.log + + + +EOS end test do diff --git a/Formula/waypoint.rb b/Formula/waypoint.rb index a29e2ac4..870a7e02 100644 --- a/Formula/waypoint.rb +++ b/Formula/waypoint.rb @@ -1,20 +1,37 @@ class Waypoint < Formula desc "Waypoint" homepage "https://www.waypointproject.io/" + version "0.2.4" - url "https://releases.hashicorp.com/waypoint/0.2.4/waypoint_0.2.4_darwin_amd64.zip" + if OS.mac? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/waypoint/0.2.4/waypoint_0.2.4_darwin_amd64.zip" + sha256 "bda5d7427379d8679b7475a8c04ccf522ef2bbad6c20bc3bc3ecfe7a63a075c1" + end + + if OS.mac? && Hardware::CPU.arm? + url "https://releases.hashicorp.com/waypoint/0.2.4/waypoint_0.2.4_darwin_arm64.zip" + sha256 "713c73e67297fc31cfdaab26252ec4c3febef2a949353b2786af9cb21a372f9d" + end + + if OS.linux? && Hardware::CPU.intel? + url "https://releases.hashicorp.com/waypoint/0.2.4/waypoint_0.2.4_linux_amd64.zip" + sha256 "114c34148ad714e2ac0332b9e10437cf8402c37f8d0ad13c90410497fc47fdc1" + end + + if OS.linux? && Hardware::CPU.arm? && !Hardware::CPU.is_64_bit? + url "https://releases.hashicorp.com/waypoint/0.2.4/waypoint_0.2.4_linux_arm.zip" + sha256 "32024af1ee5088bb49a577cf9ce8fcdea83af07133cb8795c7c816847f0c0f82" + end - version "0.2.4" - sha256 "bda5d7427379d8679b7475a8c04ccf522ef2bbad6c20bc3bc3ecfe7a63a075c1" bottle :unneeded - #conflicts_with "waypoint" + conflicts_with "waypoint" def install bin.install "waypoint" end test do - system "#{bin}/waypoint version" + system "#{bin}/waypoint --version" end end